From aa1271c42c7e98c68bf104e4fc446b32c95d8e0b Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Sun, 22 Sep 2024 20:41:25 +0200 Subject: [PATCH] Update generated neovim config --- config/neovim/config.lua | 4 + config/neovim/config_nix.lua | 160 +- .../lazy-plugins/NrrwRgn/test/runtest.sh | 2 +- .../lazy-plugins/NrrwRgn/test/test1/cmd.sh | 2 +- .../lazy-plugins/NrrwRgn/test/test2/cmd.sh | 2 +- .../lazy-plugins/NrrwRgn/test/test3/cmd.sh | 2 +- .../lazy-plugins/NrrwRgn/test/test4/cmd.sh | 2 +- .../lazy-plugins/NrrwRgn/test/test5/cmd.sh | 2 +- .../lazy-plugins/NrrwRgn/test/test6/cmd.sh | 2 +- .../lazy-plugins/NrrwRgn/test/test7/cmd.sh | 2 +- .../lazy-plugins/better-escape.nvim/readme.md | 3 +- .../.github/workflows/formatting.yml | 2 +- .../.github/workflows/palette.yml | 2 +- .../.github/workflows/pandocvim.yml | 2 +- .../lazy-plugins/catppuccin-nvim/CHANGELOG.md | 12 + .../lazy-plugins/catppuccin-nvim/README.md | 48 +- .../catppuccin-nvim/doc/catppuccin.txt | 17 +- .../lua/catppuccin/groups/editor.lua | 6 +- .../groups/integrations/dadbod_ui.lua | 11 + .../catppuccin/groups/integrations/fzf.lua | 22 + .../catppuccin/groups/integrations/lir.lua | 26 + .../groups/integrations/render_markdown.lua | 9 +- .../catppuccin-nvim/lua/catppuccin/types.lua | 9 + .../catppuccin-nvim/renovate.json | 6 + .../lua/clangd_extensions/ast.lua | 16 +- .../lua/clangd_extensions/inlay_hints.lua | 4 +- .../lua/clangd_extensions/memory_usage.lua | 12 +- .../switch_source_header.lua | 6 +- .../plugin/clangd_extensions.lua | 82 +- .../lua/cmp_async_path/init.lua | 147 +- .../.github/ISSUE_TEMPLATE/bug_report.yml | 8 +- .../conform.nvim/.github/pre-commit | 2 +- .../conform.nvim/.github/pre-push | 2 +- .../conform.nvim/.github/workflows/tests.yml | 1 - .../lazy-plugins/conform.nvim/.luarc.json | 9 + .../lazy-plugins/conform.nvim/CHANGELOG.md | 41 + .../store/lazy-plugins/conform.nvim/README.md | 21 +- .../conform.nvim/doc/advanced_topics.md | 2 - .../lazy-plugins/conform.nvim/doc/conform.txt | 11 +- .../conform.nvim/doc/debugging.md | 94 + .../lazy-plugins/conform.nvim/doc/recipes.md | 30 - .../conform.nvim/lua/conform/errors.lua | 13 +- .../lua/conform/formatters/cljfmt.lua | 10 + .../lua/conform/formatters/deno_fmt.lua | 1 + .../lua/conform/formatters/djlint.lua | 7 +- .../lua/conform/formatters/docformatter.lua | 1 + .../lua/conform/formatters/injected.lua | 3 +- .../lua/conform/formatters/markdownfmt.lua | 8 + .../lua/conform/formatters/nixfmt.lua | 4 +- .../lua/conform/formatters/sqlfluff.lua | 4 +- .../lua/conform/formatters/superhtml.lua | 9 + .../lua/conform/formatters/ziggy.lua | 9 + .../lua/conform/formatters/ziggy_schema.lua | 9 + .../conform.nvim/lua/conform/health.lua | 26 +- .../conform.nvim/lua/conform/init.lua | 13 +- .../conform.nvim/lua/conform/log.lua | 2 +- .../conform.nvim/lua/conform/runner.lua | 106 +- .../conform.nvim/lua/conform/util.lua | 51 +- .../lazy-plugins/conform.nvim/run_tests.sh | 2 +- .../conform.nvim/scripts/generate.py | 14 +- .../conform.nvim/tests/fake_formatter.sh | 2 +- .../conform.nvim/tests/runner_spec.lua | 57 +- .../conform.nvim/tests/util_spec.lua | 72 + .../direnv.vim/autoload/direnv.vim | 2 +- .../lazy-plugins/flash.nvim/scripts/docs | 2 +- .../lazy-plugins/flash.nvim/scripts/test | 2 +- .../.github/workflows/ci.yml | 24 +- .../lazy-plugins/git-messenger.vim/README.md | 4 +- .../autoload/health/gitmessenger.vim | 46 +- .../gitsigns.nvim/doc/gitsigns.txt | 4 + .../gitsigns.nvim/scm-1/doc/gitsigns.txt | 4 + .../scm-1/gitsigns.nvim-scm-1.rockspec | 0 .../gitsigns.nvim/scm-1/rock_manifest | 20 +- .../manifest | 0 .../gitsigns.nvim/lua/gitsigns/actions.lua | 25 +- .../gitsigns.nvim/lua/gitsigns/async.lua | 53 +- .../gitsigns.nvim/lua/gitsigns/cache.lua | 6 + .../gitsigns.nvim/lua/gitsigns/config.lua | 4 + .../lua/gitsigns/current_line_blame.lua | 13 +- .../gitsigns.nvim/lua/gitsigns/git.lua | 75 +- .../gitsigns.nvim/lua/gitsigns/git/cmd.lua | 4 +- .../gitsigns.nvim/lua/gitsigns/git/repo.lua | 13 +- .../gitsigns.nvim/lua/gitsigns/manager.lua | 3 + .../nix-support/propagated-build-inputs | 2 +- .../lazy-plugins/gitsigns.nvim/rock_manifest | 20 +- .../nix-support/propagated-build-inputs | 2 +- .../store/lazy-plugins/lazygit.nvim/README.md | 3 - .../lualine.nvim/lua/lualine_require.lua | 7 +- .../lazy-plugins/luasnip/doc/luasnip.txt | 49 +- .../store/lazy-plugins/luasnip/doc/tags | 1 + .../luasnip/lua/luasnip/config.lua | 12 +- .../luasnip/lua/luasnip/default_config.lua | 5 +- .../lazy-plugins/luasnip/lua/luasnip/init.lua | 6 +- .../luasnip/lua/luasnip/nodes/snippet.lua | 13 +- .../luasnip/lua/luasnip/util/select.lua | 25 +- .../luasnip/2.3.0-1/doc/luasnip.txt | 49 +- .../luasnip/2.3.0-1/ftplugin/snippets.vim | 0 .../luasnip/2.3.0-1/luasnip-2.3.0-1.rockspec | 0 .../luasnip/2.3.0-1/plugin/luasnip.lua | 0 .../luasnip/2.3.0-1/plugin/luasnip.vim | 0 .../luasnip/2.3.0-1/rock_manifest | 12 +- .../luasnip/2.3.0-1/syntax/snippets.vim | 0 .../manifest | 0 .../nix-support/propagated-build-inputs | 2 +- .../store/lazy-plugins/luasnip/rock_manifest | 12 +- .../mini.nvim/.github/workflows/lint.yml | 20 - .../mini.nvim/.github/workflows/tests.yml | 14 +- .../store/lazy-plugins/mini.nvim/CHANGELOG.md | 45 +- .../lazy-plugins/mini.nvim/CONTRIBUTING.md | 7 +- .../lazy-plugins/mini.nvim/MAINTAINING.md | 1 - .../store/lazy-plugins/mini.nvim/Makefile | 3 - .../store/lazy-plugins/mini.nvim/README.md | 2 +- .../mini.nvim/benchmarks/starter/benchmark.sh | 2 +- .../mini.nvim/benchmarks/starter/install.sh | 2 +- .../mini.nvim/doc/mini-base16.txt | 1 + .../mini.nvim/doc/mini-completion.txt | 28 +- .../lazy-plugins/mini.nvim/doc/mini-extra.txt | 6 +- .../lazy-plugins/mini.nvim/doc/mini-files.txt | 153 +- .../lazy-plugins/mini.nvim/doc/mini-git.txt | 3 +- .../lazy-plugins/mini.nvim/doc/mini-hues.txt | 1 + .../lazy-plugins/mini.nvim/doc/mini-misc.txt | 14 +- .../lazy-plugins/mini.nvim/doc/mini-pick.txt | 11 +- .../mini.nvim/doc/mini-statusline.txt | 4 +- .../lazy-plugins/mini.nvim/doc/mini-test.txt | 2 + .../store/lazy-plugins/mini.nvim/doc/tags | 3 + .../lazy-plugins/mini.nvim/lua/mini/ai.lua | 19 +- .../lazy-plugins/mini.nvim/lua/mini/align.lua | 9 +- .../mini.nvim/lua/mini/animate.lua | 9 +- .../mini.nvim/lua/mini/base16.lua | 179 +- .../mini.nvim/lua/mini/basics.lua | 4 +- .../mini.nvim/lua/mini/bracketed.lua | 34 +- .../lazy-plugins/mini.nvim/lua/mini/clue.lua | 10 +- .../mini.nvim/lua/mini/completion.lua | 83 +- .../mini.nvim/lua/mini/cursorword.lua | 6 +- .../lazy-plugins/mini.nvim/lua/mini/deps.lua | 14 +- .../lazy-plugins/mini.nvim/lua/mini/diff.lua | 5 +- .../lazy-plugins/mini.nvim/lua/mini/doc.lua | 8 +- .../lazy-plugins/mini.nvim/lua/mini/extra.lua | 88 +- .../lazy-plugins/mini.nvim/lua/mini/files.lua | 713 ++-- .../lazy-plugins/mini.nvim/lua/mini/git.lua | 58 +- .../mini.nvim/lua/mini/hipatterns.lua | 5 +- .../lazy-plugins/mini.nvim/lua/mini/hues.lua | 32 +- .../lazy-plugins/mini.nvim/lua/mini/icons.lua | 13 +- .../mini.nvim/lua/mini/indentscope.lua | 26 +- .../lazy-plugins/mini.nvim/lua/mini/jump.lua | 5 +- .../mini.nvim/lua/mini/jump2d.lua | 7 +- .../lazy-plugins/mini.nvim/lua/mini/map.lua | 7 +- .../lazy-plugins/mini.nvim/lua/mini/misc.lua | 53 +- .../lazy-plugins/mini.nvim/lua/mini/move.lua | 21 +- .../mini.nvim/lua/mini/notify.lua | 12 +- .../mini.nvim/lua/mini/operators.lua | 10 +- .../lazy-plugins/mini.nvim/lua/mini/pairs.lua | 4 +- .../lazy-plugins/mini.nvim/lua/mini/pick.lua | 102 +- .../mini.nvim/lua/mini/sessions.lua | 47 +- .../mini.nvim/lua/mini/starter.lua | 14 +- .../mini.nvim/lua/mini/statusline.lua | 12 +- .../mini.nvim/lua/mini/surround.lua | 24 +- .../mini.nvim/lua/mini/tabline.lua | 14 +- .../lazy-plugins/mini.nvim/lua/mini/test.lua | 15 +- .../mini.nvim/lua/mini/trailspace.lua | 6 +- .../mini.nvim/lua/mini/visits.lua | 25 +- .../mini.nvim/readmes/mini-base16.md | 1 + .../mini.nvim/readmes/mini-completion.md | 17 +- .../mini.nvim/readmes/mini-files.md | 6 +- .../mini.nvim/readmes/mini-hues.md | 1 + .../mini.nvim/readmes/mini-statusline.md | 4 +- .../mini.nvim/readmes/mini-test.md | 1 + .../mini.nvim/scripts/basic-setup_init.lua | 67 - .../mini.nvim/scripts/lintcommit-ci.sh | 2 +- .../mini.nvim/scripts/minimal_init.lua | 6 + .../tests/dir-completion/mock-months-lsp.lua | 2 +- .../mini.nvim/tests/dir-extra/mocks/lsp.lua | 18 +- .../mini.nvim/tests/dir-extra/mocks/spawn.lua | 14 +- .../mini.nvim/tests/dir-files/real/top-secret | 0 .../mini.nvim/tests/dir-git/deps-confirm | 38 + .../mini.nvim/tests/dir-pick/mocks/spawn.lua | 12 +- .../lazy-plugins/mini.nvim/tests/helpers.lua | 40 +- ...on---respects-`kind_hlgroup`-as-item-field | 23 + .../tests-test_deps.lua---clean()---works | 52 +- .../tests-test_deps.lua---clean()---works-002 | 50 +- ...ua---update()---can-fold-in-confirm-buffer | 110 +- ...-update()---can-highlight-breaking-changes | 126 +- ...ate()---can-work-with-non-default-branches | 124 +- ...s.lua---update()---shows-empty-monitor-log | 102 +- .../tests-test_deps.lua---update()---works | 156 +- ...symbol`-after-`MiniIcons.tweak_lsp_kind()` | 33 + ...ol`-after-`MiniIcons.tweak_lsp_kind()`-002 | 33 + ...ol`-after-`MiniIcons.tweak_lsp_kind()`-003 | 33 + ...symbol`-after-`MiniIcons.tweak_lsp_kind()` | 33 + ...ol`-after-`MiniIcons.tweak_lsp_kind()`-002 | 33 + ...ol`-after-`MiniIcons.tweak_lsp_kind()`-003 | 33 + ...stomize-internally-set-window-config-parts | 33 + ...ize-internally-set-window-config-parts-002 | 33 + ...ize-internally-set-window-config-parts-003 | 33 + ...ze-internally-set-window-config-parts-004} | 32 +- ...ize-internally-set-window-config-parts-005 | 33 + ...ation---handles-simultaneous-copy-and-move | 33 - ...n---handles-simultaneous-copy-and-move-002 | 33 - ...ion---handles-simultaneous-copy-and-rename | 33 - ...pulation---move-works-again-after-undo-002 | 2 +- ...t_files.lua---Mappings---`show_help`-works | 32 +- ...les.lua---Mappings---`show_help`-works-002 | 32 +- ...les.lua---Mappings---`show_help`-works-003 | 8 +- ...test_files.lua---Preview---works-for-files | 8 +- ..._files.lua---Preview---works-for-files-002 | 8 +- ..._files.lua---Preview---works-for-files-003 | 8 +- ..._files.lua---Preview---works-for-files-004 | 8 +- ..._files.lua---Preview---works-for-files-005 | 8 +- ..._files.lua---Preview---works-for-files-006 | 33 + ...()---warns-about-paths-not-present-on-disk | 33 + ...st_files.lua---open()---uses-icon-provider | 8 +- ...iles.lua---open()---uses-icon-provider-002 | 8 +- ...iles.lua---open()---uses-icon-provider-003 | 8 +- ...ests-test_files.lua---set_branch()---works | 27 + ...-test_files.lua---set_branch()---works-002 | 27 + ...-test_files.lua---set_branch()---works-003 | 27 + ..._branch()---works-with-file-path-in-branch | 27 + ...nch()---works-with-file-path-in-branch-002 | 27 + ...es.lua---set_branch()---works-with-preview | 27 + ...s.lua---show_help()---adjusts-window-width | 32 +- ...iles.lua---show_help()---handles-bookmarks | 63 + ...p()---handles-mappings-without-description | 32 +- ...show_help()---handles-non-default-mappings | 36 +- ...w_help()---opens-relatively-current-window | 32 +- ...tests-test_files.lua---show_help()---works | 32 +- ...s-test_files.lua---show_help()---works-002 | 8 +- ...t---completion---works-with-explicit-paths | 10 +- ...ion---works-with-not-supported-command-003 | 40 +- ...completion---works-with-subcommand-targets | 40 +- ...letion---works-with-subcommand-targets-002 | 10 +- ...letion---works-with-subcommand-targets-003 | 40 +- ...letion---works-with-subcommand-targets-004 | 10 +- ...letion---works-with-subcommand-targets-005 | 40 +- ...letion---works-with-subcommand-targets-006 | 40 +- ...letion---works-with-subcommand-targets-010 | 40 +- ...s-on-wrapped-lines-without-overlapping-003 | 23 + ...sts-test_pick.lua---builtin.grep()---works | 2 +- ...fault_preview()---works-for-file-path-004} | 10 +- ...lt_preview()---works-without-active-picker | 2 +- ...review()---works-without-active-picker-002 | 2 +- .../lazy-plugins/mini.nvim/tests/test_ai.lua | 50 +- .../mini.nvim/tests/test_align.lua | 20 +- .../mini.nvim/tests/test_animate.lua | 102 +- .../mini.nvim/tests/test_bracketed.lua | 31 +- .../mini.nvim/tests/test_clue.lua | 59 +- .../mini.nvim/tests/test_colors.lua | 73 +- .../mini.nvim/tests/test_completion.lua | 238 +- .../mini.nvim/tests/test_cursorword.lua | 43 +- .../mini.nvim/tests/test_deps.lua | 111 +- .../mini.nvim/tests/test_diff.lua | 100 +- .../mini.nvim/tests/test_extra.lua | 273 +- .../mini.nvim/tests/test_files.lua | 2032 ++++++++++-- .../lazy-plugins/mini.nvim/tests/test_git.lua | 239 +- .../mini.nvim/tests/test_hipatterns.lua | 111 +- .../mini.nvim/tests/test_icons.lua | 18 +- .../mini.nvim/tests/test_indentscope.lua | 93 +- .../mini.nvim/tests/test_jump.lua | 80 +- .../mini.nvim/tests/test_jump2d.lua | 31 +- .../lazy-plugins/mini.nvim/tests/test_map.lua | 14 +- .../mini.nvim/tests/test_misc.lua | 135 +- .../mini.nvim/tests/test_move.lua | 135 +- .../mini.nvim/tests/test_notify.lua | 65 +- .../mini.nvim/tests/test_operators.lua | 202 +- .../mini.nvim/tests/test_pairs.lua | 29 +- .../mini.nvim/tests/test_pick.lua | 241 +- .../mini.nvim/tests/test_sessions.lua | 39 +- .../mini.nvim/tests/test_starter.lua | 46 +- .../mini.nvim/tests/test_statusline.lua | 30 +- .../mini.nvim/tests/test_surround.lua | 102 +- .../mini.nvim/tests/test_tabline.lua | 20 +- .../mini.nvim/tests/test_test.lua | 34 +- .../mini.nvim/tests/test_trailspace.lua | 5 + .../mini.nvim/tests/test_visits.lua | 238 +- .../lazy-plugins/neo-tree.nvim/README.md | 11 + .../neo-tree.nvim/lua/neo-tree/defaults.lua | 13 +- .../neo-tree/sources/common/components.lua | 34 +- .../sources/document_symbols/components.lua | 14 +- .../neo-tree.nvim/scripts/test.sh | 2 +- .../lazy-plugins/noice.nvim/scripts/test | 2 +- .../nix-support/propagated-build-inputs | 2 +- .../nvim-autopairs/.github/FUNDING.yml | 2 +- .../.github/workflows/sponsors.yml | 25 + .../lazy-plugins/nvim-autopairs/README.md | 6 +- .../nvim-autopairs/lua/nvim-autopairs.lua | 18 +- .../lua/nvim-autopairs/completion/cmp.lua | 3 +- .../lua/nvim-autopairs/fastwrap.lua | 4 + .../lua/nvim-autopairs/rule.lua | 7 +- .../lua/nvim-autopairs/rules/basic.lua | 1 + .../nix-support/propagated-build-inputs | 2 +- .../store/lazy-plugins/nvim-jdtls/lemmy.sh | 2 +- .../lazy-plugins/nvim-jdtls/lua/jdtls.lua | 9 +- .../store/lazy-plugins/nvim-lint/.luarc.json | 7 +- .../store/lazy-plugins/nvim-lint/README.md | 47 +- .../store/lazy-plugins/nvim-lint/lua/lint.lua | 8 +- .../nvim-lint/lua/lint/linters/clippy.lua | 52 + .../nvim-lint/lua/lint/linters/codespell.lua | 30 +- .../nvim-lint/lua/lint/linters/cspell.lua | 2 +- .../nvim-lint/lua/lint/linters/eugene.lua | 26 + .../nvim-lint/lua/lint/linters/hledger.lua | 27 + .../nvim-lint/lua/lint/linters/mypy.lua | 4 + .../nvim-lint/lua/lint/linters/pylint.lua | 10 +- .../nvim-lint/lua/lint/linters/sqlfluff.lua | 6 +- .../lua/lint/linters/systemd-analyze.lua | 11 + .../nvim-lint/lua/lint/linters/tidy.lua | 1 + .../nvim-lint/lua/lint/parser.lua | 38 +- .../nvim-lint/tests/codespell_spec.lua | 21 + .../nvim-lint/tests/hledger_spec.lua | 59 + .../nvim-lint/tests/parser_spec.lua | 54 + .../nvim-lint/tests/sqlfluff_spec.lua | 9 +- .../.github/workflows/release.yml | 2 +- .../nvim-lspconfig/.github/workflows/test.yml | 2 +- .../doc/server_configurations.md | 402 ++- .../doc/server_configurations.txt | 402 ++- .../nvim-lspconfig/lua/lspconfig.lua | 4 + .../lspconfig/server_configurations/als.lua | 4 + .../{bazelrc-lsp.lua => bazelrc_lsp.lua} | 0 .../server_configurations/clangd.lua | 31 + .../server_configurations/daedalus_ls.lua | 28 + .../server_configurations/fortls.lua | 4 +- .../haxe_language_server.lua | 43 +- .../lspconfig/server_configurations/htmx.lua | 49 +- .../server_configurations/hyprls.lua | 2 +- .../server_configurations/jsonls.lua | 2 +- .../lspconfig/server_configurations/kcl.lua | 20 + .../server_configurations/mesonlsp.lua | 4 +- .../r_language_server.lua | 2 +- .../server_configurations/rescriptls.lua | 26 +- .../scheme_langserver.lua | 3 +- .../server_configurations/snakeskin_ls.lua | 19 + .../server_configurations/svelte.lua | 2 +- .../server_configurations/swift_mesonls.lua | 4 +- .../lspconfig/server_configurations/taplo.lua | 4 +- .../server_configurations/teal_ls.lua | 14 +- .../server_configurations/texlab.lua | 100 +- .../{tsserver.lua => ts_ls.lua} | 4 +- .../tvm_ffi_navigator.lua | 19 + .../server_configurations/typos_lsp.lua | 1 - .../server_configurations/v_analyzer.lua | 4 +- .../lspconfig/server_configurations/volar.lua | 4 +- .../server_configurations/wgsl_analyzer.lua | 2 +- .../lspconfig/server_configurations/ziggy.lua | 21 + .../server_configurations/ziggy_schema.lua | 21 + .../lspconfig/server_configurations/zk.lua | 31 + .../nvim-lspconfig/scripts/docgen.sh | 2 +- .../lazy-plugins/nvim-notify/scripts/docgen | 2 +- .../lazy-plugins/nvim-notify/scripts/style | 2 +- .../lazy-plugins/nvim-notify/scripts/test | 2 +- .../nvim-treesitter/.github/CODEOWNERS | 7 - .../.github/workflows/lint.yml | 2 +- .../.github/workflows/update-lockfile.yml | 6 +- .../.github/workflows/update-readme.yml | 4 +- .../lazy-plugins/nvim-treesitter/README.md | 19 +- .../nvim-treesitter/lockfile.json | 205 +- .../lua/nvim-treesitter/parsers.lua | 63 +- .../lua/nvim-treesitter/query.lua | 2 +- .../lua/nvim-treesitter/query_predicates.lua | 23 +- .../shell_command_selectors.lua | 4 +- .../queries/c_sharp/highlights.scm | 12 +- .../queries/cpp/highlights.scm | 2 +- .../nvim-treesitter/queries/diff/folds.scm | 5 + .../queries/ecma/highlights.scm | 4 - .../queries/ecma/injections.scm | 76 +- .../queries/editorconfig/highlights.scm | 3 +- .../nvim-treesitter/queries/gap/folds.scm | 12 + .../queries/gap/highlights.scm | 208 ++ .../queries/gap/injections.scm | 2 + .../nvim-treesitter/queries/gap/locals.scm | 43 + .../nvim-treesitter/queries/gaptst/folds.scm | 7 + .../queries/gaptst/highlights.scm | 19 + .../queries/gaptst/injections.scm | 9 + .../queries/git_config/highlights.scm | 2 +- .../nvim-treesitter/queries/gleam/locals.scm | 3 + .../queries/glimmer/injections.scm | 19 + .../queries/glimmer_javascript/highlights.scm | 61 + .../queries/glimmer_javascript/indents.scm | 5 + .../queries/glimmer_javascript/injections.scm | 15 + .../queries/glimmer_javascript/locals.scm | 1 + .../queries/glimmer_typescript/highlights.scm | 6 + .../queries/glimmer_typescript/indents.scm | 3 + .../queries/glimmer_typescript/injections.scm | 15 + .../nvim-treesitter/queries/go/indents.scm | 2 +- .../queries/http/highlights.scm | 56 +- .../queries/http/injections.scm | 15 +- .../queries/idl/highlights.scm | 2 +- .../queries/ini/highlights.scm | 4 +- .../queries/ini/injections.scm | 3 +- .../queries/inko/highlights.scm | 2 + .../queries/julia/injections.scm | 1 + .../queries/kotlin/highlights.scm | 2 +- .../queries/latex/highlights.scm | 13 +- .../queries/leo/highlights.scm | 44 +- .../queries/liquid/highlights.scm | 2 + .../nvim-treesitter/queries/lua/indents.scm | 1 + .../queries/make/highlights.scm | 16 + .../queries/markdown_inline/highlights.scm | 5 + .../queries/matlab/highlights.scm | 3 + .../nvim-treesitter/queries/mermaid/folds.scm | 10 + .../queries/mermaid/indents.scm | 18 + .../nvim-treesitter/queries/perl/folds.scm | 13 +- .../queries/perl/highlights.scm | 25 +- .../queries/php_only/highlights.scm | 25 +- .../queries/php_only/indents.scm | 6 +- .../queries/php_only/locals.scm | 2 +- .../nvim-treesitter/queries/proto/indents.scm | 11 + .../queries/query/highlights.scm | 5 +- .../nvim-treesitter/queries/r/locals.scm | 0 .../queries/ruby/highlights.scm | 27 +- .../queries/rust/highlights.scm | 27 +- .../queries/sflog/highlights.scm | 48 + .../queries/snakemake/highlights.scm | 24 +- .../queries/snakemake/indents.scm | 9 + .../queries/tact/highlights.scm | 4 - .../nvim-treesitter/queries/tact/locals.scm | 4 +- .../nvim-treesitter/queries/wing/folds.scm | 4 +- .../queries/wing/highlights.scm | 98 +- .../queries/wing/injections.scm | 13 + .../nvim-treesitter/queries/zig/folds.scm | 33 +- .../queries/zig/highlights.scm | 310 +- .../nvim-treesitter/queries/zig/indents.scm | 15 +- .../queries/zig/injections.scm | 14 +- .../nvim-treesitter/scripts/check-queries.lua | 2 +- .../nvim-treesitter/scripts/ci-install.sh | 2 +- .../scripts/format-queries.lua | 8 +- .../nvim-treesitter/scripts/pre-push | 2 +- .../nvim-treesitter/scripts/run_tests.sh | 2 +- .../scripts/update-lockfile.sh | 2 +- .../nvim-treesitter/scripts/update-readme.lua | 2 +- .../scripts/write-lockfile.lua | 2 +- .../tests/indent/lua/string.lua | 4 + .../nvim-treesitter/tests/indent/lua_spec.lua | 1 + .../tests/indent/php/property-hooks.php | 13 + .../nvim-treesitter/tests/indent/php_spec.lua | 5 + .../tests/query/highlights/php/keywords.php | 35 + .../tests/query/highlights/wing/class.w | 6 +- .../lua/ts_context_commentstring.lua | 2 +- .../lua/ts_context_commentstring/config.lua | 20 +- .../lua/ts_context_commentstring/internal.lua | 2 +- .../lua/ts_context_commentstring/utils.lua | 4 +- .../utils/run_minimal.sh | 2 +- .../store/lazy-plugins/nvim-ufo/README.md | 3 +- .../nvim-ufo/coc-extension/index.js | 9 +- .../nvim-ufo/lua/ufo/model/buffer.lua | 9 +- .../nvim-ufo/lua/ufo/provider/indent.lua | 184 +- .../nvim-ufo/lua/ufo/provider/marker.lua | 236 +- .../nvim-ufo/lua/ufo/provider/treesitter.lua | 5 +- .../lua/nvim-web-devicons/icons-default.lua | 96 +- .../lua/nvim-web-devicons/icons-light.lua | 116 +- .../scripts/filetype-generator.sh | 2 +- .../.github/ISSUE_TEMPLATE/bug_report.yml | 13 +- .../persisted.nvim/.github/workflows/ci.yml | 21 +- .../lazy-plugins/persisted.nvim/CHANGELOG.md | 16 + .../lazy-plugins/persisted.nvim/Makefile | 1 + .../lazy-plugins/persisted.nvim/README.md | 262 +- .../persisted.nvim/doc/persisted.nvim.txt | 311 +- .../lazy-plugins/persisted.nvim/doc/tags | 2 +- .../persisted.nvim/lua/persisted/config.lua | 57 +- .../lua/persisted/deprecate.lua | 38 - .../persisted.nvim/lua/persisted/init.lua | 524 +-- .../persisted.nvim/lua/persisted/log.lua | 280 -- .../persisted.nvim/lua/persisted/utils.lua | 168 +- .../lua/telescope/_extensions/persisted.lua | 72 +- .../_extensions/persisted/actions.lua | 38 +- .../_extensions/persisted/finders.lua | 18 +- .../persisted.nvim/plugin/persisted.lua | 19 +- .../tests/default_settings_spec.lua | 21 +- .../persisted.nvim/tests/dirs_spec.lua | 42 + .../tests/follow_cwd/follow_cwd_spec.lua | 25 +- .../git_branching/git_branching_spec.lua | 17 +- .../persisted.nvim/tests/minimal.vim | 1 + .../nix-support/propagated-build-inputs | 2 +- .../rainbow-delimiters.nvim/.busted | 3 +- .../rainbow-delimiters.nvim/.nvimrc | 2 +- .../rainbow-delimiters.nvim/CHANGELOG.rst | 45 + .../rainbow-delimiters.nvim/HACKING.rst | 148 +- .../rainbow-delimiters.nvim/TODO.rst | 29 +- .../doc/rainbow-delimiters.txt | 13 +- .../lua/rainbow-delimiters.types.lua | 2 + .../rainbow-delimiters/_test/highlight.lua | 2 +- .../lua/rainbow-delimiters/config.lua | 7 + .../lua/rainbow-delimiters/health.lua | 1 + .../rainbow-delimiters/strategy/christmas.lua | 3 +- .../rainbow-delimiters.nvim/makefile | 6 +- .../plugin/rainbow-delimiters.lua | 4 +- .../queries/commonlisp/rainbow-delimiters.scm | 2 - .../queries/cpp/rainbow-delimiters.scm | 6 +- .../queries/go/rainbow-delimiters.scm | 2 +- .../queries/luadoc/rainbow-delimiters.scm | 20 +- .../queries/ruby/rainbow-delimiters.scm | 1 + .../queries/rust/rainbow-delimiters.scm | 1 + .../queries/sql/rainbow-delimiters.scm | 15 +- .../queries/vim/rainbow-delimiters.scm | 84 +- .../queries/zig/rainbow-delimiters.scm | 75 +- .../test/{ => bin}/busted | 2 +- .../test/{nvim-shim => bin/lua} | 2 +- .../rainbow-delimiters.nvim/test/bin/nvim | 38 + .../test/e2e/selective-activation.lua | 104 +- .../test/e2e/strategy/global.lua | 35 +- .../test/highlight/busted.lua | 2 +- .../test/highlight/samples/bash/regular.sh | 2 +- .../test/highlight/samples/cpp/regular.cpp | 2 +- .../test/highlight/samples/cuda/regular.cu | 2 +- .../test/highlight/samples/sql/regular.sql | 4 +- .../test/highlight/samples/vim/regular.vim | 14 +- .../awk/rainbow-delimiters/regular.awk.lua | 112 +- .../bash/rainbow-delimiters/regular.sh.lua | 68 +- .../spec/c/rainbow-delimiters/regular.c.lua | 238 +- .../rainbow-delimiters/HelloWorld.cs.lua | 16 +- .../c_sharp/rainbow-delimiters/array.cs.lua | 110 +- .../rainbow-delimiters/attributes.cs.lua | 26 +- .../rainbow-delimiters/generics.cs.lua | 56 +- .../c_sharp/rainbow-delimiters/loop.cs.lua | 64 +- .../c_sharp/rainbow-delimiters/misc.cs.lua | 174 +- .../c_sharp/rainbow-delimiters/parens.cs.lua | 48 +- .../c_sharp/rainbow-delimiters/switch.cs.lua | 174 +- .../rainbow-delimiters/regular.clj.lua | 78 +- .../rainbow-delimiters/regular.lisp.lua | 84 +- .../cpp/rainbow-delimiters/regular.cpp.lua | 286 +- .../css/rainbow-delimiters/regular.css.lua | 44 +- .../cuda/rainbow-delimiters/regular.cu.lua | 318 +- .../cue/rainbow-delimiters/regular.cue.lua | 68 +- .../dart/rainbow-delimiters/regular.dart.lua | 100 +- .../elixir/rainbow-delimiters/regular.exs.lua | 180 +- .../elm/rainbow-delimiters/Regular.elm.lua | 266 +- .../fennel/rainbow-delimiters/regular.fnl.lua | 546 +-- .../fish/rainbow-delimiters/regular.fish.lua | 16 +- .../spec/go/rainbow-delimiters/regular.go.lua | 314 +- .../haskell/rainbow-delimiters/regular.hs.lua | 102 +- .../html/rainbow-delimiters/regular.html.lua | 208 +- .../rainbow-delimiters/regular.html.lua | 88 +- .../rainbow-delimiters/regular.janet.lua | 544 +-- .../rainbow-delimiters/HelloWorld.java.lua | 204 +- .../rainbow-delimiters/LambdaTest.java.lua | 16 +- .../rainbow-delimiters-react/regular.js.lua | 168 +- .../rainbow-delimiters/regular.js.lua | 168 +- .../json/rainbow-delimiters/regular.json.lua | 16 +- .../rainbow-delimiters/regular.json5.lua | 32 +- .../rainbow-delimiters/regular.jsonc.lua | 18 +- .../rainbow-delimiters/arithmetic.jsonnet.lua | 64 +- .../cocktail-comprehensions.jsonnet.lua | 60 +- .../computed-fields.jsonnet.lua | 40 +- .../rainbow-delimiters/function.jsonnet.lua | 78 +- .../julia/rainbow-delimiters/regular.jl.lua | 42 +- .../kotlin/rainbow-delimiters/Test.kt.lua | 314 +- .../spec/latex/rainbow-blocks/regular.tex.lua | 8 +- .../latex/rainbow-delimiters/regular.tex.lua | 72 +- .../spec/lua/rainbow-blocks/regular.lua.lua | 164 +- .../lua/rainbow-delimiters/regular.lua.lua | 134 +- .../luadoc/rainbow-delimiters/regular.lua.lua | 134 +- .../spec/make/rainbow-delimiters/makefile.lua | 20 +- .../rainbow-delimiters/regular.md.lua | 236 +- .../nim/rainbow-delimiters/regular.nim.lua | 246 +- .../nix/rainbow-delimiters/regular.nix.lua | 70 +- .../php/rainbow-delimiters/regular.php.lua | 72 +- .../python/rainbow-delimiters/regular.py.lua | 248 +- .../spec/query/rainbow-blocks/regular.scm.lua | 44 +- .../query/rainbow-delimiters/regular.scm.lua | 36 +- .../spec/r/rainbow-delimiters/regular.r.lua | 112 +- .../racket/rainbow-delimiters/regular.rkt.lua | 362 +- .../rasi/rainbow-delimiters/regular.rasi.lua | 62 +- .../regex/rainbow-delimiters/regular.txt.lua | 80 +- .../rst/rainbow-delimiters/regular.rst.lua | 222 +- .../ruby/rainbow-delimiters/regular.rb.lua | 88 +- .../rust/rainbow-delimiters/regular.rs.lua | 516 ++- .../scheme/rainbow-delimiters/regular.scm.lua | 112 +- .../scss/rainbow-delimiters/regular.scss.lua | 24 +- .../sql/rainbow-delimiters/regular.sql.lua | 358 +- .../rainbow-delimiters/regular.svelte.lua | 152 +- .../teal/rainbow-delimiters/regular.tl.lua | 86 +- .../toml/rainbow-delimiters/regular.toml.lua | 38 +- .../tsx/rainbow-delimiters/regular.tsx.lua | 402 +-- .../spec/tsx/rainbow-parens/regular.tsx.lua | 198 +- .../tsx/rainbow-tags-react/regular.tsx.lua | 168 +- .../rainbow-delimiters/regular.d.ts.lua | 8 +- .../rainbow-delimiters/regular.ts.lua | 182 +- .../typst/rainbow-delimiters/regular.typ.lua | 80 +- .../spec/verilog/rainbow-blocks/regular.v.lua | 134 +- .../verilog/rainbow-delimiters/regular.v.lua | 102 +- .../vim/rainbow-delimiters/regular.vim.lua | 390 ++- .../rainbow-delimiters/pug-template.vue.lua | 32 +- .../vue/rainbow-delimiters/regular.vue.lua | 168 +- .../vue/rainbow-delimiters/scss-style.vue.lua | 36 +- .../typescript-script.vue.lua | 42 +- .../wgsl/rainbow-delimiters/regular.wgsl.lua | 176 +- .../xml/rainbow-delimiters/regular.xml.lua | 148 +- .../yaml/rainbow-delimiters/regular.yaml.lua | 64 +- .../zig/rainbow-delimiters/regular.zig.lua | 282 +- .../start/nvim-treesitter/.github/CODEOWNERS | 7 - .../.github/workflows/lint.yml | 2 +- .../start/nvim-treesitter/CONTRIBUTING.md | 4 +- .../testing/start/nvim-treesitter/README.md | 22 +- .../start/nvim-treesitter/lockfile.json | 206 +- .../lua/nvim-treesitter/parsers.lua | 88 +- .../lua/nvim-treesitter/query.lua | 2 +- .../shell_command_selectors.lua | 6 +- .../nvim-treesitter/queries/c/highlights.scm | 2 +- .../queries/c_sharp/highlights.scm | 12 +- .../queries/clojure/highlights.scm | 2 +- .../nvim-treesitter/queries/d/injections.scm | 7 +- .../nvim-treesitter/queries/d/locals.scm | 2 +- .../nvim-treesitter/queries/diff/folds.scm | 5 + .../queries/djot/highlights.scm | 8 +- .../queries/dockerfile/highlights.scm | 2 +- .../queries/doxygen/highlights.scm | 2 +- .../queries/dtd/highlights.scm | 2 +- .../queries/ecma/highlights.scm | 22 +- .../queries/ecma/injections.scm | 77 +- .../queries/editorconfig/highlights.scm | 3 +- .../queries/erlang/highlights.scm | 10 +- .../queries/firrtl/highlights.scm | 2 +- .../nvim-treesitter/queries/gap/folds.scm | 12 + .../queries/gap/highlights.scm | 208 ++ .../queries/gap/injections.scm | 2 + .../nvim-treesitter/queries/gap/locals.scm | 43 + .../nvim-treesitter/queries/gaptst/folds.scm | 7 + .../queries/gaptst/highlights.scm | 19 + .../queries/gaptst/injections.scm | 9 + .../queries/gdscript/locals.scm | 6 +- .../queries/git_config/highlights.scm | 2 +- .../queries/glimmer/injections.scm | 19 + .../queries/glimmer_javascript/highlights.scm | 61 + .../queries/glimmer_javascript/indents.scm | 5 + .../queries/glimmer_javascript/injections.scm | 15 + .../queries/glimmer_javascript/locals.scm | 1 + .../queries/glimmer_typescript/highlights.scm | 6 + .../queries/glimmer_typescript/indents.scm | 3 + .../queries/glimmer_typescript/injections.scm | 15 + .../nvim-treesitter/queries/go/indents.scm | 2 +- .../queries/groovy/highlights.scm | 2 + .../queries/hare/highlights.scm | 6 +- .../nvim-treesitter/queries/hare/indents.scm | 3 +- .../queries/haskell/highlights.scm | 6 +- .../queries/html_tags/highlights.scm | 5 +- .../queries/http/highlights.scm | 56 +- .../queries/http/injections.scm | 15 +- .../queries/idl/highlights.scm | 2 +- .../queries/ini/highlights.scm | 4 +- .../queries/ini/injections.scm | 3 +- .../queries/inko/highlights.scm | 2 + .../queries/java/highlights.scm | 4 + .../queries/jsonnet/locals.scm | 2 +- .../queries/julia/injections.scm | 14 + .../queries/just/highlights.scm | 2 +- .../queries/kdl/highlights.scm | 6 +- .../queries/kotlin/highlights.scm | 4 +- .../nvim-treesitter/queries/kotlin/locals.scm | 8 +- .../queries/latex/highlights.scm | 160 +- .../queries/leo/highlights.scm | 46 +- .../queries/liquid/highlights.scm | 2 + .../nvim-treesitter/queries/lua/indents.scm | 1 + .../queries/luadoc/highlights.scm | 2 +- .../queries/luap/highlights.scm | 6 +- .../queries/make/highlights.scm | 16 + .../queries/markdown/highlights.scm | 6 +- .../queries/markdown_inline/highlights.scm | 14 +- .../queries/matlab/highlights.scm | 3 + .../queries/nim/highlights.scm | 4 +- .../nvim-treesitter/queries/nim/locals.scm | 14 +- .../queries/ocaml/highlights.scm | 2 +- .../queries/odin/highlights.scm | 2 +- .../nvim-treesitter/queries/perl/folds.scm | 13 +- .../queries/perl/highlights.scm | 27 +- .../queries/php_only/highlights.scm | 25 +- .../queries/php_only/indents.scm | 6 +- .../queries/php_only/locals.scm | 2 +- .../queries/pod/highlights.scm | 2 +- .../queries/pony/highlights.scm | 2 +- .../queries/powershell/folds.scm | 13 + .../queries/powershell/highlights.scm | 334 ++ .../queries/powershell/indents.scm | 41 + .../queries/powershell/injections.scm | 27 + .../queries/powershell/locals.scm | 85 + .../nvim-treesitter/queries/proto/indents.scm | 11 + .../queries/python/highlights.scm | 5 +- .../queries/query/highlights.scm | 16 +- .../nvim-treesitter/queries/query/indents.scm | 7 +- .../queries/query/injections.scm | 18 +- .../nvim-treesitter/queries/r/indents.scm | 2 - .../nvim-treesitter/queries/r/locals.scm | 0 .../queries/racket/highlights.scm | 6 +- .../queries/rescript/folds.scm | 12 + .../queries/rescript/highlights.scm | 335 ++ .../queries/rescript/indents.scm | 36 + .../queries/rescript/injections.scm | 33 + .../queries/rescript/locals.scm | 9 + .../queries/ruby/highlights.scm | 27 +- .../queries/rust/highlights.scm | 5 + .../queries/scala/highlights.scm | 6 +- .../queries/scheme/highlights.scm | 2 +- .../queries/sflog/highlights.scm | 48 + .../queries/smithy/highlights.scm | 2 +- .../queries/snakemake/highlights.scm | 24 +- .../queries/snakemake/indents.scm | 9 + .../nvim-treesitter/queries/sparql/locals.scm | 4 +- .../queries/squirrel/highlights.scm | 2 +- .../queries/starlark/highlights.scm | 2 +- .../queries/strace/injections.scm | 4 +- .../queries/supercollider/locals.scm | 6 +- .../queries/tablegen/highlights.scm | 2 +- .../queries/tact/highlights.scm | 4 - .../nvim-treesitter/queries/tact/locals.scm | 4 +- .../nvim-treesitter/queries/tcl/indents.scm | 4 +- .../queries/thrift/highlights.scm | 2 +- .../nvim-treesitter/queries/tiger/locals.scm | 8 +- .../queries/tlaplus/locals.scm | 8 +- .../queries/udev/highlights.scm | 18 +- .../queries/vimdoc/highlights.scm | 5 +- .../nvim-treesitter/queries/vrl/folds.scm | 6 + .../queries/vrl/highlights.scm | 108 + .../nvim-treesitter/queries/vrl/indents.scm | 24 + .../queries/vrl/injections.scm | 6 + .../nvim-treesitter/queries/vrl/locals.scm | 16 + .../nvim-treesitter/queries/wing/folds.scm | 2 + .../queries/wing/highlights.scm | 96 +- .../queries/wing/injections.scm | 13 + .../queries/xml/highlights.scm | 2 +- .../queries/yaml/highlights.scm | 2 +- .../nvim-treesitter/queries/zig/folds.scm | 33 +- .../queries/zig/highlights.scm | 308 +- .../nvim-treesitter/queries/zig/indents.scm | 15 +- .../queries/zig/injections.scm | 14 +- .../nvim-treesitter/scripts/check-queries.lua | 2 +- .../nvim-treesitter/scripts/ci-install.sh | 2 +- .../scripts/format-queries.lua | 3 +- .../start/nvim-treesitter/scripts/pre-push | 2 +- .../nvim-treesitter/scripts/run_tests.sh | 2 +- .../scripts/update-lockfile.sh | 2 +- .../nvim-treesitter/scripts/update-readme.lua | 2 +- .../scripts/write-lockfile.lua | 2 +- .../tests/indent/lua/string.lua | 4 + .../nvim-treesitter/tests/indent/lua_spec.lua | 1 + .../tests/indent/php/property-hooks.php | 13 + .../nvim-treesitter/tests/indent/php_spec.lua | 5 + .../tests/indent/query/test.scm | 9 + .../tests/indent/query_spec.lua | 5 +- .../tests/indent/r/incomplete_pipe.R | 2 + .../nvim-treesitter/tests/indent/r_spec.lua | 2 + .../tests/indent/rescript/basic.res | 23 + .../tests/indent/rescript/complex.res | 151 + .../tests/indent/rescript/conditional.res | 104 + .../tests/indent/rescript_spec.lua | 33 + .../tests/query/highlights/php/keywords.php | 35 + .../tests/query/highlights/wing/class.w | 6 +- .../query/test-query-injections.scm | 27 + .../pack/testing/start/yo-dawg/test/nvim-shim | 2 +- .../nix-support/propagated-build-inputs | 2 +- .../telescope-fzf-native.nvim/build/libfzf.so | Bin 29016 -> 29016 bytes .../lua/telescope/builtin/__internal.lua | 44 +- .../lua/telescope/builtin/__lsp.lua | 16 +- .../telescope/previewers/buffer_previewer.lua | 3 +- .../telescope/previewers/term_previewer.lua | 15 +- .../nix-support/propagated-build-inputs | 2 +- .../lazy-plugins/telescope.nvim/rock_manifest | 8 +- .../manifest | 0 .../scm-1/autoload/health/telescope.vim | 0 .../scm-1/data/memes/planets/earth | 0 .../scm-1/data/memes/planets/jupiter | 0 .../scm-1/data/memes/planets/mars | 0 .../scm-1/data/memes/planets/mercury | 0 .../scm-1/data/memes/planets/moon | 0 .../scm-1/data/memes/planets/neptune | 0 .../scm-1/data/memes/planets/pluto | 0 .../scm-1/data/memes/planets/saturn | 0 .../scm-1/data/memes/planets/uranus | 0 .../scm-1/data/memes/planets/venus | 0 .../telescope.nvim/scm-1/doc/secret.txt | 0 .../telescope.nvim/scm-1/doc/telescope.txt | 0 .../scm-1/doc/telescope_changelog.txt | 0 .../scm-1/ftplugin/TelescopePrompt.lua | 0 .../scm-1/ftplugin/TelescopeResults.lua | 0 .../telescope.nvim/scm-1/plugin/telescope.lua | 0 .../telescope.nvim/scm-1/rock_manifest | 8 +- .../telescope.nvim/scm-1/scripts/gendocs.lua | 0 .../scm-1/scripts/minimal_init.vim | 0 .../scm-1/telescope.nvim-scm-1.rockspec | 0 .../lazy-plugins/todo-comments.nvim/README.md | 6 +- .../doc/todo-comments.nvim.txt | 7 +- .../todo-comments.nvim/plugin/todo.vim | 1 + .../lazy-plugins/toggleterm.nvim/README.md | 1 + .../toggleterm.nvim/doc/toggleterm.txt | 3 +- .../toggleterm.nvim/lua/toggleterm/config.lua | 2 + .../lua/toggleterm/terminal.lua | 8 +- .../lazy-plugins/trouble.nvim/scripts/docs | 2 +- .../lazy-plugins/trouble.nvim/scripts/test | 2 +- .../lazy-plugins/vim-sleuth/plugin/sleuth.vim | 13 +- .../vimtex/assets/json/fontawesome.json | 2915 +++++++++-------- .../vimtex/autoload/vimtex/format.vim | 2 +- .../vimtex/autoload/vimtex/jobs/neovim.vim | 2 +- .../vimtex/autoload/vimtex/jobs/vim.vim | 2 +- .../vimtex/autoload/vimtex/options.vim | 9 + .../vimtex/autoload/vimtex/qf/latexlog.vim | 1 + .../vimtex/autoload/vimtex/syntax/core.vim | 4 +- .../autoload/vimtex/syntax/p/fontawesome5.vim | 37 +- .../vimtex/syntax/p/robust_externalize.vim | 33 +- .../vimtex/autoload/vimtex/view.vim | 2 +- .../store/lazy-plugins/vimtex/doc/vimtex.txt | 16 + .../vimtex/test/example-quickfix/main.log | 2 + .../test/test-quickfix/test-latexlog.vim | 1 + .../test/test-syntax/test-fontawesome5.tex | 2 +- .../test-syntax/test-robust-externalize.tex | 10 + .../lazy-plugins/which-key.nvim/README.md | 4 +- .../which-key.nvim/doc/which-key.nvim.txt | 6 +- .../which-key.nvim/lua/which-key/config.lua | 4 +- .../which-key.nvim/lua/which-key/view.lua | 2 +- .../lazy-plugins/which-key.nvim/scripts/docs | 2 +- .../lazy-plugins/which-key.nvim/scripts/test | 2 +- .../store/nvim-treesitter/.github/CODEOWNERS | 7 - .../.github/workflows/lint.yml | 2 +- .../.github/workflows/update-lockfile.yml | 6 +- .../.github/workflows/update-readme.yml | 4 +- config/neovim/store/nvim-treesitter/README.md | 19 +- .../store/nvim-treesitter/lockfile.json | 205 +- .../lua/nvim-treesitter/parsers.lua | 63 +- .../lua/nvim-treesitter/query.lua | 2 +- .../lua/nvim-treesitter/query_predicates.lua | 23 +- .../shell_command_selectors.lua | 4 +- .../queries/c_sharp/highlights.scm | 12 +- .../queries/cpp/highlights.scm | 2 +- .../nvim-treesitter/queries/diff/folds.scm | 5 + .../queries/ecma/highlights.scm | 4 - .../queries/ecma/injections.scm | 76 +- .../queries/editorconfig/highlights.scm | 3 +- .../nvim-treesitter/queries/gap/folds.scm | 12 + .../queries/gap/highlights.scm | 208 ++ .../queries/gap/injections.scm | 2 + .../nvim-treesitter/queries/gap/locals.scm | 43 + .../nvim-treesitter/queries/gaptst/folds.scm | 7 + .../queries/gaptst/highlights.scm | 19 + .../queries/gaptst/injections.scm | 9 + .../queries/git_config/highlights.scm | 2 +- .../nvim-treesitter/queries/gleam/locals.scm | 3 + .../queries/glimmer/injections.scm | 19 + .../queries/glimmer_javascript/highlights.scm | 61 + .../queries/glimmer_javascript/indents.scm | 5 + .../queries/glimmer_javascript/injections.scm | 15 + .../queries/glimmer_javascript/locals.scm | 1 + .../queries/glimmer_typescript/highlights.scm | 6 + .../queries/glimmer_typescript/indents.scm | 3 + .../queries/glimmer_typescript/injections.scm | 15 + .../nvim-treesitter/queries/go/indents.scm | 2 +- .../queries/http/highlights.scm | 56 +- .../queries/http/injections.scm | 15 +- .../queries/idl/highlights.scm | 2 +- .../queries/ini/highlights.scm | 4 +- .../queries/ini/injections.scm | 3 +- .../queries/inko/highlights.scm | 2 + .../queries/julia/injections.scm | 1 + .../queries/kotlin/highlights.scm | 2 +- .../queries/latex/highlights.scm | 13 +- .../queries/leo/highlights.scm | 44 +- .../queries/liquid/highlights.scm | 2 + .../nvim-treesitter/queries/lua/indents.scm | 1 + .../queries/make/highlights.scm | 16 + .../queries/markdown_inline/highlights.scm | 5 + .../queries/matlab/highlights.scm | 3 + .../nvim-treesitter/queries/mermaid/folds.scm | 10 + .../queries/mermaid/indents.scm | 18 + .../nvim-treesitter/queries/perl/folds.scm | 13 +- .../queries/perl/highlights.scm | 25 +- .../queries/php_only/highlights.scm | 25 +- .../queries/php_only/indents.scm | 6 +- .../queries/php_only/locals.scm | 2 +- .../nvim-treesitter/queries/proto/indents.scm | 11 + .../queries/query/highlights.scm | 5 +- .../nvim-treesitter/queries/r/locals.scm | 0 .../queries/ruby/highlights.scm | 27 +- .../queries/rust/highlights.scm | 27 +- .../queries/sflog/highlights.scm | 48 + .../queries/snakemake/highlights.scm | 24 +- .../queries/snakemake/indents.scm | 9 + .../queries/tact/highlights.scm | 4 - .../nvim-treesitter/queries/tact/locals.scm | 4 +- .../nvim-treesitter/queries/wing/folds.scm | 4 +- .../queries/wing/highlights.scm | 98 +- .../queries/wing/injections.scm | 13 + .../nvim-treesitter/queries/zig/folds.scm | 33 +- .../queries/zig/highlights.scm | 310 +- .../nvim-treesitter/queries/zig/indents.scm | 15 +- .../queries/zig/injections.scm | 14 +- .../nvim-treesitter/scripts/check-queries.lua | 2 +- .../nvim-treesitter/scripts/ci-install.sh | 2 +- .../scripts/format-queries.lua | 8 +- .../store/nvim-treesitter/scripts/pre-push | 2 +- .../nvim-treesitter/scripts/run_tests.sh | 2 +- .../scripts/update-lockfile.sh | 2 +- .../nvim-treesitter/scripts/update-readme.lua | 2 +- .../scripts/write-lockfile.lua | 2 +- .../tests/indent/lua/string.lua | 4 + .../nvim-treesitter/tests/indent/lua_spec.lua | 1 + .../tests/indent/php/property-hooks.php | 13 + .../nvim-treesitter/tests/indent/php_spec.lua | 5 + .../tests/query/highlights/php/keywords.php | 35 + .../tests/query/highlights/wing/class.w | 6 +- .../store/treesitter-parsers/parser/ada.so | Bin 343672 -> 343672 bytes .../store/treesitter-parsers/parser/agda.so | Bin 2151072 -> 2151072 bytes .../treesitter-parsers/parser/angular.so | Bin 99600 -> 107688 bytes .../store/treesitter-parsers/parser/apex.so | Bin 376568 -> 376568 bytes .../treesitter-parsers/parser/arduino.so | Bin 3434992 -> 3345016 bytes .../store/treesitter-parsers/parser/asm.so | Bin 36568 -> 36568 bytes .../store/treesitter-parsers/parser/astro.so | Bin 45824 -> 45824 bytes .../treesitter-parsers/parser/authzed.so | Bin 448120 -> 448120 bytes .../store/treesitter-parsers/parser/awk.so | Bin 397400 -> 397408 bytes .../store/treesitter-parsers/parser/bash.so | Bin 1361112 -> 1356296 bytes .../store/treesitter-parsers/parser/bass.so | Bin 24392 -> 24392 bytes .../treesitter-parsers/parser/beancount.so | Bin 104592 -> 104592 bytes .../store/treesitter-parsers/parser/bibtex.so | Bin 21120 -> 21120 bytes .../store/treesitter-parsers/parser/bicep.so | Bin 164544 -> 164544 bytes .../treesitter-parsers/parser/bitbake.so | Bin 562208 -> 562208 bytes .../treesitter-parsers/parser/blueprint.so | Bin 56896 -> 56896 bytes .../store/treesitter-parsers/parser/bp.so | Bin 81608 -> 81608 bytes .../store/treesitter-parsers/parser/c.so | Bin 602200 -> 622680 bytes .../treesitter-parsers/parser/c_sharp.so | Bin 5628512 -> 5919328 bytes .../store/treesitter-parsers/parser/cairo.so | Bin 365240 -> 365240 bytes .../store/treesitter-parsers/parser/capnp.so | Bin 81616 -> 81616 bytes .../treesitter-parsers/parser/chatito.so | Bin 24256 -> 24256 bytes .../treesitter-parsers/parser/clojure.so | Bin 114544 -> 114544 bytes .../store/treesitter-parsers/parser/cmake.so | Bin 94480 -> 94480 bytes .../treesitter-parsers/parser/comment.so | Bin 20952 -> 20952 bytes .../treesitter-parsers/parser/commonlisp.so | Bin 779528 -> 779528 bytes .../treesitter-parsers/parser/cooklang.so | Bin 40496 -> 40496 bytes .../store/treesitter-parsers/parser/corn.so | Bin 24032 -> 24032 bytes .../store/treesitter-parsers/parser/cpon.so | Bin 28256 -> 28256 bytes .../store/treesitter-parsers/parser/cpp.so | Bin 3197600 -> 3279456 bytes .../store/treesitter-parsers/parser/css.so | Bin 95280 -> 99376 bytes .../store/treesitter-parsers/parser/csv.so | Bin 19912 -> 19912 bytes .../store/treesitter-parsers/parser/cuda.so | Bin 3738680 -> 3898560 bytes .../store/treesitter-parsers/parser/cue.so | Bin 287424 -> 287424 bytes .../store/treesitter-parsers/parser/d.so | Bin 3220392 -> 3220392 bytes .../store/treesitter-parsers/parser/dart.so | Bin 996568 -> 996568 bytes .../treesitter-parsers/parser/devicetree.so | Bin 159240 -> 163576 bytes .../store/treesitter-parsers/parser/dhall.so | Bin 258480 -> 258480 bytes .../store/treesitter-parsers/parser/diff.so | Bin 36392 -> 36392 bytes .../treesitter-parsers/parser/disassembly.so | Bin 28848 -> 28848 bytes .../store/treesitter-parsers/parser/djot.so | Bin 603424 -> 603424 bytes .../treesitter-parsers/parser/dockerfile.so | Bin 74480 -> 74480 bytes .../store/treesitter-parsers/parser/dot.so | Bin 61064 -> 61064 bytes .../treesitter-parsers/parser/doxygen.so | Bin 99984 -> 99984 bytes .../store/treesitter-parsers/parser/dtd.so | Bin 53896 -> 53896 bytes .../treesitter-parsers/parser/earthfile.so | Bin 304136 -> 304136 bytes .../store/treesitter-parsers/parser/ebnf.so | Bin 19968 -> 19968 bytes .../treesitter-parsers/parser/editorconfig.so | Bin 29088 -> 29088 bytes .../store/treesitter-parsers/parser/eds.so | Bin 15744 -> 15744 bytes .../store/treesitter-parsers/parser/eex.so | Bin 19832 -> 19832 bytes .../store/treesitter-parsers/parser/elixir.so | Bin 1643344 -> 1414296 bytes .../store/treesitter-parsers/parser/elm.so | Bin 246640 -> 246640 bytes .../store/treesitter-parsers/parser/elsa.so | Bin 20008 -> 20008 bytes .../store/treesitter-parsers/parser/elvish.so | Bin 209208 -> 209208 bytes .../parser/embedded_template.so | Bin 19896 -> 19896 bytes .../store/treesitter-parsers/parser/erlang.so | Bin 295224 -> 295224 bytes .../treesitter-parsers/parser/facility.so | Bin 40488 -> 40488 bytes .../store/treesitter-parsers/parser/faust.so | Bin 187912 -> 187912 bytes .../store/treesitter-parsers/parser/fennel.so | Bin 239168 -> 239168 bytes .../store/treesitter-parsers/parser/fidl.so | Bin 77184 -> 77184 bytes .../store/treesitter-parsers/parser/firrtl.so | Bin 102824 -> 102824 bytes .../store/treesitter-parsers/parser/fish.so | Bin 106728 -> 106728 bytes .../store/treesitter-parsers/parser/foam.so | Bin 69888 -> 69888 bytes .../store/treesitter-parsers/parser/forth.so | Bin 85384 -> 85384 bytes .../treesitter-parsers/parser/fortran.so | Bin 934664 -> 934664 bytes .../store/treesitter-parsers/parser/fsh.so | Bin 162288 -> 162288 bytes .../store/treesitter-parsers/parser/func.so | Bin 98160 -> 98160 bytes .../store/treesitter-parsers/parser/fusion.so | Bin 65536 -> 65536 bytes .../store/treesitter-parsers/parser/gap.so | Bin 0 -> 119448 bytes .../store/treesitter-parsers/parser/gaptst.so | Bin 0 -> 20504 bytes .../treesitter-parsers/parser/gdscript.so | Bin 225696 -> 225696 bytes .../treesitter-parsers/parser/gdshader.so | Bin 658952 -> 658952 bytes .../treesitter-parsers/parser/git_config.so | Bin 24064 -> 24064 bytes .../treesitter-parsers/parser/git_rebase.so | Bin 15792 -> 15792 bytes .../parser/gitattributes.so | Bin 36488 -> 36488 bytes .../treesitter-parsers/parser/gitcommit.so | Bin 876728 -> 876728 bytes .../treesitter-parsers/parser/gitignore.so | Bin 28160 -> 28160 bytes .../store/treesitter-parsers/parser/gleam.so | Bin 270224 -> 270224 bytes .../treesitter-parsers/parser/glimmer.so | Bin 49320 -> 41248 bytes .../parser/glimmer_javascript.so | Bin 0 -> 345432 bytes .../parser/glimmer_typescript.so | Bin 0 -> 1459720 bytes .../store/treesitter-parsers/parser/glsl.so | Bin 835536 -> 835536 bytes .../store/treesitter-parsers/parser/gn.so | Bin 45168 -> 45168 bytes .../treesitter-parsers/parser/gnuplot.so | Bin 11796016 -> 11796016 bytes .../store/treesitter-parsers/parser/go.so | Bin 220552 -> 220744 bytes .../store/treesitter-parsers/parser/goctl.so | Bin 57016 -> 57016 bytes .../parser/godot_resource.so | Bin 24624 -> 24624 bytes .../store/treesitter-parsers/parser/gomod.so | Bin 32296 -> 32296 bytes .../store/treesitter-parsers/parser/gosum.so | Bin 20008 -> 20008 bytes .../store/treesitter-parsers/parser/gotmpl.so | Bin 320464 -> 320464 bytes .../store/treesitter-parsers/parser/gowork.so | Bin 28032 -> 28032 bytes .../store/treesitter-parsers/parser/gpg.so | Bin 208456 -> 208456 bytes .../treesitter-parsers/parser/graphql.so | Bin 66664 -> 66664 bytes .../store/treesitter-parsers/parser/groovy.so | Bin 737912 -> 778872 bytes .../treesitter-parsers/parser/gstlaunch.so | Bin 56928 -> 56928 bytes .../store/treesitter-parsers/parser/hack.so | Bin 1876656 -> 1876656 bytes .../store/treesitter-parsers/parser/hare.so | Bin 139000 -> 139000 bytes .../treesitter-parsers/parser/haskell.so | Bin 3842648 -> 3842616 bytes .../parser/haskell_persistent.so | Bin 172760 -> 172760 bytes .../store/treesitter-parsers/parser/hcl.so | Bin 110424 -> 110424 bytes .../store/treesitter-parsers/parser/heex.so | Bin 36264 -> 36264 bytes .../store/treesitter-parsers/parser/helm.so | Bin 320464 -> 320464 bytes .../store/treesitter-parsers/parser/hjson.so | Bin 28152 -> 28152 bytes .../store/treesitter-parsers/parser/hlsl.so | Bin 3860984 -> 3938952 bytes .../treesitter-parsers/parser/hlsplaylist.so | Bin 24112 -> 24168 bytes .../store/treesitter-parsers/parser/hocon.so | Bin 90072 -> 90072 bytes .../store/treesitter-parsers/parser/hoon.so | Bin 1167712 -> 1167712 bytes .../store/treesitter-parsers/parser/html.so | Bin 33504 -> 33504 bytes .../treesitter-parsers/parser/htmldjango.so | Bin 69120 -> 69120 bytes .../store/treesitter-parsers/parser/http.so | Bin 77352 -> 118256 bytes .../store/treesitter-parsers/parser/hurl.so | Bin 167816 -> 167816 bytes .../treesitter-parsers/parser/hyprlang.so | Bin 40528 -> 40528 bytes .../store/treesitter-parsers/parser/idl.so | Bin 348072 -> 393224 bytes .../store/treesitter-parsers/parser/ini.so | Bin 15912 -> 15912 bytes .../store/treesitter-parsers/parser/inko.so | Bin 213280 -> 213280 bytes .../store/treesitter-parsers/parser/ispc.so | Bin 1577040 -> 1577040 bytes .../treesitter-parsers/parser/janet_simple.so | Bin 32792 -> 32792 bytes .../store/treesitter-parsers/parser/java.so | Bin 491352 -> 433936 bytes .../treesitter-parsers/parser/javascript.so | Bin 382392 -> 394560 bytes .../store/treesitter-parsers/parser/jq.so | Bin 118352 -> 118352 bytes .../store/treesitter-parsers/parser/jsdoc.so | Bin 28544 -> 28544 bytes .../store/treesitter-parsers/parser/json.so | Bin 20096 -> 20096 bytes .../store/treesitter-parsers/parser/json5.so | Bin 52944 -> 52944 bytes .../store/treesitter-parsers/parser/jsonc.so | Bin 18256 -> 18256 bytes .../treesitter-parsers/parser/jsonnet.so | Bin 86384 -> 82528 bytes .../store/treesitter-parsers/parser/julia.so | Bin 5661416 -> 5661480 bytes .../store/treesitter-parsers/parser/just.so | Bin 62112 -> 62112 bytes .../treesitter-parsers/parser/kconfig.so | Bin 57528 -> 57528 bytes .../store/treesitter-parsers/parser/kdl.so | Bin 83384 -> 83384 bytes .../store/treesitter-parsers/parser/kotlin.so | Bin 4043368 -> 4076264 bytes .../store/treesitter-parsers/parser/koto.so | Bin 1061760 -> 1061760 bytes .../store/treesitter-parsers/parser/kusto.so | Bin 69000 -> 69000 bytes .../treesitter-parsers/parser/lalrpop.so | Bin 94080 -> 94080 bytes .../store/treesitter-parsers/parser/latex.so | Bin 3037360 -> 3090608 bytes .../store/treesitter-parsers/parser/ledger.so | Bin 159504 -> 159504 bytes .../store/treesitter-parsers/parser/leo.so | Bin 179712 -> 192456 bytes .../treesitter-parsers/parser/linkerscript.so | Bin 106120 -> 106120 bytes .../store/treesitter-parsers/parser/liquid.so | Bin 127456 -> 135704 bytes .../treesitter-parsers/parser/liquidsoap.so | Bin 832448 -> 832448 bytes .../store/treesitter-parsers/parser/llvm.so | Bin 1220056 -> 1220056 bytes .../store/treesitter-parsers/parser/lua.so | Bin 70000 -> 70416 bytes .../store/treesitter-parsers/parser/luadoc.so | Bin 138760 -> 138760 bytes .../store/treesitter-parsers/parser/luap.so | Bin 24312 -> 24312 bytes .../store/treesitter-parsers/parser/luau.so | Bin 107080 -> 107080 bytes .../store/treesitter-parsers/parser/m68k.so | Bin 364160 -> 364160 bytes .../store/treesitter-parsers/parser/make.so | Bin 192080 -> 192080 bytes .../treesitter-parsers/parser/markdown.so | Bin 357360 -> 371744 bytes .../parser/markdown_inline.so | Bin 340032 -> 354672 bytes .../store/treesitter-parsers/parser/matlab.so | Bin 189232 -> 193328 bytes .../store/treesitter-parsers/parser/menhir.so | Bin 65888 -> 65888 bytes .../treesitter-parsers/parser/mermaid.so | Bin 183824 -> 183824 bytes .../store/treesitter-parsers/parser/meson.so | Bin 134696 -> 134696 bytes .../store/treesitter-parsers/parser/mlir.so | Bin 1241504 -> 1241504 bytes .../store/treesitter-parsers/parser/muttrc.so | Bin 171528 -> 168104 bytes .../store/treesitter-parsers/parser/nasm.so | Bin 720120 -> 720120 bytes .../store/treesitter-parsers/parser/nginx.so | Bin 100576 -> 100576 bytes .../store/treesitter-parsers/parser/nickel.so | Bin 189424 -> 193520 bytes .../store/treesitter-parsers/parser/nim.so | Bin 9142536 -> 9142536 bytes .../parser/nim_format_string.so | Bin 28216 -> 28216 bytes .../store/treesitter-parsers/parser/ninja.so | Bin 44624 -> 44624 bytes .../store/treesitter-parsers/parser/nix.so | Bin 106496 -> 106496 bytes .../store/treesitter-parsers/parser/norg.so | Bin 3342216 -> 3342216 bytes .../store/treesitter-parsers/parser/nqc.so | Bin 774064 -> 774064 bytes .../store/treesitter-parsers/parser/objc.so | Bin 7696136 -> 7696136 bytes .../treesitter-parsers/parser/objdump.so | Bin 28696 -> 28696 bytes .../store/treesitter-parsers/parser/ocaml.so | Bin 4965728 -> 4965728 bytes .../parser/ocaml_interface.so | Bin 4441440 -> 4441440 bytes .../treesitter-parsers/parser/ocamllex.so | Bin 33680 -> 33680 bytes .../store/treesitter-parsers/parser/odin.so | Bin 2187680 -> 2187680 bytes .../store/treesitter-parsers/parser/org.so | Bin 513976 -> 513976 bytes .../store/treesitter-parsers/parser/pascal.so | Bin 708224 -> 749184 bytes .../store/treesitter-parsers/parser/passwd.so | Bin 15752 -> 15752 bytes .../store/treesitter-parsers/parser/pem.so | Bin 15784 -> 15784 bytes .../store/treesitter-parsers/parser/perl.so | Bin 1390944 -> 2087568 bytes .../store/treesitter-parsers/parser/php.so | Bin 845744 -> 821136 bytes .../treesitter-parsers/parser/php_only.so | Bin 804784 -> 776080 bytes .../store/treesitter-parsers/parser/phpdoc.so | Bin 184648 -> 184648 bytes .../store/treesitter-parsers/parser/pioasm.so | Bin 47200 -> 47200 bytes .../store/treesitter-parsers/parser/po.so | Bin 23976 -> 23976 bytes .../store/treesitter-parsers/parser/pod.so | Bin 20664 -> 20664 bytes .../treesitter-parsers/parser/poe_filter.so | Bin 114312 -> 114312 bytes .../store/treesitter-parsers/parser/pony.so | Bin 668176 -> 668176 bytes .../treesitter-parsers/parser/powershell.so | Bin 787064 -> 787064 bytes .../store/treesitter-parsers/parser/printf.so | Bin 15784 -> 15784 bytes .../store/treesitter-parsers/parser/prisma.so | Bin 52736 -> 52736 bytes .../treesitter-parsers/parser/problog.so | Bin 28632 -> 28632 bytes .../store/treesitter-parsers/parser/prolog.so | Bin 28632 -> 28632 bytes .../store/treesitter-parsers/parser/promql.so | Bin 40360 -> 40360 bytes .../treesitter-parsers/parser/properties.so | Bin 24616 -> 24616 bytes .../store/treesitter-parsers/parser/proto.so | Bin 77536 -> 77536 bytes .../store/treesitter-parsers/parser/prql.so | Bin 163328 -> 163328 bytes .../store/treesitter-parsers/parser/psv.so | Bin 19912 -> 19912 bytes .../store/treesitter-parsers/parser/pug.so | Bin 241800 -> 241800 bytes .../store/treesitter-parsers/parser/puppet.so | Bin 118792 -> 118792 bytes .../treesitter-parsers/parser/purescript.so | Bin 1874312 -> 1874312 bytes .../treesitter-parsers/parser/pymanifest.so | Bin 24232 -> 24232 bytes .../store/treesitter-parsers/parser/python.so | Bin 487280 -> 483184 bytes .../store/treesitter-parsers/parser/ql.so | Bin 327408 -> 327408 bytes .../store/treesitter-parsers/parser/qmldir.so | Bin 23976 -> 23976 bytes .../store/treesitter-parsers/parser/qmljs.so | Bin 1688992 -> 1656224 bytes .../store/treesitter-parsers/parser/query.so | Bin 44736 -> 44736 bytes .../store/treesitter-parsers/parser/r.so | Bin 1449744 -> 614384 bytes .../store/treesitter-parsers/parser/racket.so | Bin 107072 -> 117504 bytes .../store/treesitter-parsers/parser/ralph.so | Bin 262680 -> 262680 bytes .../store/treesitter-parsers/parser/rasi.so | Bin 61232 -> 61232 bytes .../store/treesitter-parsers/parser/rbs.so | Bin 94152 -> 94152 bytes .../store/treesitter-parsers/parser/re2c.so | Bin 110208 -> 110208 bytes .../treesitter-parsers/parser/readline.so | Bin 126928 -> 126928 bytes .../store/treesitter-parsers/parser/regex.so | Bin 24064 -> 24064 bytes .../store/treesitter-parsers/parser/rego.so | Bin 130704 -> 130704 bytes .../treesitter-parsers/parser/requirements.so | Bin 48896 -> 48896 bytes .../treesitter-parsers/parser/rescript.so | Bin 800256 -> 800256 bytes .../store/treesitter-parsers/parser/rnoweb.so | Bin 16568 -> 16568 bytes .../store/treesitter-parsers/parser/robot.so | Bin 130784 -> 130784 bytes .../store/treesitter-parsers/parser/robots.so | Bin 31280 -> 31280 bytes .../store/treesitter-parsers/parser/roc.so | Bin 2240776 -> 2240776 bytes .../store/treesitter-parsers/parser/ron.so | Bin 40480 -> 40480 bytes .../store/treesitter-parsers/parser/rst.so | Bin 79416 -> 79416 bytes .../store/treesitter-parsers/parser/ruby.so | Bin 2149392 -> 2149392 bytes .../store/treesitter-parsers/parser/rust.so | Bin 1049048 -> 1053336 bytes .../store/treesitter-parsers/parser/scala.so | Bin 3327712 -> 3380984 bytes .../store/treesitter-parsers/parser/scfg.so | Bin 19880 -> 19880 bytes .../store/treesitter-parsers/parser/scheme.so | Bin 89760 -> 99408 bytes .../store/treesitter-parsers/parser/scss.so | Bin 124568 -> 124568 bytes .../store/treesitter-parsers/parser/sflog.so | Bin 0 -> 24168 bytes .../store/treesitter-parsers/parser/slang.so | Bin 4926144 -> 5008200 bytes .../store/treesitter-parsers/parser/slint.so | Bin 295016 -> 295016 bytes .../store/treesitter-parsers/parser/smali.so | Bin 267080 -> 267080 bytes .../store/treesitter-parsers/parser/smithy.so | Bin 65056 -> 65056 bytes .../treesitter-parsers/parser/snakemake.so | Bin 864976 -> 881360 bytes .../treesitter-parsers/parser/solidity.so | Bin 463048 -> 463048 bytes .../store/treesitter-parsers/parser/soql.so | Bin 94248 -> 94248 bytes .../store/treesitter-parsers/parser/sosl.so | Bin 110728 -> 110728 bytes .../treesitter-parsers/parser/sourcepawn.so | Bin 553328 -> 553328 bytes .../store/treesitter-parsers/parser/sparql.so | Bin 324832 -> 324832 bytes .../store/treesitter-parsers/parser/sql.so | Bin 1992488 -> 1992488 bytes .../treesitter-parsers/parser/squirrel.so | Bin 381384 -> 381384 bytes .../treesitter-parsers/parser/ssh_config.so | Bin 197280 -> 197280 bytes .../treesitter-parsers/parser/starlark.so | Bin 360320 -> 360320 bytes .../store/treesitter-parsers/parser/strace.so | Bin 32168 -> 32168 bytes .../store/treesitter-parsers/parser/styled.so | Bin 102608 -> 106704 bytes .../parser/supercollider.so | Bin 156424 -> 156424 bytes .../treesitter-parsers/parser/surface.so | Bin 40320 -> 40320 bytes .../store/treesitter-parsers/parser/svelte.so | Bin 62376 -> 66776 bytes .../store/treesitter-parsers/parser/swift.so | Bin 2914144 -> 2914144 bytes .../treesitter-parsers/parser/sxhkdrc.so | Bin 28032 -> 28032 bytes .../treesitter-parsers/parser/systemtap.so | Bin 237104 -> 237304 bytes .../parser/systemverilog.so | Bin 29694408 -> 29694408 bytes .../store/treesitter-parsers/parser/t32.so | Bin 439096 -> 439096 bytes .../treesitter-parsers/parser/tablegen.so | Bin 90448 -> 90448 bytes .../store/treesitter-parsers/parser/tact.so | Bin 69424 -> 69584 bytes .../store/treesitter-parsers/parser/tcl.so | Bin 114848 -> 119704 bytes .../store/treesitter-parsers/parser/teal.so | Bin 111712 -> 111712 bytes .../store/treesitter-parsers/parser/templ.so | Bin 341360 -> 349600 bytes .../treesitter-parsers/parser/terraform.so | Bin 110456 -> 110456 bytes .../treesitter-parsers/parser/textproto.so | Bin 32176 -> 32176 bytes .../store/treesitter-parsers/parser/thrift.so | Bin 130928 -> 130928 bytes .../store/treesitter-parsers/parser/tiger.so | Bin 57400 -> 57400 bytes .../treesitter-parsers/parser/tlaplus.so | Bin 4948984 -> 4948984 bytes .../store/treesitter-parsers/parser/tmux.so | Bin 1617408 -> 1663824 bytes .../treesitter-parsers/parser/todotxt.so | Bin 15744 -> 15744 bytes .../store/treesitter-parsers/parser/toml.so | Bin 41104 -> 41104 bytes .../store/treesitter-parsers/parser/tsv.so | Bin 19912 -> 19912 bytes .../store/treesitter-parsers/parser/tsx.so | Bin 1463752 -> 1488232 bytes .../store/treesitter-parsers/parser/turtle.so | Bin 46080 -> 46080 bytes .../store/treesitter-parsers/parser/twig.so | Bin 114384 -> 114384 bytes .../treesitter-parsers/parser/typescript.so | Bin 1426872 -> 1455544 bytes .../treesitter-parsers/parser/typespec.so | Bin 143032 -> 143032 bytes .../treesitter-parsers/parser/typoscript.so | Bin 44424 -> 44424 bytes .../store/treesitter-parsers/parser/typst.so | Bin 837984 -> 837984 bytes .../store/treesitter-parsers/parser/udev.so | Bin 52736 -> 52736 bytes .../treesitter-parsers/parser/ungrammar.so | Bin 19888 -> 19888 bytes .../store/treesitter-parsers/parser/unison.so | Bin 1225272 -> 1225272 bytes .../store/treesitter-parsers/parser/usd.so | Bin 81528 -> 81528 bytes .../store/treesitter-parsers/parser/uxntal.so | Bin 65832 -> 65832 bytes .../store/treesitter-parsers/parser/v.so | Bin 1900408 -> 1900408 bytes .../store/treesitter-parsers/parser/vala.so | Bin 605776 -> 605776 bytes .../store/treesitter-parsers/parser/vento.so | Bin 20576 -> 20576 bytes .../treesitter-parsers/parser/verilog.so | Bin 18247200 -> 18247200 bytes .../store/treesitter-parsers/parser/vhdl.so | Bin 1431440 -> 1431440 bytes .../store/treesitter-parsers/parser/vhs.so | Bin 48512 -> 48608 bytes .../store/treesitter-parsers/parser/vim.so | Bin 1054976 -> 1054976 bytes .../store/treesitter-parsers/parser/vimdoc.so | Bin 164192 -> 164192 bytes .../store/treesitter-parsers/parser/vrl.so | Bin 81944 -> 81944 bytes .../store/treesitter-parsers/parser/vue.so | Bin 49872 -> 49872 bytes .../store/treesitter-parsers/parser/wgsl.so | Bin 86200 -> 86200 bytes .../treesitter-parsers/parser/wgsl_bevy.so | Bin 102664 -> 102664 bytes .../store/treesitter-parsers/parser/wing.so | Bin 238224 -> 262832 bytes .../store/treesitter-parsers/parser/wit.so | Bin 65024 -> 65024 bytes .../treesitter-parsers/parser/xcompose.so | Bin 19944 -> 19944 bytes .../store/treesitter-parsers/parser/xml.so | Bin 70744 -> 70744 bytes .../store/treesitter-parsers/parser/yaml.so | Bin 210240 -> 210240 bytes .../store/treesitter-parsers/parser/yang.so | Bin 140120 -> 140120 bytes .../store/treesitter-parsers/parser/yuck.so | Bin 41168 -> 41168 bytes .../treesitter-parsers/parser/zathurarc.so | Bin 24136 -> 24136 bytes .../store/treesitter-parsers/parser/zig.so | Bin 836448 -> 720656 bytes .../queries/cpp/highlights.scm | 2 +- .../queries/cuda/highlights.scm | 17 + .../queries/dart/highlights.scm | 352 +- .../treesitter-parsers/queries/gap/folds.scm | 12 + .../queries/gap/highlights.scm | 219 ++ .../treesitter-parsers/queries/gap/locals.scm | 45 + .../queries/gap/locals_ts.scm | 43 + .../treesitter-parsers/queries/gap/tags.scm | 17 + .../queries/gaptst/folds.scm | 7 + .../queries/gaptst/highlights.scm | 17 + .../queries/gaptst/injections.scm | 9 + .../queries/gleam/locals.scm | 2 + .../queries/glimmer/folds.scm | 4 - .../queries/glimmer/glimmer/folds.scm | 5 + .../queries/glimmer/glimmer/highlights.scm | 117 + .../queries/glimmer/glimmer/indents.scm | 34 + .../queries/glimmer/glimmer/injections.scm | 21 + .../queries/glimmer/{ => glimmer}/locals.scm | 0 .../queries/glimmer/highlights.scm | 88 - .../queries/glimmer/indents.scm | 22 - .../glimmer_javascript/highlights.scm | 65 + .../glimmer_javascript/indents.scm | 5 + .../glimmer_javascript/injections.scm | 15 + .../glimmer_javascript/locals.scm | 1 + .../glimmer_javascript/tags.scm | 3 + .../glimmer_typescript/highlights.scm | 8 + .../glimmer_typescript/indents.scm | 2 + .../glimmer_typescript/injections.scm | 22 + .../queries/go/structure.scm | 175 - .../queries/groovy/folds.scm | 6 + .../queries/groovy/injections.scm | 5 + .../queries/http/highlights.scm | 54 +- .../queries/http/injections.scm | 15 +- .../queries/idl/highlights.scm | 2 +- .../queries/julia/README.md | 11 + .../queries/julia/highlights.scm | 332 ++ .../queries/kotlin/highlights.scm | 2 +- .../queries/leo/highlights.scm | 253 +- .../queries/liquid/highlights.scm | 12 +- .../queries/nix/highlights.scm | 99 - .../queries/pascal/highlights.scm | 2 + .../queries/perl/highlights.scm | 2 +- .../queries/perl/matchup.scm | 30 + .../queries/python/highlights.scm | 2 + .../queries/scala/{scala => }/highlights.scm | 0 .../queries/scala/indents.scm | 30 + .../queries/scala/{scala => }/locals.scm | 0 .../queries/sflog/highlights.scm | 23 + .../snakemake/snakemake/highlights.scm | 8 +- .../queries/snakemake/snakemake/indents.scm | 19 +- .../queries/swift/outline.scm | 66 + .../queries/tact/highlights.scm | 2 - .../queries/tact/locals.scm | 3 +- .../treesitter-parsers/queries/wing/folds.scm | 2 +- .../queries/wing/highlights.scm | 2 +- .../treesitter-parsers/queries/zig/folds.scm | 35 +- .../queries/zig/highlights.scm | 342 +- .../queries/zig/indents.scm | 22 +- .../queries/zig/injections.scm | 15 +- 1247 files changed, 26512 insertions(+), 15067 deletions(-) create mode 100644 config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/dadbod_ui.lua create mode 100644 config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/fzf.lua create mode 100644 config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/lir.lua create mode 100644 config/neovim/store/lazy-plugins/catppuccin-nvim/renovate.json create mode 100644 config/neovim/store/lazy-plugins/conform.nvim/.luarc.json create mode 100644 config/neovim/store/lazy-plugins/conform.nvim/doc/debugging.md create mode 100644 config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/cljfmt.lua create mode 100644 config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/markdownfmt.lua create mode 100644 config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/superhtml.lua create mode 100644 config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/ziggy.lua create mode 100644 config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/ziggy_schema.lua create mode 100644 config/neovim/store/lazy-plugins/conform.nvim/tests/util_spec.lua rename config/neovim/store/lazy-plugins/gitsigns.nvim/{gitsigns.nvim-scm-1-unstable-2024-08-04-rocks => gitsigns.nvim-scm-1-unstable-2024-09-04-rocks}/gitsigns.nvim/scm-1/doc/gitsigns.txt (99%) rename config/neovim/store/lazy-plugins/gitsigns.nvim/{gitsigns.nvim-scm-1-unstable-2024-08-04-rocks => gitsigns.nvim-scm-1-unstable-2024-09-04-rocks}/gitsigns.nvim/scm-1/gitsigns.nvim-scm-1.rockspec (100%) rename config/neovim/store/lazy-plugins/gitsigns.nvim/{gitsigns.nvim-scm-1-unstable-2024-08-04-rocks => gitsigns.nvim-scm-1-unstable-2024-09-04-rocks}/gitsigns.nvim/scm-1/rock_manifest (75%) rename config/neovim/store/lazy-plugins/gitsigns.nvim/{gitsigns.nvim-scm-1-unstable-2024-08-04-rocks => gitsigns.nvim-scm-1-unstable-2024-09-04-rocks}/manifest (100%) rename config/neovim/store/lazy-plugins/luasnip/{luasnip-2.3.0-1-unstable-2024-08-01-rocks => luasnip-2.3.0-1-unstable-2024-08-28-rocks}/luasnip/2.3.0-1/doc/luasnip.txt (98%) rename config/neovim/store/lazy-plugins/luasnip/{luasnip-2.3.0-1-unstable-2024-08-01-rocks => luasnip-2.3.0-1-unstable-2024-08-28-rocks}/luasnip/2.3.0-1/ftplugin/snippets.vim (100%) rename config/neovim/store/lazy-plugins/luasnip/{luasnip-2.3.0-1-unstable-2024-08-01-rocks => luasnip-2.3.0-1-unstable-2024-08-28-rocks}/luasnip/2.3.0-1/luasnip-2.3.0-1.rockspec (100%) rename config/neovim/store/lazy-plugins/luasnip/{luasnip-2.3.0-1-unstable-2024-08-01-rocks => luasnip-2.3.0-1-unstable-2024-08-28-rocks}/luasnip/2.3.0-1/plugin/luasnip.lua (100%) rename config/neovim/store/lazy-plugins/luasnip/{luasnip-2.3.0-1-unstable-2024-08-01-rocks => luasnip-2.3.0-1-unstable-2024-08-28-rocks}/luasnip/2.3.0-1/plugin/luasnip.vim (100%) rename config/neovim/store/lazy-plugins/luasnip/{luasnip-2.3.0-1-unstable-2024-08-01-rocks => luasnip-2.3.0-1-unstable-2024-08-28-rocks}/luasnip/2.3.0-1/rock_manifest (93%) rename config/neovim/store/lazy-plugins/luasnip/{luasnip-2.3.0-1-unstable-2024-08-01-rocks => luasnip-2.3.0-1-unstable-2024-08-28-rocks}/luasnip/2.3.0-1/syntax/snippets.vim (100%) rename config/neovim/store/lazy-plugins/luasnip/{luasnip-2.3.0-1-unstable-2024-08-01-rocks => luasnip-2.3.0-1-unstable-2024-08-28-rocks}/manifest (100%) delete mode 100644 config/neovim/store/lazy-plugins/mini.nvim/scripts/basic-setup_init.lua create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/dir-files/real/top-secret create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/dir-git/deps-confirm create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_completion.lua---Manual-completion---respects-`kind_hlgroup`-as-item-field create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()` create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()`-002 create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()`-003 create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()` create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()`-002 create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()`-003 create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-002 create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-003 rename config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/{tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-rename-002 => tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-004} (55%) create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-005 delete mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-move delete mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-move-002 delete mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-rename create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-006 create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---go_in()---warns-about-paths-not-present-on-disk create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-002 create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-003 create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-file-path-in-branch create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-file-path-in-branch-002 create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-preview create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-bookmarks create mode 100644 config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_indentscope.lua---draw()---shows-symbols-on-wrapped-lines-without-overlapping-003 rename config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/{tests-test_pick.lua---default_match()---does-not-block-query-update => tests-test_pick.lua---default_preview()---works-for-file-path-004} (80%) create mode 100644 config/neovim/store/lazy-plugins/nvim-autopairs/.github/workflows/sponsors.yml create mode 100644 config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/clippy.lua create mode 100644 config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/eugene.lua create mode 100644 config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/hledger.lua create mode 100644 config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/systemd-analyze.lua create mode 100644 config/neovim/store/lazy-plugins/nvim-lint/tests/codespell_spec.lua create mode 100644 config/neovim/store/lazy-plugins/nvim-lint/tests/hledger_spec.lua rename config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/{bazelrc-lsp.lua => bazelrc_lsp.lua} (100%) create mode 100644 config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/daedalus_ls.lua create mode 100644 config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/kcl.lua create mode 100644 config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/snakeskin_ls.lua rename config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/{tsserver.lua => ts_ls.lua} (91%) create mode 100644 config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/tvm_ffi_navigator.lua create mode 100644 config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ziggy.lua create mode 100644 config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ziggy_schema.lua delete mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/.github/CODEOWNERS create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/diff/folds.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/folds.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/injections.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/locals.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/folds.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/injections.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer_javascript/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer_javascript/indents.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer_javascript/injections.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer_javascript/locals.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer_typescript/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer_typescript/indents.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer_typescript/injections.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/mermaid/folds.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/mermaid/indents.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/proto/indents.scm mode change 100755 => 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/r/locals.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/queries/sflog/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/nvim-treesitter/tests/indent/php/property-hooks.php create mode 100644 config/neovim/store/lazy-plugins/persisted.nvim/CHANGELOG.md delete mode 100644 config/neovim/store/lazy-plugins/persisted.nvim/lua/persisted/deprecate.lua delete mode 100644 config/neovim/store/lazy-plugins/persisted.nvim/lua/persisted/log.lua create mode 100644 config/neovim/store/lazy-plugins/persisted.nvim/tests/dirs_spec.lua rename config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/{ => bin}/busted (96%) rename config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/{nvim-shim => bin/lua} (97%) create mode 100755 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/bin/nvim delete mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/.github/CODEOWNERS create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/diff/folds.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/gap/folds.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/gap/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/gap/injections.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/gap/locals.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/gaptst/folds.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/gaptst/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/gaptst/injections.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/glimmer_javascript/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/glimmer_javascript/indents.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/glimmer_javascript/injections.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/glimmer_javascript/locals.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/glimmer_typescript/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/glimmer_typescript/indents.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/glimmer_typescript/injections.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/powershell/folds.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/powershell/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/powershell/indents.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/powershell/injections.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/powershell/locals.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/proto/indents.scm mode change 100755 => 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/r/locals.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/rescript/folds.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/rescript/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/rescript/indents.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/rescript/injections.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/rescript/locals.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/sflog/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/vrl/folds.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/vrl/highlights.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/vrl/indents.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/vrl/injections.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/queries/vrl/locals.scm create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/tests/indent/php/property-hooks.php create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/tests/indent/r/incomplete_pipe.R create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/tests/indent/rescript/basic.res create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/tests/indent/rescript/complex.res create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/tests/indent/rescript/conditional.res create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/tests/indent/rescript_spec.lua create mode 100644 config/neovim/store/lazy-plugins/rainbow-delimiters.nvim/test/xdg/local/share/nvim/site/pack/testing/start/nvim-treesitter/tests/query/injections/query/test-query-injections.scm rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/manifest (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/autoload/health/telescope.vim (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/data/memes/planets/earth (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/data/memes/planets/jupiter (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/data/memes/planets/mars (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/data/memes/planets/mercury (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/data/memes/planets/moon (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/data/memes/planets/neptune (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/data/memes/planets/pluto (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/data/memes/planets/saturn (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/data/memes/planets/uranus (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/data/memes/planets/venus (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/doc/secret.txt (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/doc/telescope.txt (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/doc/telescope_changelog.txt (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/ftplugin/TelescopePrompt.lua (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/ftplugin/TelescopeResults.lua (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/plugin/telescope.lua (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/rock_manifest (95%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/scripts/gendocs.lua (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/scripts/minimal_init.vim (100%) rename config/neovim/store/lazy-plugins/telescope.nvim/{telescope.nvim-scm-1-unstable-2024-08-02-rocks => telescope.nvim-scm-1-unstable-2024-09-11-rocks}/telescope.nvim/scm-1/telescope.nvim-scm-1.rockspec (100%) delete mode 100644 config/neovim/store/nvim-treesitter/.github/CODEOWNERS create mode 100644 config/neovim/store/nvim-treesitter/queries/diff/folds.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/gap/folds.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/gap/highlights.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/gap/injections.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/gap/locals.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/gaptst/folds.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/gaptst/highlights.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/gaptst/injections.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/glimmer_javascript/highlights.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/glimmer_javascript/indents.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/glimmer_javascript/injections.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/glimmer_javascript/locals.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/glimmer_typescript/highlights.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/glimmer_typescript/indents.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/glimmer_typescript/injections.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/mermaid/folds.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/mermaid/indents.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/proto/indents.scm mode change 100755 => 100644 config/neovim/store/nvim-treesitter/queries/r/locals.scm create mode 100644 config/neovim/store/nvim-treesitter/queries/sflog/highlights.scm create mode 100644 config/neovim/store/nvim-treesitter/tests/indent/php/property-hooks.php create mode 100755 config/neovim/store/treesitter-parsers/parser/gap.so create mode 100755 config/neovim/store/treesitter-parsers/parser/gaptst.so create mode 100755 config/neovim/store/treesitter-parsers/parser/glimmer_javascript.so create mode 100755 config/neovim/store/treesitter-parsers/parser/glimmer_typescript.so create mode 100755 config/neovim/store/treesitter-parsers/parser/sflog.so create mode 100644 config/neovim/store/treesitter-parsers/queries/cuda/highlights.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/gap/folds.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/gap/highlights.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/gap/locals.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/gap/locals_ts.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/gap/tags.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/gaptst/folds.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/gaptst/highlights.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/gaptst/injections.scm delete mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer/folds.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer/glimmer/folds.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer/glimmer/highlights.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer/glimmer/indents.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer/glimmer/injections.scm rename config/neovim/store/treesitter-parsers/queries/glimmer/{ => glimmer}/locals.scm (100%) delete mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer/highlights.scm delete mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer/indents.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer_javascript/glimmer_javascript/highlights.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer_javascript/glimmer_javascript/indents.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer_javascript/glimmer_javascript/injections.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer_javascript/glimmer_javascript/locals.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer_javascript/glimmer_javascript/tags.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer_typescript/glimmer_typescript/highlights.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer_typescript/glimmer_typescript/indents.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/glimmer_typescript/glimmer_typescript/injections.scm delete mode 100644 config/neovim/store/treesitter-parsers/queries/go/structure.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/groovy/folds.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/groovy/injections.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/julia/README.md create mode 100644 config/neovim/store/treesitter-parsers/queries/julia/highlights.scm delete mode 100644 config/neovim/store/treesitter-parsers/queries/nix/highlights.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/perl/matchup.scm rename config/neovim/store/treesitter-parsers/queries/scala/{scala => }/highlights.scm (100%) create mode 100644 config/neovim/store/treesitter-parsers/queries/scala/indents.scm rename config/neovim/store/treesitter-parsers/queries/scala/{scala => }/locals.scm (100%) create mode 100644 config/neovim/store/treesitter-parsers/queries/sflog/highlights.scm create mode 100644 config/neovim/store/treesitter-parsers/queries/swift/outline.scm diff --git a/config/neovim/config.lua b/config/neovim/config.lua index c5062a99..6ace5b1a 100644 --- a/config/neovim/config.lua +++ b/config/neovim/config.lua @@ -1,3 +1,7 @@ +-- Nixvim's internal module table +-- Can be used to share code throughout init.lua +local _M = {} + -- Set up globals {{{ do local nixvim_globals = { mallocalleader = " ", mapleader = " " } diff --git a/config/neovim/config_nix.lua b/config/neovim/config_nix.lua index 7a1f960f..f355e205 100644 --- a/config/neovim/config_nix.lua +++ b/config/neovim/config_nix.lua @@ -1,3 +1,7 @@ +-- Nixvim's internal module table +-- Can be used to share code throughout init.lua +local _M = {} + -- Set up globals {{{ do local nixvim_globals = { mallocalleader = " ", mapleader = " " } @@ -68,7 +72,7 @@ end vim.loader.enable() require("lazy").setup({ dev = { - path = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins", + path = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins", patterns = { "." }, fallback = false, }, @@ -83,7 +87,7 @@ require("lazy").setup({ colorscheme catppuccin ]]) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/catppuccin-nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/catppuccin-nvim", lazy = false, name = "catppuccin", opts = { background = { dark = "mocha", light = "latte" }, flavour = "mocha" }, @@ -94,7 +98,7 @@ require("lazy").setup({ config = function(_, opts) require("nvim-web-devicons").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-web-devicons", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-web-devicons", lazy = true, name = "nvim-web-devicons", }, @@ -103,7 +107,7 @@ require("lazy").setup({ config = function(_, opts) require("nvim-autopairs").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-autopairs", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-autopairs", event = { "InsertEnter" }, lazy = true, name = "nvim-autopairs", @@ -112,7 +116,7 @@ require("lazy").setup({ { "vim-bbye", cmd = { "Bdelete", "Bwipeout" }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/vim-bbye", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/vim-bbye", lazy = true, name = "vim-bbye", }, @@ -121,7 +125,7 @@ require("lazy").setup({ config = function(_, opts) require("better_escape").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/better-escape.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/better-escape.nvim", event = { "InsertEnter" }, lazy = true, name = "better_escape", @@ -132,7 +136,7 @@ require("lazy").setup({ config = function(_, opts) require("clangd_extensions").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/clangd_extensions.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/clangd_extensions.nvim", lazy = true, name = "clangd_extensions", opts = { inlay_hints = { inline = false } }, @@ -145,50 +149,50 @@ require("lazy").setup({ dependencies = { { "cmp-async-path", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/cmp-async-path", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/cmp-async-path", lazy = true, name = "cmp-async-path", }, { "cmp-buffer", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/cmp-buffer", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/cmp-buffer", enabled = false, lazy = true, name = "cmp-buffer", }, { "cmp-cmdline", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/cmp-cmdline", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/cmp-cmdline", enabled = false, lazy = true, name = "cmp-cmdline", }, { "cmp-emoji", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/cmp-emoji", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/cmp-emoji", lazy = true, name = "cmp-emoji", }, { "cmp-nvim-lsp", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/cmp-nvim-lsp", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/cmp-nvim-lsp", lazy = true, name = "cmp-nvim-lsp", }, { "cmp-nvim-lsp-signature-help", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/cmp-nvim-lsp-signature-help", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/cmp-nvim-lsp-signature-help", lazy = true, name = "cmp-nvim-lsp-signature-help", }, { "cmp_luasnip", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/cmp_luasnip", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/cmp_luasnip", lazy = true, name = "cmp_luasnip", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-cmp", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-cmp", event = { "InsertEnter" }, lazy = true, name = "cmp", @@ -269,7 +273,7 @@ require("lazy").setup({ config = function(_, opts) require("ts_context_commentstring").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-ts-context-commentstring", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-ts-context-commentstring", init = function() -- Skip compatibility checks vim.g.skip_ts_context_commentstring_module = true @@ -278,7 +282,7 @@ require("lazy").setup({ name = "ts_context_commentstring", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/comment.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/comment.nvim", lazy = false, name = "Comment", opts = { @@ -295,7 +299,7 @@ require("lazy").setup({ config = function(_, opts) require("conform").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/conform.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/conform.nvim", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "conform", @@ -335,7 +339,7 @@ require("lazy").setup({ config = function(_, opts) require("nvim-web-devicons").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-web-devicons", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-web-devicons", lazy = true, name = "nvim-web-devicons", }, @@ -362,30 +366,30 @@ require("lazy").setup({ dependencies = { { "plenary", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/plenary.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/plenary.nvim", lazy = true, name = "plenary", }, { "telescope-fzf-native", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/telescope-fzf-native.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/telescope-fzf-native.nvim", lazy = true, name = "telescope-fzf-native", }, { "telescope-undo", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/telescope-undo.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/telescope-undo.nvim", lazy = true, name = "telescope-undo", }, { "telescope-ui-select", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/telescope-ui-select.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/telescope-ui-select.nvim", lazy = true, name = "telescope-ui-select", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/telescope.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/telescope.nvim", lazy = true, name = "telescope", opts = { @@ -401,7 +405,7 @@ require("lazy").setup({ }, }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/persisted.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/persisted.nvim", lazy = true, name = "persisted", opts = { @@ -414,7 +418,7 @@ require("lazy").setup({ }, }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/dashboard-nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/dashboard-nvim", lazy = false, name = "dashboard", opts = { @@ -444,13 +448,13 @@ require("lazy").setup({ { "diffview", cmd = { "DiffviewOpen" }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/diffview.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/diffview.nvim", lazy = true, name = "diffview", }, { "direnv", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/direnv.vim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/direnv.vim", lazy = false, name = "direnv", }, @@ -459,7 +463,7 @@ require("lazy").setup({ config = function(_, opts) require("flash").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/flash.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/flash.nvim", keys = { "s", "S", "f", "F", "t", "T" }, lazy = true, name = "flash", @@ -467,7 +471,7 @@ require("lazy").setup({ { "gitmessenger", cmd = { "GitMessenger" }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/git-messenger.vim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/git-messenger.vim", init = function() for k, v in pairs({ ["git_messenger_floating_win_opts"] = { ["border"] = "rounded" }, @@ -484,7 +488,7 @@ require("lazy").setup({ config = function(_, opts) require("gitsigns").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/gitsigns.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/gitsigns.nvim", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "gitsigns", @@ -492,7 +496,7 @@ require("lazy").setup({ }, { "haskell-tools", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/haskell-tools.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/haskell-tools.nvim", lazy = false, name = "haskell-tools", }, @@ -501,7 +505,7 @@ require("lazy").setup({ config = function(_, opts) require("illuminate").configure(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/vim-illuminate", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/vim-illuminate", event = { "BufreadPost", "BufNewFile" }, lazy = true, name = "illuminate", @@ -521,14 +525,14 @@ require("lazy").setup({ }, { "intellitab", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/intellitab.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/intellitab.nvim", event = { "InsertEnter" }, lazy = true, name = "intellitab", }, { "jdtls", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-jdtls", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-jdtls", lazy = false, name = "jdtls", }, @@ -537,7 +541,7 @@ require("lazy").setup({ config = function(_, opts) require("nvim-lastplace").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-lastplace", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-lastplace", lazy = false, name = "nvim-lastplace", }, @@ -547,12 +551,12 @@ require("lazy").setup({ dependencies = { { "plenary", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/plenary.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/plenary.nvim", lazy = true, name = "plenary", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/lazygit.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/lazygit.nvim", lazy = true, name = "lazygit", }, @@ -565,7 +569,7 @@ require("lazy").setup({ lint[k] = v end end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-lint", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-lint", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "lint", @@ -679,12 +683,12 @@ require("lazy").setup({ config = function(_, opts) require("lazydev").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/vimplugin-nvim-lazydev", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/vimplugin-nvim-lazydev", ft = { "lua" }, name = "lazydev", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-lspconfig", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-lspconfig", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "lspconfig", @@ -702,7 +706,7 @@ require("lazy").setup({ unhide = false, }) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/lualine.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/lualine.nvim", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "lualine", @@ -730,7 +734,7 @@ require("lazy").setup({ config = function(_, opts) require("luasnip").config.set_config(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/luasnip", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/luasnip", lazy = false, name = "luasnip", }, @@ -742,7 +746,7 @@ require("lazy").setup({ vim.keymap.del("x", "nr") vim.keymap.del("n", "nr") end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/NrrwRgn", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/NrrwRgn", lazy = true, name = "narrow-region", }, @@ -779,13 +783,13 @@ require("lazy").setup({ -- } -- }) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-navic", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-navic", lazy = true, name = "navic", opts = { click = true, depth_limit = 5, highlight = true, lsp = { auto_attach = true } }, }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-navbuddy", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-navbuddy", lazy = true, name = "navbuddy", opts = { lsp = { auto_attach = true }, window = { border = "rounded" } }, @@ -799,7 +803,7 @@ require("lazy").setup({ dependencies = { { "plenary", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/plenary.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/plenary.nvim", lazy = true, name = "plenary", }, @@ -808,18 +812,18 @@ require("lazy").setup({ config = function(_, opts) require("nvim-web-devicons").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-web-devicons", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-web-devicons", lazy = true, name = "nvim-web-devicons", }, { "nui", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nui.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nui.nvim", lazy = true, name = "nui", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/neo-tree.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/neo-tree.nvim", lazy = true, name = "neo-tree", opts = { @@ -874,18 +878,18 @@ require("lazy").setup({ notify.setup(opts) vim.notify = notify -- Vim uses notify by default end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-notify", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-notify", lazy = true, name = "notify", }, { "nui", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nui.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nui.nvim", lazy = true, name = "nui", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/noice.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/noice.nvim", lazy = false, name = "noice", opts = { @@ -921,13 +925,13 @@ require("lazy").setup({ }, { "rainbow-delimiters", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/rainbow-delimiters.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/rainbow-delimiters.nvim", lazy = false, name = "rainbow-delimiters", }, { "rustaceanvim", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/rustaceanvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/rustaceanvim", init = function() vim.g.rustaceanvim = { tools = { @@ -973,7 +977,7 @@ require("lazy").setup({ }, { "sandwich", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/vim-sandwich", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/vim-sandwich", init = function() -- Disable default keymaps vim.g.sandwich_no_default_key_mappings = 1 @@ -985,7 +989,7 @@ require("lazy").setup({ }, { "sleuth", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/vim-sleuth", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/vim-sleuth", lazy = false, name = "sleuth", }, @@ -1003,30 +1007,30 @@ require("lazy").setup({ dependencies = { { "plenary", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/plenary.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/plenary.nvim", lazy = true, name = "plenary", }, { "telescope-fzf-native", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/telescope-fzf-native.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/telescope-fzf-native.nvim", lazy = true, name = "telescope-fzf-native", }, { "telescope-undo", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/telescope-undo.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/telescope-undo.nvim", lazy = true, name = "telescope-undo", }, { "telescope-ui-select", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/telescope-ui-select.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/telescope-ui-select.nvim", lazy = true, name = "telescope-ui-select", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/telescope.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/telescope.nvim", lazy = true, name = "telescope", opts = { @@ -1047,12 +1051,12 @@ require("lazy").setup({ dependencies = { { "plenary", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/plenary.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/plenary.nvim", lazy = true, name = "plenary", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/todo-comments.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/todo-comments.nvim", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "todo-comments", @@ -1075,7 +1079,7 @@ require("lazy").setup({ config = function(_, opts) require("toggleterm").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/toggleterm.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/toggleterm.nvim", keys = { "" }, lazy = true, name = "toggleterm", @@ -1102,14 +1106,14 @@ require("lazy").setup({ config = function(_, opts) require("nvim-treesitter.configs").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-treesitter", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-treesitter", event = { "BufReadPost", "BufNewFile" }, init = function() -- Fix treesitter grammars/parsers on nix vim.opt.runtimepath:append( - "/nix/store/0a8da834qdlvvfrah5i2a2rz2mnqc1d2-vimplugin-nvim-treesitter-2024-08-04" + "/nix/store/5idj2gr9mmifgrnzl4zq35i6ac8nh5jm-vimplugin-nvim-treesitter-2024-09-11" ) - vim.opt.runtimepath:append("/nix/store/z5838nllsi3a8z9z73wgv9g0ikx91nlq-treesitter-parsers") + vim.opt.runtimepath:append("/nix/store/wl5irpjigjw2f933kalcjcg1m7h6kwh1-treesitter-parsers") end, lazy = true, name = "treesitter", @@ -1126,7 +1130,7 @@ require("lazy").setup({ }, }, indent = { enable = true }, - parser_install_dir = "/nix/store/z5838nllsi3a8z9z73wgv9g0ikx91nlq-treesitter-parsers", + parser_install_dir = "/nix/store/wl5irpjigjw2f933kalcjcg1m7h6kwh1-treesitter-parsers", }, }, { @@ -1134,7 +1138,7 @@ require("lazy").setup({ config = function(_, opts) require("trim").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/trim.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/trim.nvim", lazy = false, name = "trim", }, @@ -1144,7 +1148,7 @@ require("lazy").setup({ config = function(_, opts) require("trouble").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/trouble.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/trouble.nvim", lazy = true, name = "trouble", }, @@ -1156,18 +1160,18 @@ require("lazy").setup({ dependencies = { { "promise", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/promise-async", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/promise-async", lazy = true, name = "promise", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/nvim-ufo", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/nvim-ufo", lazy = false, name = "ufo", }, { "vimtex", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/vimtex", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/vimtex", init = function() vim.g.vimtex_view_method = "zathura" end, @@ -1181,12 +1185,12 @@ require("lazy").setup({ dependencies = { { "mini", - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/mini.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/mini.nvim", lazy = true, name = "mini", }, }, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/which-key.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/which-key.nvim", lazy = false, name = "which-key", opts = { preset = "helix" }, @@ -1198,7 +1202,7 @@ require("lazy").setup({ config = function(_, opts) require("winshift").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/winshift.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/winshift.nvim", lazy = true, name = "winshift", opts = { @@ -1212,7 +1216,7 @@ require("lazy").setup({ config = function(_, opts) require("yanky").setup(opts) end, - dir = "/nix/store/ypd5dagzrwpz35gnf0a67ak6lz7drfpi-lazy-plugins/yanky.nvim", + dir = "/nix/store/2z9dmmiwr51af1gxlljxdp8z6x9iv7ig-lazy-plugins/yanky.nvim", lazy = true, name = "yanky", }, diff --git a/config/neovim/store/lazy-plugins/NrrwRgn/test/runtest.sh b/config/neovim/store/lazy-plugins/NrrwRgn/test/runtest.sh index e230d7b6..d2bd9c44 100755 --- a/config/neovim/store/lazy-plugins/NrrwRgn/test/runtest.sh +++ b/config/neovim/store/lazy-plugins/NrrwRgn/test/runtest.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/sh +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/sh for i in */; do cd "$i" diff --git a/config/neovim/store/lazy-plugins/NrrwRgn/test/test1/cmd.sh b/config/neovim/store/lazy-plugins/NrrwRgn/test/test1/cmd.sh index 1cdd818c..9b5d52f0 100755 --- a/config/neovim/store/lazy-plugins/NrrwRgn/test/test1/cmd.sh +++ b/config/neovim/store/lazy-plugins/NrrwRgn/test/test1/cmd.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash #set -x dir="$(realpath ../..)" diff --git a/config/neovim/store/lazy-plugins/NrrwRgn/test/test2/cmd.sh b/config/neovim/store/lazy-plugins/NrrwRgn/test/test2/cmd.sh index 1a01f4cc..550774e2 100755 --- a/config/neovim/store/lazy-plugins/NrrwRgn/test/test2/cmd.sh +++ b/config/neovim/store/lazy-plugins/NrrwRgn/test/test2/cmd.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash #set -x Test="Test2" diff --git a/config/neovim/store/lazy-plugins/NrrwRgn/test/test3/cmd.sh b/config/neovim/store/lazy-plugins/NrrwRgn/test/test3/cmd.sh index e701162a..2fe4f010 100755 --- a/config/neovim/store/lazy-plugins/NrrwRgn/test/test3/cmd.sh +++ b/config/neovim/store/lazy-plugins/NrrwRgn/test/test3/cmd.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash #set -x Test="Test3" diff --git a/config/neovim/store/lazy-plugins/NrrwRgn/test/test4/cmd.sh b/config/neovim/store/lazy-plugins/NrrwRgn/test/test4/cmd.sh index bd3aa38e..17359931 100755 --- a/config/neovim/store/lazy-plugins/NrrwRgn/test/test4/cmd.sh +++ b/config/neovim/store/lazy-plugins/NrrwRgn/test/test4/cmd.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash #set -x Test="Test4" diff --git a/config/neovim/store/lazy-plugins/NrrwRgn/test/test5/cmd.sh b/config/neovim/store/lazy-plugins/NrrwRgn/test/test5/cmd.sh index fccfdf3a..2c215cda 100755 --- a/config/neovim/store/lazy-plugins/NrrwRgn/test/test5/cmd.sh +++ b/config/neovim/store/lazy-plugins/NrrwRgn/test/test5/cmd.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash #set -x Test=`basename $PWD` diff --git a/config/neovim/store/lazy-plugins/NrrwRgn/test/test6/cmd.sh b/config/neovim/store/lazy-plugins/NrrwRgn/test/test6/cmd.sh index f11c5273..8aded376 100755 --- a/config/neovim/store/lazy-plugins/NrrwRgn/test/test6/cmd.sh +++ b/config/neovim/store/lazy-plugins/NrrwRgn/test/test6/cmd.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash #set -x Test=`basename $PWD` diff --git a/config/neovim/store/lazy-plugins/NrrwRgn/test/test7/cmd.sh b/config/neovim/store/lazy-plugins/NrrwRgn/test/test7/cmd.sh index 3b3baa1e..0485bbc6 100755 --- a/config/neovim/store/lazy-plugins/NrrwRgn/test/test7/cmd.sh +++ b/config/neovim/store/lazy-plugins/NrrwRgn/test/test7/cmd.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash #set -x Test=`basename $PWD` diff --git a/config/neovim/store/lazy-plugins/better-escape.nvim/readme.md b/config/neovim/store/lazy-plugins/better-escape.nvim/readme.md index 7ec823e1..313ea4e4 100644 --- a/config/neovim/store/lazy-plugins/better-escape.nvim/readme.md +++ b/config/neovim/store/lazy-plugins/better-escape.nvim/readme.md @@ -110,8 +110,7 @@ require("better_escape").setup { }, t = { j = { - k = "", - j = "", + k = "", }, }, v = { diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/formatting.yml b/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/formatting.yml index fba8cdf4..7ac28ef9 100644 --- a/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/formatting.yml +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/formatting.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: JohnnyMorganz/stylua-action@v2 + - uses: JohnnyMorganz/stylua-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} version: latest diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/palette.yml b/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/palette.yml index 31aa5cb3..55d0e5e9 100644 --- a/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/palette.yml +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/palette.yml @@ -17,7 +17,7 @@ jobs: - name: Create Pull Request id: cpr - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6 with: commit-message: 'feat: auto-sync upstream palettes' committer: GitHub diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/pandocvim.yml b/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/pandocvim.yml index 789a326b..aa7e6e3d 100644 --- a/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/pandocvim.yml +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/.github/workflows/pandocvim.yml @@ -20,7 +20,7 @@ jobs: toc: true version: "nvim >= 0.8.0" treesitter: true - - uses: stefanzweifel/git-auto-commit-action@v4 + - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "docs: auto generate vimdoc" branch: ${{ github.head_ref }} diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/CHANGELOG.md b/config/neovim/store/lazy-plugins/catppuccin-nvim/CHANGELOG.md index 89e8cccc..cb559a8a 100644 --- a/config/neovim/store/lazy-plugins/catppuccin-nvim/CHANGELOG.md +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [1.9.0](https://github.com/catppuccin/nvim/compare/v1.8.0...v1.9.0) (2024-08-09) + + +### Features + +* add fzf-lua integration ([#746](https://github.com/catppuccin/nvim/issues/746)) ([05206bb](https://github.com/catppuccin/nvim/commit/05206bbb6d500a339cd55a9486532c3871a4455e)) +* add lir.nvim and lir-git-status.nvim integration ([#705](https://github.com/catppuccin/nvim/issues/705)) ([d3907de](https://github.com/catppuccin/nvim/commit/d3907deedf74d1d5bd3bb990bff2db2ebc916c56)) +* add markdown.nvim integration ([ba41328](https://github.com/catppuccin/nvim/commit/ba413282677e1027a42d6ff585115d3e1df12b66)) +* add vim-dadbod-ui integration ([#747](https://github.com/catppuccin/nvim/issues/747)) ([4db4c77](https://github.com/catppuccin/nvim/commit/4db4c77cc17d23aa90b393f3e550ce99b9e903d5)) +* **render-markdown:** add highlights for callouts ([03a2f35](https://github.com/catppuccin/nvim/commit/03a2f354456373c199eb7829fd14120cc2099108)) +* **terminal:** highlight `TermCursor` and `TermCursorNC` ([#749](https://github.com/catppuccin/nvim/issues/749)) ([548b2a2](https://github.com/catppuccin/nvim/commit/548b2a25415bb60e05c536b7658aa8ffbfeb3e45)) + ## [1.8.0](https://github.com/catppuccin/nvim/compare/v1.7.0...v1.8.0) (2024-07-25) diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/README.md b/config/neovim/store/lazy-plugins/catppuccin-nvim/README.md index f6c7f9a7..d6246396 100644 --- a/config/neovim/store/lazy-plugins/catppuccin-nvim/README.md +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/README.md @@ -696,6 +696,20 @@ flash = true ``` + + + + fzf-lua + + +```lua +fzf = true +``` + + + + + @@ -811,6 +825,20 @@ lightspeed = false ``` + + + + lir.nvim + + +```lua +lir = { + enabled = false, + git_status = false +} +``` + + @@ -1326,10 +1354,10 @@ To use another flavour just replace `mocha` with the one you want to use. - + - render-markdown (markdown.nvim) + render-markdown.nvim ```lua @@ -1338,7 +1366,7 @@ render_markdown = true - + @@ -1440,6 +1468,20 @@ let g:clap_theme = 'catppuccin' + + + + vim-dadbod-ui + + +```lua +dadbod_ui = false +``` + + + + + diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/doc/catppuccin.txt b/config/neovim/store/lazy-plugins/catppuccin-nvim/doc/catppuccin.txt index a3624541..ee4efe59 100644 --- a/config/neovim/store/lazy-plugins/catppuccin-nvim/doc/catppuccin.txt +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/doc/catppuccin.txt @@ -538,6 +538,10 @@ flash.nvim>lua flash = true < +fzf-lua>lua + fzf = true +< + gitsigns.nvim>lua gitsigns = true < @@ -587,6 +591,13 @@ lightspeed.nvim>lua lightspeed = false < +lir.nvim>lua + lir = { + enabled = false, + git_status = false + } +< + lspsaga.nvim>lua lsp_saga = false < @@ -790,7 +801,7 @@ Here is how you can use them. To use another flavour just replace `mocha` with the one you want to use. -render-markdown (markdown.nvim)>lua +render-markdown.nvim>lua render_markdown = true < @@ -830,6 +841,10 @@ Use this to set it up: let g:clap_theme = 'catppuccin' < +vim-dadbod-ui>lua + dadbod_ui = false +< + vim-gitgutter>lua gitgutter = false < diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/editor.lua b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/editor.lua index 6a12ef66..46d17014 100644 --- a/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/editor.lua +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/editor.lua @@ -59,9 +59,11 @@ function M.get() SpellRare = { sp = C.green, style = { "undercurl" } }, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise. StatusLine = { fg = C.text, bg = O.transparent_background and C.none or C.mantle }, -- status line of current window StatusLineNC = { fg = C.surface1, bg = O.transparent_background and C.none or C.mantle }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. - TabLine = { bg = C.mantle, fg = C.surface1 }, -- tab pages line, not active tab page label - TabLineFill = {}, -- tab pages line, where there are no labels + TabLine = { bg = C.mantle, fg = C.overlay0 }, -- tab pages line, not active tab page label + TabLineFill = { bg = O.transparent_background and C.none or C.mantle }, -- tab pages line, where there are no labels TabLineSel = { fg = C.green, bg = C.surface1 }, -- tab pages line, active tab page label + TermCursor = { fg = C.base, bg = C.rosewater }, -- cursor in a focused terminal + TermCursorNC = { fg = C.base, bg = C.overlay2 }, -- cursor in unfocused terminals Title = { fg = C.blue, style = { "bold" } }, -- titles for output from ":set all", ":autocmd" etc. Visual = { bg = C.surface1, style = { "bold" } }, -- Visual mode selection VisualNOS = { bg = C.surface1, style = { "bold" } }, -- Visual mode selection when vim is "Not Owning the Selection". diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/dadbod_ui.lua b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/dadbod_ui.lua new file mode 100644 index 00000000..db569bb6 --- /dev/null +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/dadbod_ui.lua @@ -0,0 +1,11 @@ +local M = {} + +function M.get() + return { + NotificationInfo = { fg = C.blue, bg = C.mantle }, + NotificationWarning = { fg = C.yellow, bg = C.mantle }, + NotificationError = { fg = C.red, bg = C.mantle }, + } +end + +return M diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/fzf.lua b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/fzf.lua new file mode 100644 index 00000000..fda5a465 --- /dev/null +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/fzf.lua @@ -0,0 +1,22 @@ +local M = {} + +function M.get() + return { + FzfLuaNormal = { link = "NormalFloat" }, + FzfLuaBorder = { link = "FloatBorder" }, + FzfLuaTitle = { link = "FloatTitle" }, + FzfLuaHeaderBind = { fg = C.yellow }, + FzfLuaHeaderText = { fg = C.peach }, + FzfLuaPathColNr = { fg = C.blue }, + FzfLuaPathLineNr = { fg = C.green }, + FzfLuaBufName = { fg = C.mauve }, + FzfLuaBufNr = { fg = C.yellow }, + FzfLuaBufFlagCur = { fg = C.peach }, + FzfLuaBufFlagAlt = { fg = C.blue }, + FzfLuaTabTitle = { fg = C.sky }, + FzfLuaTabMarker = { fg = C.yellow }, + FzfLuaLiveSym = { fg = C.peach }, + } +end + +return M diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/lir.lua b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/lir.lua new file mode 100644 index 00000000..1c51c7cd --- /dev/null +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/lir.lua @@ -0,0 +1,26 @@ +local M = {} + +function M.get() + return vim.tbl_deep_extend("force", {}, { + LirFloatNormal = { fg = C.text, bg = O.transparent_background and C.none or C.mantle }, + LirFloatBorder = { + fg = O.transparent_background and C.surface1 or C.base, + bg = O.transparent_background and C.none or C.base, + }, + LirFloatCursorLine = { link = "CursorLine" }, + LirDir = { fg = C.blue }, + LirSymLink = { fg = C.pink }, + LirEmptyDirText = { fg = C.blue }, + LirFloatCurdirWindowNormal = { fg = C.text }, + LirFloatCurdirWindowDirName = { fg = C.lavender, style = { "bold" } }, + }, ((O.integrations.lir and O.integrations.lir.git_status) and { + LirGitStatusBracket = { fg = C.overlay0 }, + LirGitStatusIndex = { fg = C.blue }, + LirGitStatusWorktree = { fg = C.yellow }, + LirGitStatusUnmerged = { fg = C.red }, + LirGitStatusUntracked = { fg = C.subtext0 }, + LirGitStatusIgnored = { fg = C.subtext0 }, + }) or {}) +end + +return M diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/render_markdown.lua b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/render_markdown.lua index 8b2f1b5f..5a0e5df5 100644 --- a/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/render_markdown.lua +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/groups/integrations/render_markdown.lua @@ -1,7 +1,7 @@ local M = {} --- markdown.nvim highlight groups: --- https://github.com/MeanderingProgrammer/markdown.nvim?tab=readme-ov-file#colors +-- render-markdown.nvim highlight groups: +-- https://github.com/MeanderingProgrammer/render-markdown.nvim?tab=readme-ov-file#colors function M.get() local groups = { @@ -10,6 +10,11 @@ function M.get() RenderMarkdownBullet = { fg = C.sky }, RenderMarkdownTableHead = { fg = C.blue }, RenderMarkdownTableRow = { fg = C.lavender }, + RenderMarkdownSuccess = { fg = C.green }, + RenderMarkdownInfo = { fg = C.sky }, + RenderMarkdownHint = { fg = C.teal }, + RenderMarkdownWarn = { fg = C.yellow }, + RenderMarkdownError = { fg = C.red }, } local syntax = require("catppuccin.groups.syntax").get() diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/types.lua b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/types.lua index 4c5aff90..0e7ff5af 100644 --- a/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/types.lua +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/lua/catppuccin/types.lua @@ -132,6 +132,7 @@ -- sign("DapBreakpointCondition", { text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = ""}) -- sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = ""}) -- ``` +---@field dadbod_ui boolean? ---@field dap boolean? ---@field dap_ui boolean? ---@field dashboard boolean? @@ -149,6 +150,7 @@ -- ``` ---@field fidget boolean? ---@field flash boolean? +---@field fzf boolean? ---@field gitgutter boolean? ---@field gitsigns boolean? ---@field grug_far boolean? @@ -159,6 +161,7 @@ ---@field indent_blankline CtpIntegrationIndentBlankline | boolean? ---@field leap boolean? ---@field lightspeed boolean? +---@field lir CtpIntegrationLir | boolean? -- For custom Lsp kind icon and colors, adjust your `lspsaga` config: -- -- ```lua @@ -238,6 +241,12 @@ -- Follow the instructions on the plugins GitHub repo to set it up. ---@field colored_indent_levels boolean? +---@class CtpIntegrationLir +-- Whether to enable the integration. +---@field enabled boolean +-- Sets lir-git-status.nvim highlight groups +---@field git_status boolean + ---@class CtpIntegrationMini -- Whether to enable the integration. ---@field enabled boolean diff --git a/config/neovim/store/lazy-plugins/catppuccin-nvim/renovate.json b/config/neovim/store/lazy-plugins/catppuccin-nvim/renovate.json new file mode 100644 index 00000000..a2220005 --- /dev/null +++ b/config/neovim/store/lazy-plugins/catppuccin-nvim/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>catppuccin/renovate-config" + ] +} diff --git a/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/ast.lua b/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/ast.lua index 3083ec20..8fcc867d 100644 --- a/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/ast.lua +++ b/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/ast.lua @@ -100,9 +100,11 @@ local function highlight_detail(ast_buf) conf.highlights.detail, { linenum - 1, range.start }, { linenum - 1, range["end"] }, - "v", - false, - 110 + { + regtype = "v", + inclusive = false, + priority = 110, + } ) end end @@ -157,9 +159,11 @@ function M.update_highlight(source_buf, ast_buf) "Search", curline_ranges.start, curline_ranges["end"], - "v", - false, - 110 + { + regtype = "v", + inclusive = false, + priority = 110, + } ) end end diff --git a/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/inlay_hints.lua b/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/inlay_hints.lua index 2f70d044..548aafeb 100644 --- a/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/inlay_hints.lua +++ b/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/inlay_hints.lua @@ -142,7 +142,7 @@ local function handler(err, result, ctx) local max_len = -1 for key, _ in pairs(ret) do - local line = tonumber(key) + local line = math.floor(tonumber(key)) local current_line = vim.api.nvim_buf_get_lines(bufnr, line, line + 1, false)[1] if current_line then @@ -153,7 +153,7 @@ local function handler(err, result, ctx) for key, value in pairs(ret) do local virt_text = "" - local line = tonumber(key) + local line = math.floor(tonumber(key)) local current_line = vim.api.nvim_buf_get_lines(bufnr, line, line + 1, false)[1] diff --git a/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/memory_usage.lua b/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/memory_usage.lua index 1efd52d8..b9691234 100644 --- a/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/memory_usage.lua +++ b/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/memory_usage.lua @@ -5,8 +5,8 @@ local function display(lines) for k, line in pairs(lines) do -- Pad lines if k ~= 1 then lines[k] = " " .. line .. " " end end - local vim_width = api.nvim_get_option("columns") - local vim_height = api.nvim_get_option("lines") + local vim_width = api.nvim_get_option_value("columns", { scope = "local" }) + local vim_height = api.nvim_get_option_value("lines", { scope = "local" }) local height = math.ceil(vim_height * 0.7 - 4) local width = math.ceil(vim_width * 0.7) local row = math.ceil((vim_height - height) / 2 - 1) @@ -21,19 +21,21 @@ local function display(lines) col = col, border = require("clangd_extensions.config").options.memory_usage.border, }) - vim.bo.shiftwidth = 2 vim.wo.foldmethod = "indent" api.nvim_buf_set_lines(buf, 0, -1, true, lines) + api.nvim_set_option_value("shiftwidth", 2, { buf = buf }) api.nvim_set_option_value("bufhidden", "wipe", { buf = buf }) api.nvim_set_option_value("modifiable", false, { buf = buf }) api.nvim_set_option_value("buftype", "nofile", { buf = buf }) - api.nvim_buf_set_keymap(buf, "n", "q", ":bd", { + vim.keymap.set("n", "q", ":bd", { noremap = true, silent = true, + buffer = buf, }) - api.nvim_buf_set_keymap(buf, "n", "", ":bd", { + vim.keymap.set("n", "", ":bd", { noremap = true, silent = true, + buffer = buf, }) end diff --git a/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/switch_source_header.lua b/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/switch_source_header.lua index d19ae9c9..d038af6c 100644 --- a/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/switch_source_header.lua +++ b/config/neovim/store/lazy-plugins/clangd_extensions.nvim/lua/clangd_extensions/switch_source_header.lua @@ -1,6 +1,10 @@ local function handler(_err, uri) if not uri or uri == "" then - vim.api.nvim_echo({ { "Corresponding file cannot be determined" } }, false, {}) + vim.api.nvim_echo( + { { "Corresponding file cannot be determined" } }, + false, + {} + ) return end local file_name = vim.uri_to_fname(uri) diff --git a/config/neovim/store/lazy-plugins/clangd_extensions.nvim/plugin/clangd_extensions.lua b/config/neovim/store/lazy-plugins/clangd_extensions.nvim/plugin/clangd_extensions.lua index ca4a8fdc..8dafb04d 100644 --- a/config/neovim/store/lazy-plugins/clangd_extensions.nvim/plugin/clangd_extensions.lua +++ b/config/neovim/store/lazy-plugins/clangd_extensions.nvim/plugin/clangd_extensions.lua @@ -1,42 +1,60 @@ local create_command = vim.api.nvim_create_user_command -create_command('ClangdSetInlayHints', function() - require("clangd_extensions.inlay_hints").set_inlay_hints() -end, {}) - -create_command('ClangdDisableInlayHints', function() - require("clangd_extensions.inlay_hints").disable_inlay_hints() -end, {}) - -create_command('ClangdToggleInlayHints', function() - require("clangd_extensions.inlay_hints").toggle_inlay_hints() -end, {}) - -create_command('ClangdAST', function(opts) - require("clangd_extensions.ast").display_ast(opts.line1, opts.line2) -end, { range = true }) - -create_command('ClangdTypeHierarchy', function() - require("clangd_extensions.type_hierarchy").show_hierarchy() -end, {}) - -create_command('ClangdSymbolInfo', function() - require("clangd_extensions.symbol_info").show_symbol_info() -end, {}) +create_command( + "ClangdSetInlayHints", + function() require("clangd_extensions.inlay_hints").set_inlay_hints() end, + {} +) create_command( - 'ClangdMemoryUsage', + "ClangdDisableInlayHints", + function() require("clangd_extensions.inlay_hints").disable_inlay_hints() end, + {} +) + +create_command( + "ClangdToggleInlayHints", + function() require("clangd_extensions.inlay_hints").toggle_inlay_hints() end, + {} +) + +create_command( + "ClangdAST", function(opts) - require("clangd_extensions.memory_usage").show_memory_usage(opts.args == 'expand_preamble') + require("clangd_extensions.ast").display_ast(opts.line1, opts.line2) + end, + { range = true } +) + +create_command( + "ClangdTypeHierarchy", + function() require("clangd_extensions.type_hierarchy").show_hierarchy() end, + {} +) + +create_command( + "ClangdSymbolInfo", + function() require("clangd_extensions.symbol_info").show_symbol_info() end, + {} +) + +create_command( + "ClangdMemoryUsage", + function(opts) + require("clangd_extensions.memory_usage").show_memory_usage( + opts.args == "expand_preamble" + ) end, { - nargs = '?', - complete = function(_, _, _) - return { 'expand_preamble' } - end + nargs = "?", + complete = function(_, _, _) return { "expand_preamble" } end, } ) -create_command('ClangdSwitchSourceHeader', function() - require("clangd_extensions.switch_source_header").switch_source_header() -end, {}) +create_command( + "ClangdSwitchSourceHeader", + function() + require("clangd_extensions.switch_source_header").switch_source_header() + end, + {} +) diff --git a/config/neovim/store/lazy-plugins/cmp-async-path/lua/cmp_async_path/init.lua b/config/neovim/store/lazy-plugins/cmp-async-path/lua/cmp_async_path/init.lua index 7ba9b0f3..c853d837 100644 --- a/config/neovim/store/lazy-plugins/cmp-async-path/lua/cmp_async_path/init.lua +++ b/config/neovim/store/lazy-plugins/cmp-async-path/lua/cmp_async_path/init.lua @@ -48,17 +48,89 @@ source.complete = function(self, params, callback) end) end -source.resolve = function(self, completion_item, callback) +--- get documentation in separate thread +---@param _ any +---@param completion_item lsp.CompletionItem +---@param callback fun(completion_item: lsp.CompletionItem|nil) +source.resolve = function(_, completion_item, callback) local data = completion_item.data - if data.stat and data.stat.type == 'file' then - local ok, documentation = pcall(function() - return self:_get_documentation(data.path, constants.max_lines) - end) - if ok then - completion_item.documentation = documentation - end + ---@diagnostic disable-next-line: undefined-field + if not data.stat or data.stat.type ~= 'file' then + -- return right away with no changes / no added docs + callback(completion_item) + return end - callback(completion_item) + + local work + work = assert(vim.uv.new_work( + --- Read file in thread + ---@param filepath string + ---@param count number max line count (-1 if no max) + ---@return string|nil, string (error, serialized_table) either some error or the serialized table + function(filepath, count) + local ok, binary = pcall(io.open, filepath, 'rb') + if not ok or binary == nil then + ---@diagnostic disable-next-line: redundant-return-value + return nil, vim.json.encode({ + kind = "binary", + contents = "« cannot read this file »" + }) + end + local first_kb = binary:read(1024) + if first_kb:find('\0') then + ---@diagnostic disable-next-line: redundant-return-value + return nil, vim.json.encode({kind = "binary", contents = 'binary file'}) + end + + local contents = {} + for content in first_kb:gmatch("[^\r\n]+") do + table.insert(contents, content) + if count > -1 and #contents >= count then + break + end + end + ---@diagnostic disable-next-line: redundant-return-value + return nil, vim.json.encode({contents = contents}) + end, + --- deserialize doc and call callback(…) + ---@param serialized_fileinfo string + function(worker_error, serialized_fileinfo) + if worker_error then + error(string.format("Worker error while fetching file doc: %s", worker_error)) + end + + local read_ok, file_info = pcall(vim.json.decode, serialized_fileinfo, {luanil = {object = true, array = true}}) + if not read_ok then + error(string.format("Unexpected problem de-serializing item info: «%s»", + serialized_fileinfo)) + end + if file_info.kind == "binary" then + completion_item.documentation = { + kind = cmp.lsp.MarkupKind.PlainText, + value = file_info.contents, + } + else + local contents = file_info.contents + local filetype = vim.filetype.match({contents = contents}) + if not filetype then + completion_item.documentation = { + kind = cmp.lsp.MarkupKind.PlainText, + value = table.concat(contents, '\n'), + } + else + table.insert(contents, 1, '```' .. filetype) + table.insert(contents, '```') + completion_item.documentation = { + kind = cmp.lsp.MarkupKind.Markdown, + value = table.concat(contents, '\n'), + } + end + end + + callback(completion_item) + end + )) + work:queue(data.path, constants.max_lines or -1, cmp.lsp.MarkupKind.Markdown) end source._dirname = function(self, params, option) @@ -113,13 +185,22 @@ source._dirname = function(self, params, option) end source._candidates = function(_, dirname, include_hidden, option, callback) - local entries, err = vim.loop.fs_scandir(dirname) + local entries, err = vim.uv.fs_scandir(dirname) if err then return callback(err, nil) end local work - work = assert(vim.loop.new_work( + work = assert(vim.uv.new_work( + --- create path entries + ---@param _entries uv_fs_t + ---@param _dirname any see vim.fn.resolve() + ---@param _include_hidden boolean + ---@param label_trailing_slash boolean + ---@param trailing_slash boolean + ---@param file_kind table see cmp.lsp.CompletionItemKind.Filee + ---@param folder_kind table see cmp.lsp.CompletionItemKind.Folder + ---@return string|nil, string (error, serialized_results) "error text", nil or nil, "serialized items" function(_entries, _dirname, _include_hidden, label_trailing_slash, trailing_slash, file_kind, folder_kind) @@ -131,13 +212,13 @@ source._candidates = function(_, dirname, include_hidden, option, callback) end local path = _dirname .. '/' .. name - local stat = assert(vim.loop.fs_stat)(path) + local stat = assert(vim.uv.fs_stat)(path) local lstat = nil if stat then fs_type = stat.type elseif fs_type == 'link' then -- Broken symlink - lstat = assert(vim.loop.fs_lstat)(_dirname) + lstat = assert(vim.uv.fs_lstat)(_dirname) if not lstat then return end @@ -169,8 +250,9 @@ source._candidates = function(_, dirname, include_hidden, option, callback) end while true do - local name, fs_type, e = assert(vim.loop.fs_scandir_next)(_entries) + local name, fs_type, e = assert(vim.uv.fs_scandir_next)(_entries) if e then + ---@diagnostic disable-next-line: redundant-return-value return fs_type, "" end if not name then @@ -179,8 +261,13 @@ source._candidates = function(_, dirname, include_hidden, option, callback) create_item(name, fs_type) end + ---@diagnostic disable-next-line: redundant-return-value return nil, vim.json.encode(items) - end, function(worker_error, serialized_items) + end, + --- + ---@param worker_error string|nil non-nil if some error happened in worker + ---@param serialized_items string array-of-items serialized as string + function(worker_error, serialized_items) if worker_error then callback(err, nil) return @@ -218,35 +305,5 @@ source._validate_option = function(_, params) return option end -source._get_documentation = function(_, filename, count) - local binary = assert(io.open(filename, 'rb')) - local first_kb = binary:read(1024) - if first_kb:find('\0') then - return {kind = cmp.lsp.MarkupKind.PlainText, value = 'binary file'} - end - - local contents = {} - for content in first_kb:gmatch("[^\r\n]+") do - table.insert(contents, content) - if count ~= nil and #contents >= count then - break - end - end - - local filetype = vim.filetype.match({filename = filename}) - if not filetype then - return { - kind = cmp.lsp.MarkupKind.PlainText, - value = table.concat(contents, '\n'), - } - end - - table.insert(contents, 1, '```' .. filetype) - table.insert(contents, '```') - return { - kind = cmp.lsp.MarkupKind.Markdown, - value = table.concat(contents, '\n'), - } -end return source diff --git a/config/neovim/store/lazy-plugins/conform.nvim/.github/ISSUE_TEMPLATE/bug_report.yml b/config/neovim/store/lazy-plugins/conform.nvim/.github/ISSUE_TEMPLATE/bug_report.yml index f7c26327..5886b6d9 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/config/neovim/store/lazy-plugins/conform.nvim/.github/ISSUE_TEMPLATE/bug_report.yml @@ -10,7 +10,7 @@ body: - type: input attributes: label: "Neovim version (nvim -v)" - placeholder: "0.8.0 commit db1b0ee3b30f" + placeholder: "NVIM v0.10.1" validations: required: true - type: input @@ -19,6 +19,12 @@ body: placeholder: "MacOS 11.5" validations: required: true + - type: checkboxes + attributes: + label: Read debugging tips + options: + - label: I have read through the [debugging tips](https://github.com/stevearc/conform.nvim/blob/master/doc/debugging.md). + required: true - type: checkboxes attributes: label: Add the debug logs diff --git a/config/neovim/store/lazy-plugins/conform.nvim/.github/pre-commit b/config/neovim/store/lazy-plugins/conform.nvim/.github/pre-commit index 7b455cd2..03f95235 100755 --- a/config/neovim/store/lazy-plugins/conform.nvim/.github/pre-commit +++ b/config/neovim/store/lazy-plugins/conform.nvim/.github/pre-commit @@ -1,3 +1,3 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash set -e make fastlint diff --git a/config/neovim/store/lazy-plugins/conform.nvim/.github/pre-push b/config/neovim/store/lazy-plugins/conform.nvim/.github/pre-push index 2dadfe56..592b9572 100755 --- a/config/neovim/store/lazy-plugins/conform.nvim/.github/pre-push +++ b/config/neovim/store/lazy-plugins/conform.nvim/.github/pre-push @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash set -e IFS=' ' while read local_ref _local_sha _remote_ref _remote_sha; do diff --git a/config/neovim/store/lazy-plugins/conform.nvim/.github/workflows/tests.yml b/config/neovim/store/lazy-plugins/conform.nvim/.github/workflows/tests.yml index 47ecc80e..fabba6b7 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/.github/workflows/tests.yml +++ b/config/neovim/store/lazy-plugins/conform.nvim/.github/workflows/tests.yml @@ -50,7 +50,6 @@ jobs: strategy: matrix: include: - - nvim_tag: v0.9.4 - nvim_tag: v0.10.0 name: Run tests diff --git a/config/neovim/store/lazy-plugins/conform.nvim/.luarc.json b/config/neovim/store/lazy-plugins/conform.nvim/.luarc.json new file mode 100644 index 00000000..68da2f2b --- /dev/null +++ b/config/neovim/store/lazy-plugins/conform.nvim/.luarc.json @@ -0,0 +1,9 @@ +{ + "runtime": { + "version": "LuaJIT", + "pathStrict": true + }, + "type": { + "checkTableShape": true + } +} diff --git a/config/neovim/store/lazy-plugins/conform.nvim/CHANGELOG.md b/config/neovim/store/lazy-plugins/conform.nvim/CHANGELOG.md index f0b3519f..9099e798 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/CHANGELOG.md +++ b/config/neovim/store/lazy-plugins/conform.nvim/CHANGELOG.md @@ -1,5 +1,46 @@ # Changelog +## [8.1.0](https://github.com/stevearc/conform.nvim/compare/v8.0.0...v8.1.0) (2024-09-10) + + +### Features + +* **deno:** add support for .mjs files ([#528](https://github.com/stevearc/conform.nvim/issues/528)) ([e82b7b1](https://github.com/stevearc/conform.nvim/commit/e82b7b13b0ed348ce4dbf1495f9b1872d33f9d3f)) +* **zine:** add superhtml and ziggy support ([#531](https://github.com/stevearc/conform.nvim/issues/531)) ([392fc98](https://github.com/stevearc/conform.nvim/commit/392fc98c475b4f0552078104624e509b4826d197)) + + +### Bug Fixes + +* **log:** prepend date to log lines ([#529](https://github.com/stevearc/conform.nvim/issues/529)) ([c6728c5](https://github.com/stevearc/conform.nvim/commit/c6728c55d1e07da3138beea453d4078668719ee0)) + +## [8.0.0](https://github.com/stevearc/conform.nvim/compare/v7.1.0...v8.0.0) (2024-08-20) + + +### ⚠ BREAKING CHANGES + +* Require Neovim 0.10+ + +### Code Refactoring + +* Require Neovim 0.10+ ([d31323d](https://github.com/stevearc/conform.nvim/commit/d31323db3fa4a33d203dcb05150d98bd0153c42c)) + +## [7.1.0](https://github.com/stevearc/conform.nvim/compare/v7.0.0...v7.1.0) (2024-08-16) + + +### Features + +* add support for cljfmt ([#500](https://github.com/stevearc/conform.nvim/issues/500)) ([42e10a3](https://github.com/stevearc/conform.nvim/commit/42e10a38cbb427f418ac17f8a472b3c7315517ba)) +* add support for markdownfmt ([#511](https://github.com/stevearc/conform.nvim/issues/511)) ([960f51b](https://github.com/stevearc/conform.nvim/commit/960f51becccadc36825b2c2db266c8cffaeadbde)) +* add variable for args to insert the file extension ([#510](https://github.com/stevearc/conform.nvim/issues/510)) ([0f4f299](https://github.com/stevearc/conform.nvim/commit/0f4f299dfea09d2adfd7a1da05149a0844ac8eee)) + + +### Bug Fixes + +* **djlint:** remove default indentation arguments ([#517](https://github.com/stevearc/conform.nvim/issues/517)) ([38e5f06](https://github.com/stevearc/conform.nvim/commit/38e5f062f241d89ba44f6d67d16b4bf55d3c477e)) +* **docformatter:** update exit_codes, 3 is correct in in-place formatting ([#518](https://github.com/stevearc/conform.nvim/issues/518)) ([667102f](https://github.com/stevearc/conform.nvim/commit/667102f26106709cddd2dff1f699610df5b94d7f)) +* **nixfmt:** update repo link and description ([#505](https://github.com/stevearc/conform.nvim/issues/505)) ([2122fe2](https://github.com/stevearc/conform.nvim/commit/2122fe2ff01e9a542fc358ee9398ce2cbddf345d)) +* **sqlfluff:** don't assume ansi dialect and require config ([#519](https://github.com/stevearc/conform.nvim/issues/519)) ([bb10949](https://github.com/stevearc/conform.nvim/commit/bb10949d80dd0f60d03572f04953322785f39f7a)) + ## [7.0.0](https://github.com/stevearc/conform.nvim/compare/v6.1.0...v7.0.0) (2024-07-23) diff --git a/config/neovim/store/lazy-plugins/conform.nvim/README.md b/config/neovim/store/lazy-plugins/conform.nvim/README.md index 66c6e042..3d55e9e5 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/README.md +++ b/config/neovim/store/lazy-plugins/conform.nvim/README.md @@ -11,6 +11,7 @@ Lightweight yet powerful formatter plugin for Neovim - [Formatters](#formatters) - [Customizing formatters](#customizing-formatters) - [Recipes](#recipes) +- [Debugging](#debugging) - [Advanced topics](#advanced-topics) - [Options](#options) - [Formatter options](#formatter-options) @@ -27,7 +28,7 @@ Lightweight yet powerful formatter plugin for Neovim ## Requirements -- Neovim 0.9+ (for older versions, use a [nvim-0.x branch](https://github.com/stevearc/conform.nvim/branches)) +- Neovim 0.10+ (for older versions, use a [nvim-0.x branch](https://github.com/stevearc/conform.nvim/branches)) ## Features @@ -205,6 +206,7 @@ You can view this list in vim with `:help conform-formatters` - [caramel_fmt](https://caramel.run/manual/reference/cli/fmt.html) - Format Caramel code. - [cbfmt](https://github.com/lukas-reineke/cbfmt) - A tool to format codeblocks inside markdown and org documents. - [clang-format](https://www.kernel.org/doc/html/latest/process/clang-format.html) - Tool to format C/C++/… code according to a set of rules and heuristics. +- [cljfmt](https://github.com/weavejester/cljfmt) - cljfmt is a tool for detecting and fixing formatting errors in Clojure code. - [cljstyle](https://github.com/greglook/cljstyle) - Formatter for Clojure code. - [cmake_format](https://github.com/cheshirekow/cmake_format) - Parse cmake listfiles and format them nicely. - [codespell](https://github.com/codespell-project/codespell) - Check code for common misspellings. @@ -273,6 +275,7 @@ You can view this list in vim with `:help conform-formatters` - [llf](https://repo.or.cz/llf.git) - A LaTeX reformatter / beautifier. - [lua-format](https://github.com/Koihik/LuaFormatter) - Code formatter for Lua. - [markdown-toc](https://github.com/jonschlinkert/markdown-toc) - API and CLI for generating a markdown TOC (table of contents) for a README or any markdown files. +- [markdownfmt](https://github.com/shurcooL/markdownfmt) - Like gofmt, but for Markdown. - [markdownlint](https://github.com/DavidAnson/markdownlint) - A Node.js style checker and lint tool for Markdown/CommonMark files. - [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) - A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the markdownlint library. - [mdformat](https://github.com/executablebooks/mdformat) - An opinionated Markdown formatter. @@ -281,7 +284,7 @@ You can view this list in vim with `:help conform-formatters` - [mix](https://hexdocs.pm/mix/main/Mix.Tasks.Format.html) - Format Elixir files using the mix format command. - [nickel](https://nickel-lang.org/) - Code formatter for the Nickel programming language. - [nimpretty](https://github.com/nim-lang/nim) - nimpretty is a Nim source code beautifier that follows the official style guide. -- [nixfmt](https://github.com/serokell/nixfmt) - nixfmt is a formatter for Nix code, intended to apply a uniform style. +- [nixfmt](https://github.com/NixOS/nixfmt) - The official (but not yet stable) formatter for Nix code. - [nixpkgs_fmt](https://github.com/nix-community/nixpkgs-fmt) - nixpkgs-fmt is a Nix code formatter for nixpkgs. - [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint) - Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line. - [ocamlformat](https://github.com/ocaml-ppx/ocamlformat) - Auto-formatter for OCaml code. @@ -332,6 +335,7 @@ You can view this list in vim with `:help conform-formatters` - [styler](https://github.com/devOpifex/r.nvim) - R formatter and linter. - [stylish-haskell](https://github.com/haskell/stylish-haskell) - Haskell code prettifier. - [stylua](https://github.com/JohnnyMorganz/StyLua) - An opinionated code formatter for Lua. +- [superhtml](https://github.com/kristoff-it/superhtml) - HTML Language Server and Templating Language Library. - [swift_format](https://github.com/apple/swift-format) - Swift formatter from apple. Requires building from source with `swift build`. - [swiftformat](https://github.com/nicklockwood/SwiftFormat) - SwiftFormat is a code library and command-line tool for reformatting `swift` code on macOS or Linux. - [swiftlint](https://github.com/realm/SwiftLint) - A tool to enforce Swift style and conventions. @@ -358,6 +362,8 @@ You can view this list in vim with `:help conform-formatters` - [yew-fmt](https://github.com/schvv31n/yew-fmt) - Code formatter for the Yew framework. - [yq](https://github.com/mikefarah/yq) - YAML/JSON processor - [zigfmt](https://github.com/ziglang/zig) - Reformat Zig source into canonical form. +- [ziggy](https://github.com/kristoff-it/ziggy) - A data serialization language for expressing clear API messages, config files, etc. +- [ziggy_schema](https://github.com/kristoff-it/ziggy) - A data serialization language for expressing clear API messages, config files, etc. - [zprint](https://github.com/kkinnear/zprint) - Formatter for Clojure and EDN. @@ -432,13 +438,22 @@ require("conform").formatters.shfmt = { - [Format command](doc/recipes.md#format-command) - [Autoformat with extra features](doc/recipes.md#autoformat-with-extra-features) - [Command to toggle format-on-save](doc/recipes.md#command-to-toggle-format-on-save) -- [Automatically run slow formatters async](doc/recipes.md#automatically-run-slow-formatters-async) - [Lazy loading with lazy.nvim](doc/recipes.md#lazy-loading-with-lazynvim) - [Leave visual mode after range format](doc/recipes.md#leave-visual-mode-after-range-format) - [Run the first available formatter followed by more formatters](doc/recipes.md#run-the-first-available-formatter-followed-by-more-formatters) +## Debugging + + + +- [Background](doc/debugging.md#background) +- [Tools](doc/debugging.md#tools) +- [Testing the formatter](doc/debugging.md#testing-the-formatter) + + + ## Advanced topics diff --git a/config/neovim/store/lazy-plugins/conform.nvim/doc/advanced_topics.md b/config/neovim/store/lazy-plugins/conform.nvim/doc/advanced_topics.md index 4dcc4212..cd02930d 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/doc/advanced_topics.md +++ b/config/neovim/store/lazy-plugins/conform.nvim/doc/advanced_topics.md @@ -22,8 +22,6 @@ The way this "aftermarket" range formatting works is conform will format the ent ## Injected language formatting (code blocks) -Requires: Neovim 0.9+ - Sometimes you may have a file that contains small chunks of code in another language. This is most common for markup formats like markdown and neorg, but can theoretically be present in any filetype (for example, embedded SQL queries in a host language). For files like this, it would be nice to be able to format these code chunks using their language-specific formatters. The way that conform supports this is via the `injected` formatter. If you run this formatter on a file, it will use treesitter to parse out the blocks in the file that have different languages and runs the formatters for that filetype (configured with `formatters_by_ft`). The formatters are run in parallel, one job for each language block. diff --git a/config/neovim/store/lazy-plugins/conform.nvim/doc/conform.txt b/config/neovim/store/lazy-plugins/conform.nvim/doc/conform.txt index f6141266..3044f67c 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/doc/conform.txt +++ b/config/neovim/store/lazy-plugins/conform.nvim/doc/conform.txt @@ -288,6 +288,8 @@ FORMATTERS *conform-formatter `cbfmt` - A tool to format codeblocks inside markdown and org documents. `clang-format` - Tool to format C/C++/… code according to a set of rules and heuristics. +`cljfmt` - cljfmt is a tool for detecting and fixing formatting errors in + Clojure code. `cljstyle` - Formatter for Clojure code. `cmake_format` - Parse cmake listfiles and format them nicely. `codespell` - Check code for common misspellings. @@ -378,6 +380,7 @@ FORMATTERS *conform-formatter `lua-format` - Code formatter for Lua. `markdown-toc` - API and CLI for generating a markdown TOC (table of contents) for a README or any markdown files. +`markdownfmt` - Like gofmt, but for Markdown. `markdownlint` - A Node.js style checker and lint tool for Markdown/CommonMark files. `markdownlint-cli2` - A fast, flexible, configuration-based command-line @@ -391,8 +394,7 @@ FORMATTERS *conform-formatter `nickel` - Code formatter for the Nickel programming language. `nimpretty` - nimpretty is a Nim source code beautifier that follows the official style guide. -`nixfmt` - nixfmt is a formatter for Nix code, intended to apply a uniform - style. +`nixfmt` - The official (but not yet stable) formatter for Nix code. `nixpkgs_fmt` - nixpkgs-fmt is a Nix code formatter for nixpkgs. `npm-groovy-lint` - Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line. @@ -459,6 +461,7 @@ FORMATTERS *conform-formatter `styler` - R formatter and linter. `stylish-haskell` - Haskell code prettifier. `stylua` - An opinionated code formatter for Lua. +`superhtml` - HTML Language Server and Templating Language Library. `swift_format` - Swift formatter from apple. Requires building from source with `swift build`. `swiftformat` - SwiftFormat is a code library and command-line tool for @@ -494,6 +497,10 @@ FORMATTERS *conform-formatter `yew-fmt` - Code formatter for the Yew framework. `yq` - YAML/JSON processor `zigfmt` - Reformat Zig source into canonical form. +`ziggy` - A data serialization language for expressing clear API messages, + config files, etc. +`ziggy_schema` - A data serialization language for expressing clear API + messages, config files, etc. `zprint` - Formatter for Clojure and EDN. ================================================================================ diff --git a/config/neovim/store/lazy-plugins/conform.nvim/doc/debugging.md b/config/neovim/store/lazy-plugins/conform.nvim/doc/debugging.md new file mode 100644 index 00000000..faabe901 --- /dev/null +++ b/config/neovim/store/lazy-plugins/conform.nvim/doc/debugging.md @@ -0,0 +1,94 @@ +# Debugging + +When you are experiencing problems with a formatter, this doc is intended to give you the background +information and tools you need to figure out what is going wrong. It should help you answer +questions like "why isn't my formatter working?" and "why is my formatter using the wrong format?" + + + +- [Background](#background) +- [Tools](#tools) +- [Testing the formatter](#testing-the-formatter) + + + +## Background + +How does conform work? + +Under the hood, conform is just running a shell command, capturing the output, and replacing the +buffer contents with that output. There are a few fancy things happening with [minimal format +diffs](advanced_topics.md#minimal-format-diffs), but in practice there are almost never problems +with that system so you can mostly ignore it. + +Conform runs the formatters using `:help vim.system()`, and does one of two things. Some formatters +support formatting _from_ stdin and _to_ stdout. For these, we pipe the buffer text to the process +via stdin, and read the stdout back as the new buffer contents. For formatters that don't support +stdin/out, we create a temporary file in the same directory, write the buffer to it, run the +formatter, and read back the modified tempfile as the new buffer contents. + +## Tools + +Conform has two very useful tools for debugging misbehaving formatters: logging and `:ConformInfo`. +Try running `:ConformInfo` now; you should see something like the window below: + +Screenshot 2024-08-07 at 10 03 17 PM + +This contains a snippet of the log file, the location of the log file in case you need to see more +logs (you can use `gf` to jump to it), available formatters for the current buffer, and a list of +all the configured formatters. Each formatter has a status, an error message if there is something +wrong, a list of filetypes it applies to, and the resolved path to the executable. + +This should be enough to fix many issues. Double check to make sure your formatter is `ready` and +that it is configured to run on the filetype(s) you expect. Also double check the path to the +executable. If all of those look good, then it's time to make more use of the logs. + +The first thing you will want to do is increase the verbosity of the logs. Do this by setting the +`log_level` option: + +```lua +require("conform").setup({ + log_level = vim.log.levels.DEBUG, +}) +``` + +It is recommended to start with `DEBUG` level. You can also use `TRACE`, which will log the entire +file input and output to the formatter. This can be helpful in some situations, but takes up a lot +of visual space and so is not recommended until you need that information specifically. + +## Testing the formatter + +Once you set the log level, try the format operations again, then open the log file (remember, you +can find it from `:ConformInfo`). You're looking for the lines that tell you what command is being +run. It should look like this: + +``` +21:50:31[DEBUG] Run command: { "black", "--stdin-filename", "/Users/stevearc/dotfiles/vimplugins/conform.nvim/scripts/generate.py", "--quiet", "-" } +21:50:31[DEBUG] Run default CWD: /Users/stevearc/dotfiles/vimplugins/conform.nvim +``` + +This is logging the lua table that is passed to `vim.system()`. The first thing to do is to take this +command and run it directly in your shell and see what happens. For formatters using stdin/out, it +will look like this: + +``` +cat path/to/file.py | black --stdin-filename path/to/file.py --quiet - +``` + +Note that this will print the entire formatted file to stdout. It will be much easier for you if you +can come up with a small test file just a couple lines long that reproduces this issue. MAKE SURE +that you `cd` into the CWD directory from the log lines, as that is the directory that conform will +run the command from. If your formatter doesn't use stdin/out, do the same thing but omit the `cat`. +The command in the log line will contain a path to a temporary file. Just replace that with the path +to the real file: + +``` +black --quiet path/to/file.py +``` + +**Q:** What is the point of all of this? \ +**A:** We're trying to isolate where the problem is coming from: the formatter, the environment +configuring the formatter, Neovim, or conform. By confirming that the format command works in the +shell, we can eliminate some of those possibilities. If the format command _doesn't_ work in the +shell, you will need to iterate on that until you can find one that works. Please DO NOT file an +issue on this repo until you have a functioning format command in your shell. diff --git a/config/neovim/store/lazy-plugins/conform.nvim/doc/recipes.md b/config/neovim/store/lazy-plugins/conform.nvim/doc/recipes.md index 3c230b30..fe7bbd26 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/doc/recipes.md +++ b/config/neovim/store/lazy-plugins/conform.nvim/doc/recipes.md @@ -5,7 +5,6 @@ - [Format command](#format-command) - [Autoformat with extra features](#autoformat-with-extra-features) - [Command to toggle format-on-save](#command-to-toggle-format-on-save) -- [Automatically run slow formatters async](#automatically-run-slow-formatters-async) - [Lazy loading with lazy.nvim](#lazy-loading-with-lazynvim) - [Leave visual mode after range format](#leave-visual-mode-after-range-format) - [Run the first available formatter followed by more formatters](#run-the-first-available-formatter-followed-by-more-formatters) @@ -108,35 +107,6 @@ end, { }) ``` -## Automatically run slow formatters async - -This snippet will automatically detect which formatters take too long to run synchronously and will run them async on save instead. - -```lua -local slow_format_filetypes = {} -require("conform").setup({ - format_on_save = function(bufnr) - if slow_format_filetypes[vim.bo[bufnr].filetype] then - return - end - local function on_format(err) - if err and err:match("timeout$") then - slow_format_filetypes[vim.bo[bufnr].filetype] = true - end - end - - return { timeout_ms = 200, lsp_format = "fallback" }, on_format - end, - - format_after_save = function(bufnr) - if not slow_format_filetypes[vim.bo[bufnr].filetype] then - return - end - return { lsp_format = "fallback" } - end, -}) -``` - ## Lazy loading with lazy.nvim Here is the recommended config for lazy-loading using lazy.nvim diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/errors.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/errors.lua index 43e9a7b2..e99a27cd 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/errors.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/errors.lua @@ -7,12 +7,8 @@ local M = {} ---@enum conform.ERROR_CODE M.ERROR_CODE = { - -- Command was passed invalid arguments - INVALID_ARGS = 1, - -- Command was not executable - NOT_EXECUTABLE = 2, - -- Error occurred during when calling jobstart - JOBSTART = 3, + -- Error occurred during when calling vim.system + VIM_SYSTEM = 3, -- Command timed out during execution TIMEOUT = 4, -- Command was pre-empted by another call to format @@ -39,10 +35,7 @@ end ---@param code conform.ERROR_CODE ---@return boolean M.is_execution_error = function(code) - return code == M.ERROR_CODE.RUNTIME - or code == M.ERROR_CODE.NOT_EXECUTABLE - or code == M.ERROR_CODE.INVALID_ARGS - or code == M.ERROR_CODE.JOBSTART + return code == M.ERROR_CODE.RUNTIME or code == M.ERROR_CODE.VIM_SYSTEM end ---@param err1? conform.Error diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/cljfmt.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/cljfmt.lua new file mode 100644 index 00000000..ae52b74c --- /dev/null +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/cljfmt.lua @@ -0,0 +1,10 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/weavejester/cljfmt", + description = "cljfmt is a tool for detecting and fixing formatting errors in Clojure code.", + }, + command = "cljfmt", + args = { "fix", "-" }, + stdin = true, +} diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/deno_fmt.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/deno_fmt.lua index 5e7f4523..9983118b 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/deno_fmt.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/deno_fmt.lua @@ -4,6 +4,7 @@ local extensions = { json = "json", jsonc = "jsonc", markdown = "md", + esmodule = "mjs", typescript = "ts", typescriptreact = "tsx", } diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/djlint.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/djlint.lua index 13c966d2..03922bdd 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/djlint.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/djlint.lua @@ -6,9 +6,10 @@ return { description = "✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang.", }, command = "djlint", - args = function(_, ctx) - return { "--reformat", "--indent", ctx.shiftwidth, "-" } - end, + args = { + "--reformat", + "-", + }, cwd = util.root_file({ ".djlintrc", }), diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/docformatter.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/docformatter.lua index fa2edb01..205439ec 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/docformatter.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/docformatter.lua @@ -7,4 +7,5 @@ return { command = "docformatter", args = { "--in-place", "$FILENAME" }, stdin = false, + exit_codes = { 0, 3 }, } diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/injected.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/injected.lua index bd3313b8..427e8cc5 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/injected.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/injected.lua @@ -112,6 +112,7 @@ return { url = "doc/advanced_topics.md#injected-language-formatting-code-blocks", description = "Format treesitter injected languages.", }, + ---@type conform.InjectedFormatterOptions options = { -- Set to true to ignore errors ignore_errors = false, @@ -151,8 +152,8 @@ return { callback("No treesitter parser for buffer") return end - ---@type conform.InjectedFormatterOptions local options = self.options + ---@cast options conform.InjectedFormatterOptions ---@param lang string ---@return nil|conform.FiletypeFormatter diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/markdownfmt.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/markdownfmt.lua new file mode 100644 index 00000000..66cd7b2f --- /dev/null +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/markdownfmt.lua @@ -0,0 +1,8 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/shurcooL/markdownfmt", + description = "Like gofmt, but for Markdown.", + }, + command = "markdownfmt", +} diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/nixfmt.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/nixfmt.lua index 27029d51..14594d90 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/nixfmt.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/nixfmt.lua @@ -1,8 +1,8 @@ ---@type conform.FileFormatterConfig return { meta = { - url = "https://github.com/serokell/nixfmt", - description = "nixfmt is a formatter for Nix code, intended to apply a uniform style.", + url = "https://github.com/NixOS/nixfmt", + description = "The official (but not yet stable) formatter for Nix code.", }, command = "nixfmt", } diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/sqlfluff.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/sqlfluff.lua index 23441c20..c3d7d84a 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/sqlfluff.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/sqlfluff.lua @@ -7,7 +7,7 @@ return { description = "A modular SQL linter and auto-formatter with support for multiple dialects and templated code.", }, command = "sqlfluff", - args = { "fix", "--dialect=ansi", "-" }, + args = { "fix", "-" }, stdin = true, cwd = util.root_file({ ".sqlfluff", @@ -16,5 +16,5 @@ return { "setup.cfg", "tox.ini", }), - require_cwd = false, + require_cwd = true, } diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/superhtml.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/superhtml.lua new file mode 100644 index 00000000..d4e8df12 --- /dev/null +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/superhtml.lua @@ -0,0 +1,9 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/kristoff-it/superhtml", + description = "HTML Language Server and Templating Language Library.", + }, + command = "superhtml", + args = { "fmt", "--stdin" }, +} diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/ziggy.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/ziggy.lua new file mode 100644 index 00000000..43f2727c --- /dev/null +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/ziggy.lua @@ -0,0 +1,9 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/kristoff-it/ziggy", + description = "A data serialization language for expressing clear API messages, config files, etc.", + }, + command = "ziggy", + args = { "fmt", "--stdin" }, +} diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/ziggy_schema.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/ziggy_schema.lua new file mode 100644 index 00000000..f31407fd --- /dev/null +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/formatters/ziggy_schema.lua @@ -0,0 +1,9 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/kristoff-it/ziggy", + description = "A data serialization language for expressing clear API messages, config files, etc.", + }, + command = "ziggy", + args = { "fmt", "--stdin-schema" }, +} diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/health.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/health.lua index 07ffa224..134bbc0e 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/health.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/health.lua @@ -1,12 +1,5 @@ local M = {} ----@diagnostic disable: deprecated --- The "report_" functions have been deprecated, so use the new ones if defined. -local health_start = vim.health.start or vim.health.report_start -local health_warn = vim.health.warn or vim.health.report_warn -local health_info = vim.health.info or vim.health.report_info -local health_ok = vim.health.ok or vim.health.report_ok - ---@param name string ---@return string[] local function get_formatter_filetypes(name) @@ -36,18 +29,21 @@ end M.check = function() local conform = require("conform") - health_start("conform.nvim report") + vim.health.start("conform.nvim report") local log = require("conform.log") - health_info(string.format("Log file: %s", log.get_logfile())) + if vim.fn.has("nvim-0.10") == 0 then + vim.health.error("Neovim 0.10 or later is required") + end + vim.health.info(string.format("Log file: %s", log.get_logfile())) local all_formatters = conform.list_all_formatters() for _, formatter in ipairs(all_formatters) do if not formatter.available then - health_warn(string.format("%s unavailable: %s", formatter.name, formatter.available_msg)) + vim.health.warn(string.format("%s unavailable: %s", formatter.name, formatter.available_msg)) else local filetypes = get_formatter_filetypes(formatter.name) - health_ok(string.format("%s ready (%s)", formatter.name, table.concat(filetypes, ", "))) + vim.health.ok(string.format("%s ready (%s)", formatter.name, table.concat(filetypes, ", "))) end end end @@ -75,6 +71,12 @@ M.show_window = function() local lines = {} local highlights = {} local logfile = log.get_logfile() + + if vim.fn.has("nvim-0.10") == 0 then + table.insert(lines, "Neovim 0.10 or later is required") + table.insert(highlights, { "DiagnosticError", #lines, 0, -1 }) + end + table.insert(lines, string.format("Log file: %s", logfile)) table.insert(highlights, { "Title", #lines, 0, 10 }) if vim.fn.filereadable(logfile) == 1 then @@ -113,7 +115,7 @@ M.show_window = function() table.insert(lines, line) table.insert( highlights, - { "DiagnosticInfo", #lines, formatter.name:len(), formatter.name:len() + 6 } + { "DiagnosticOk", #lines, formatter.name:len(), formatter.name:len() + 6 } ) table.insert(highlights, { "DiagnosticInfo", diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/init.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/init.lua index c174dea8..54f8ab97 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/init.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/init.lua @@ -52,8 +52,8 @@ end ---@param opts? conform.setupOpts M.setup = function(opts) - if vim.fn.has("nvim-0.9") == 0 then - notify("conform.nvim requires Neovim 0.9+", vim.log.levels.ERROR) + if vim.fn.has("nvim-0.10") == 0 then + notify("conform.nvim requires Neovim 0.10+", vim.log.levels.ERROR) return end opts = opts or {} @@ -311,7 +311,7 @@ end ---@param bufnr integer ---@param mode "v"|"V" ----@return table {start={row,col}, end={row,col}} using (1, 0) indexing +---@return conform.Range {start={row,col}, end={row,col}} using (1, 0) indexing local function range_from_selection(bufnr, mode) -- [bufnum, lnum, col, off]; both row and column 1-indexed local start = vim.fn.getpos("v") @@ -407,6 +407,13 @@ local has_notified_ft_no_formatters = {} ---@param callback? fun(err: nil|string, did_edit: nil|boolean) Called once formatting has completed ---@return boolean True if any formatters were attempted M.format = function(opts, callback) + if vim.fn.has("nvim-0.10") == 0 then + notify_once("conform.nvim requires Neovim 0.10+", vim.log.levels.ERROR) + if callback then + callback("conform.nvim requires Neovim 0.10+") + end + return false + end opts = opts or {} local has_explicit_formatters = opts.formatters ~= nil -- If formatters were not passed in directly, fetch any options from formatters_by_ft diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/log.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/log.lua index 79ca15a0..1b6a3019 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/log.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/log.lua @@ -36,7 +36,7 @@ local function format(level, msg, ...) end end local ok, text = pcall(string.format, msg, vim.F.unpack_len(args)) - local timestr = vim.fn.strftime("%H:%M:%S") + local timestr = vim.fn.strftime("%Y-%m-%d %H:%M:%S") if ok then local str_level = levels_reverse[level] return string.format("%s[%s] %s", timestr, str_level, text) diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/runner.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/runner.lua index 2724cd6e..029d6ee2 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/runner.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/runner.lua @@ -14,12 +14,16 @@ local M = {} ---@param formatter_name string ---@param ctx conform.Context ---@param config conform.JobFormatterConfig ----@return string|string[] +---@return string[] M.build_cmd = function(formatter_name, ctx, config) local command = config.command if type(command) == "function" then command = command(config, ctx) end + local exepath = vim.fn.exepath(command) + if exepath ~= "" then + command = exepath + end ---@type string|string[] local args = {} if ctx.range and config.range_args then @@ -29,8 +33,7 @@ M.build_cmd = function(formatter_name, ctx, config) local computed_args = config.args if type(computed_args) == "function" then args = computed_args(config, ctx) - else - ---@diagnostic disable-next-line: cast-local-type + elseif computed_args then args = computed_args end end @@ -48,10 +51,10 @@ M.build_cmd = function(formatter_name, ctx, config) :gsub("$FILENAME", ctx.filename) :gsub("$DIRNAME", ctx.dirname) :gsub("$RELATIVE_FILEPATH", compute_relative_filepath) - return command .. " " .. interpolated + :gsub("$EXTENSION", ctx.filename:match(".*(%..*)$") or "") + return util.shell_build_argv(command .. " " .. interpolated) else local cmd = { command } - ---@diagnostic disable-next-line: param-type-mismatch for _, v in ipairs(args) do if v == "$FILENAME" then v = ctx.filename @@ -59,6 +62,8 @@ M.build_cmd = function(formatter_name, ctx, config) v = ctx.dirname elseif v == "$RELATIVE_FILEPATH" then v = compute_relative_filepath() + elseif v == "$EXTENSION" then + v = ctx.filename:match(".*(%..*)$") or "" end table.insert(cmd, v) end @@ -356,40 +361,29 @@ local function run_formatter(bufnr, formatter, config, ctx, input_lines, opts, c if env then log.debug("Run ENV: %s", env) end - local stdout - local stderr local exit_codes = config.exit_codes or { 0 } - local jid - local ok, jid_or_err = pcall(vim.fn.jobstart, cmd, { - cwd = cwd, - env = env, - stdout_buffered = true, - stderr_buffered = true, - stdin = config.stdin and "pipe" or "null", - on_stdout = function(_, data) - if config.stdin then - stdout = data - end - end, - on_stderr = function(_, data) - stderr = data - end, - on_exit = function(_, code) + local pid + local ok, job_or_err = pcall( + vim.system, + cmd, + { + cwd = cwd, + env = env, + stdin = config.stdin and buffer_text, + text = true, + }, + vim.schedule_wrap(function(result) + local code = result.code + local stdout = result.stdout and vim.split(result.stdout, "\n") or {} + local stderr = result.stderr and vim.split(result.stderr, "\n") or {} if vim.tbl_contains(exit_codes, code) then - local output + local output = stdout if not config.stdin then local fd = assert(uv.fs_open(ctx.filename, "r", 448)) -- 0700 local stat = assert(uv.fs_fstat(fd)) local content = assert(uv.fs_read(fd, stat.size)) uv.fs_close(fd) - output = vim.split(content, "\r?\n", {}) - else - output = stdout - -- trim trailing \r in every line - -- so that both branches of this if block behaves the same - for i, line in ipairs(output) do - output[i] = string.gsub(line, "\r$", "") - end + output = vim.split(content, "\r?\n") end -- Remove the trailing newline from the output to convert back to vim lines representation if add_extra_newline and output[#output] == "" then @@ -417,7 +411,7 @@ local function run_formatter(bufnr, formatter, config, ctx, input_lines, opts, c end if vim.api.nvim_buf_is_valid(bufnr) - and jid ~= vim.b[bufnr].conform_jid + and pid ~= vim.b[bufnr].conform_pid and opts.exclusive then callback({ @@ -431,35 +425,21 @@ local function run_formatter(bufnr, formatter, config, ctx, input_lines, opts, c }) end end - end, - }) + end) + ) if not ok then callback({ - code = errors.ERROR_CODE.JOBSTART, - message = string.format("Formatter '%s' error in jobstart: %s", formatter.name, jid_or_err), + code = errors.ERROR_CODE.VIM_SYSTEM, + message = string.format("Formatter '%s' error in vim.system: %s", formatter.name, job_or_err), }) return end - jid = jid_or_err - if jid == 0 then - callback({ - code = errors.ERROR_CODE.INVALID_ARGS, - message = string.format("Formatter '%s' invalid arguments", formatter.name), - }) - elseif jid == -1 then - callback({ - code = errors.ERROR_CODE.NOT_EXECUTABLE, - message = string.format("Formatter '%s' command is not executable", formatter.name), - }) - elseif config.stdin then - vim.api.nvim_chan_send(jid, buffer_text) - vim.fn.chanclose(jid, "stdin") - end + pid = job_or_err.pid if opts.exclusive then - vim.b[bufnr].conform_jid = jid + vim.b[bufnr].conform_pid = pid end - return jid + return pid end ---@param bufnr integer @@ -524,9 +504,9 @@ M.format_async = function(bufnr, formatters, range, opts, callback) end -- kill previous jobs for buffer - local prev_jid = vim.b[bufnr].conform_jid - if prev_jid and opts.exclusive then - if vim.fn.jobstop(prev_jid) == 1 then + local prev_pid = vim.b[bufnr].conform_pid + if prev_pid and opts.exclusive then + if uv.kill(prev_pid) == 0 then log.info("Canceled previous format job for %s", vim.api.nvim_buf_get_name(bufnr)) end end @@ -616,9 +596,9 @@ M.format_sync = function(bufnr, formatters, timeout_ms, range, opts) local original_lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) -- kill previous jobs for buffer - local prev_jid = vim.b[bufnr].conform_jid - if prev_jid and opts.exclusive then - if vim.fn.jobstop(prev_jid) == 1 then + local prev_pid = vim.b[bufnr].conform_pid + if prev_pid and opts.exclusive then + if uv.kill(prev_pid) == 0 then log.info("Canceled previous format job for %s", vim.api.nvim_buf_get_name(bufnr)) end end @@ -669,7 +649,7 @@ M.format_lines_sync = function(bufnr, formatters, timeout_ms, range, input_lines ---@type conform.FormatterConfig local config = assert(require("conform").get_formatter_config(formatter.name, bufnr)) local ctx = M.build_context(bufnr, config, range) - local jid = run_formatter( + local pid = run_formatter( bufnr, formatter, config, @@ -689,8 +669,8 @@ M.format_lines_sync = function(bufnr, formatters, timeout_ms, range, input_lines end, 5) if not wait_result then - if jid then - vim.fn.jobstop(jid) + if pid then + uv.kill(pid) end if wait_reason == -1 then return errors.coalesce(final_err, { diff --git a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/util.lua b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/util.lua index 4f9b01b8..786da19c 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/util.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/lua/conform/util.lua @@ -49,13 +49,7 @@ end ---@return fun(self: conform.FormatterConfig, ctx: conform.Context): nil|string M.root_file = function(files) return function(self, ctx) - if vim.fn.has("nvim-0.10") == 1 then - return vim.fs.root(ctx.dirname, files) - end - local found = vim.fs.find(files, { upward = true, path = ctx.dirname })[1] - if found then - return vim.fs.dirname(found) - end + return vim.fs.root(ctx.dirname, files) end end @@ -209,4 +203,47 @@ M.parse_rust_edition = function(dir) end end +---@param cmd string +---@return string[] +M.shell_build_argv = function(cmd) + local argv = {} + + -- If the shell starts with a quote, it contains spaces (from :help 'shell'). + -- The shell may also have additional arguments in it, separated by spaces. + if vim.startswith(vim.o.shell, '"') then + local quoted = vim.o.shell:match('^"([^"]+)"') + table.insert(argv, quoted) + vim.list_extend(argv, vim.split(vim.o.shell:sub(quoted:len() + 3), "%s+", { trimempty = true })) + else + vim.list_extend(argv, vim.split(vim.o.shell, "%s+")) + end + + vim.list_extend(argv, vim.split(vim.o.shellcmdflag, "%s+", { trimempty = true })) + + if vim.o.shellxquote ~= "" then + -- When shellxquote is "(", we should escape the shellxescape characters with '^' + -- See :help 'shellxescape' + if vim.o.shellxquote == "(" and vim.o.shellxescape ~= "" then + cmd = cmd:gsub(".", function(char) + if string.find(vim.o.shellxescape, char, 1, true) then + return "^" .. char + else + return char + end + end) + end + + if vim.o.shellxquote == "(" then + cmd = "(" .. cmd .. ")" + elseif vim.o.shellxquote == '"(' then + cmd = '"(' .. cmd .. ')"' + else + cmd = vim.o.shellxquote .. cmd .. vim.o.shellxquote + end + end + + table.insert(argv, cmd) + return argv +end + return M diff --git a/config/neovim/store/lazy-plugins/conform.nvim/run_tests.sh b/config/neovim/store/lazy-plugins/conform.nvim/run_tests.sh index 3a382d00..4c3ce161 100755 --- a/config/neovim/store/lazy-plugins/conform.nvim/run_tests.sh +++ b/config/neovim/store/lazy-plugins/conform.nvim/run_tests.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash set -e mkdir -p ".testenv/config/nvim" diff --git a/config/neovim/store/lazy-plugins/conform.nvim/scripts/generate.py b/config/neovim/store/lazy-plugins/conform.nvim/scripts/generate.py index 30c3b125..f471530b 100755 --- a/config/neovim/store/lazy-plugins/conform.nvim/scripts/generate.py +++ b/config/neovim/store/lazy-plugins/conform.nvim/scripts/generate.py @@ -26,6 +26,7 @@ README = os.path.join(ROOT, "README.md") DOC = os.path.join(ROOT, "doc") RECIPES = os.path.join(DOC, "recipes.md") ADVANCED = os.path.join(DOC, "advanced_topics.md") +DEBUGGING = os.path.join(DOC, "debugging.md") FORMATTER_OPTIONS = os.path.join(DOC, "formatter_options.md") VIMDOC = os.path.join(DOC, "conform.txt") OPTIONS = os.path.join(ROOT, "scripts", "options_doc.lua") @@ -143,21 +144,22 @@ def update_readme_toc(): ) -def update_recipes_toc(): +def update_tocs(): toc = ["\n"] + generate_md_toc(RECIPES) + ["\n"] replace_section(RECIPES, r"^$", r"^$", toc) subtoc = add_md_link_path("doc/recipes.md", toc) replace_section(README, r"^$", r"^$", subtoc) - -def update_advanced_toc(): toc = ["\n"] + generate_md_toc(ADVANCED) + ["\n"] replace_section(ADVANCED, r"^$", r"^$", toc) subtoc = add_md_link_path("doc/advanced_topics.md", toc) replace_section(README, r"^$", r"^$", subtoc) + toc = ["\n"] + generate_md_toc(DEBUGGING) + ["\n"] + replace_section(DEBUGGING, r"^$", r"^$", toc) + subtoc = add_md_link_path("doc/debugging.md", toc) + replace_section(README, r"^$", r"^$", subtoc) -def update_formatter_options_toc(): toc = ["\n"] + generate_md_toc(FORMATTER_OPTIONS) + ["\n"] replace_section(FORMATTER_OPTIONS, r"^$", r"^$", toc) subtoc = add_md_link_path("doc/formatter_options.md", toc) @@ -210,8 +212,6 @@ def main() -> None: update_autocmd_md() update_formatter_options_md() update_md_api() - update_recipes_toc() - update_advanced_toc() - update_formatter_options_toc() + update_tocs() update_readme_toc() generate_vimdoc() diff --git a/config/neovim/store/lazy-plugins/conform.nvim/tests/fake_formatter.sh b/config/neovim/store/lazy-plugins/conform.nvim/tests/fake_formatter.sh index 52b792a0..b311de50 100755 --- a/config/neovim/store/lazy-plugins/conform.nvim/tests/fake_formatter.sh +++ b/config/neovim/store/lazy-plugins/conform.nvim/tests/fake_formatter.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash set -e diff --git a/config/neovim/store/lazy-plugins/conform.nvim/tests/runner_spec.lua b/config/neovim/store/lazy-plugins/conform.nvim/tests/runner_spec.lua index 5d4fea4b..a7550ac0 100644 --- a/config/neovim/store/lazy-plugins/conform.nvim/tests/runner_spec.lua +++ b/config/neovim/store/lazy-plugins/conform.nvim/tests/runner_spec.lua @@ -1,5 +1,6 @@ require("plenary.async").tests.add_to_env() local conform = require("conform") +local fs = require("conform.fs") local runner = require("conform.runner") local test_util = require("tests.test_util") local util = require("conform.util") @@ -121,7 +122,7 @@ describe("runner", function() local config = assert(conform.get_formatter_config("test")) local ctx = runner.build_context(0, config) local cmd = runner.build_cmd("", ctx, config) - assert.are.same({ "echo", vim.api.nvim_buf_get_name(bufnr) }, cmd) + assert.are.same({ vim.fn.exepath("echo"), vim.api.nvim_buf_get_name(bufnr) }, cmd) end) it("replaces $DIRNAME in args", function() @@ -135,7 +136,10 @@ describe("runner", function() local config = assert(conform.get_formatter_config("test")) local ctx = runner.build_context(0, config) local cmd = runner.build_cmd("", ctx, config) - assert.are.same({ "echo", vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr)) }, cmd) + assert.are.same( + { vim.fn.exepath("echo"), vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr)) }, + cmd + ) end) it("resolves arg function", function() @@ -150,35 +154,7 @@ describe("runner", function() local config = assert(conform.get_formatter_config("test")) local ctx = runner.build_context(0, config) local cmd = runner.build_cmd("", ctx, config) - assert.are.same({ "echo", "--stdin" }, cmd) - end) - - it("replaces $FILENAME in string args", function() - vim.cmd.edit({ args = { "README.md" } }) - local bufnr = vim.api.nvim_get_current_buf() - conform.formatters.test = { - meta = { url = "", description = "" }, - command = "echo", - args = "$FILENAME | patch", - } - local config = assert(conform.get_formatter_config("test")) - local ctx = runner.build_context(0, config) - local cmd = runner.build_cmd("", ctx, config) - assert.equal("echo " .. vim.api.nvim_buf_get_name(bufnr) .. " | patch", cmd) - end) - - it("replaces $DIRNAME in string args", function() - vim.cmd.edit({ args = { "README.md" } }) - local bufnr = vim.api.nvim_get_current_buf() - conform.formatters.test = { - meta = { url = "", description = "" }, - command = "echo", - args = "$DIRNAME | patch", - } - local config = assert(conform.get_formatter_config("test")) - local ctx = runner.build_context(0, config) - local cmd = runner.build_cmd("", ctx, config) - assert.equal("echo " .. vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr)) .. " | patch", cmd) + assert.are.same({ vim.fn.exepath("echo"), "--stdin" }, cmd) end) it("resolves arg function with string results", function() @@ -193,7 +169,7 @@ describe("runner", function() local config = assert(conform.get_formatter_config("test")) local ctx = runner.build_context(0, config) local cmd = runner.build_cmd("", ctx, config) - assert.equal("echo | patch", cmd) + assert.are.same(util.shell_build_argv(vim.fn.exepath("echo") .. " | patch"), cmd) end) end) @@ -410,5 +386,22 @@ print("a") assert.are.same({ "a", "d", "c" }, vim.api.nvim_buf_get_lines(0, 0, -1, false)) end) end) + + it("can run the format command in the shell", function() + -- Mac echo doesn't seem to support -e, but the linux ci runner apparently doesn't have seq + if fs.is_mac then + conform.formatters.test = { + command = "seq", + args = "3 1 | sort", + } + run_formatter_test("", "1\n2\n3") + else + conform.formatters.test = { + command = "echo", + args = '-e "World\nHello" | sort', + } + run_formatter_test("", "Hello\nWorld") + end + end) end) end) diff --git a/config/neovim/store/lazy-plugins/conform.nvim/tests/util_spec.lua b/config/neovim/store/lazy-plugins/conform.nvim/tests/util_spec.lua new file mode 100644 index 00000000..9f1456cd --- /dev/null +++ b/config/neovim/store/lazy-plugins/conform.nvim/tests/util_spec.lua @@ -0,0 +1,72 @@ +local test_util = require("tests.test_util") +local util = require("conform.util") + +describe("util", function() + local shell = vim.o.shell + local shellcmdflag = vim.o.shellcmdflag + local shellxescape = vim.o.shellxescape + local shellxquote = vim.o.shellxquote + after_each(function() + test_util.reset_editor() + vim.o.shell = shell + vim.o.shellcmdflag = shellcmdflag + vim.o.shellxescape = shellxescape + vim.o.shellxquote = shellxquote + end) + + describe("shell_build_argv", function() + it("builds simple command", function() + vim.o.shell = "/bin/bash" + vim.o.shellcmdflag = "-c" + vim.o.shellxescape = "" + vim.o.shellxquote = "" + local argv = util.shell_build_argv("echo hello") + assert.are_same({ "/bin/bash", "-c", "echo hello" }, argv) + end) + + it("handles shell arguments", function() + vim.o.shell = "/bin/bash -f" + vim.o.shellcmdflag = "-c" + vim.o.shellxescape = "" + vim.o.shellxquote = "" + local argv = util.shell_build_argv("echo hello") + assert.are_same({ "/bin/bash", "-f", "-c", "echo hello" }, argv) + end) + + it("handles shell with spaces", function() + vim.o.shell = '"c:\\program files\\unix\\sh.exe"' + vim.o.shellcmdflag = "-c" + vim.o.shellxescape = "" + vim.o.shellxquote = "" + local argv = util.shell_build_argv("echo hello") + assert.are_same({ "c:\\program files\\unix\\sh.exe", "-c", "echo hello" }, argv) + end) + + it("handles shell with spaces and args", function() + vim.o.shell = '"c:\\program files\\unix\\sh.exe" -f' + vim.o.shellcmdflag = "-c" + vim.o.shellxescape = "" + vim.o.shellxquote = "" + local argv = util.shell_build_argv("echo hello") + assert.are_same({ "c:\\program files\\unix\\sh.exe", "-f", "-c", "echo hello" }, argv) + end) + + it("applies shellxquote", function() + vim.o.shell = "/bin/bash" + vim.o.shellcmdflag = "-c" + vim.o.shellxescape = "" + vim.o.shellxquote = "'" + local argv = util.shell_build_argv("echo hello") + assert.are_same({ "/bin/bash", "-c", "'echo hello'" }, argv) + end) + + it("uses shellxescape", function() + vim.o.shell = "/bin/bash" + vim.o.shellcmdflag = "-c" + vim.o.shellxescape = "el" + vim.o.shellxquote = "(" + local argv = util.shell_build_argv("echo hello") + assert.are_same({ "/bin/bash", "-c", "(^echo h^e^l^lo)" }, argv) + end) + end) +end) diff --git a/config/neovim/store/lazy-plugins/direnv.vim/autoload/direnv.vim b/config/neovim/store/lazy-plugins/direnv.vim/autoload/direnv.vim index 0c401c15..8713a9b4 100644 --- a/config/neovim/store/lazy-plugins/direnv.vim/autoload/direnv.vim +++ b/config/neovim/store/lazy-plugins/direnv.vim/autoload/direnv.vim @@ -4,7 +4,7 @@ scriptencoding utf-8 -let s:direnv_cmd = get(g:, 'direnv_cmd', '/nix/store/1mrvvx2ygfyfz8sn3gg5f3qidvd9s8j1-direnv-2.34.0/bin/direnv') +let s:direnv_cmd = get(g:, 'direnv_cmd', '/nix/store/823qi3acdfxnvn0ylygjg6jabx7b4q31-direnv-2.34.0/bin/direnv') let s:direnv_interval = get(g:, 'direnv_interval', 500) let s:direnv_max_wait = get(g:, 'direnv_max_wait', 5) let s:direnv_auto = get(g:, 'direnv_auto', 1) diff --git a/config/neovim/store/lazy-plugins/flash.nvim/scripts/docs b/config/neovim/store/lazy-plugins/flash.nvim/scripts/docs index cd1dbd97..9d3e90c1 100755 --- a/config/neovim/store/lazy-plugins/flash.nvim/scripts/docs +++ b/config/neovim/store/lazy-plugins/flash.nvim/scripts/docs @@ -1,3 +1,3 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash nvim -u tests/minit.lua -l lua/flash/docs.lua diff --git a/config/neovim/store/lazy-plugins/flash.nvim/scripts/test b/config/neovim/store/lazy-plugins/flash.nvim/scripts/test index 0bc1a330..d66f84a6 100755 --- a/config/neovim/store/lazy-plugins/flash.nvim/scripts/test +++ b/config/neovim/store/lazy-plugins/flash.nvim/scripts/test @@ -1,3 +1,3 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash nvim -l tests/minit.lua --minitest diff --git a/config/neovim/store/lazy-plugins/git-messenger.vim/.github/workflows/ci.yml b/config/neovim/store/lazy-plugins/git-messenger.vim/.github/workflows/ci.yml index 813a5785..74c82402 100644 --- a/config/neovim/store/lazy-plugins/git-messenger.vim/.github/workflows/ci.yml +++ b/config/neovim/store/lazy-plugins/git-messenger.vim/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: version: nightly runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set Git user for running Git commands in unit tests run: | git config --global user.email "users@noreply.github.com" @@ -23,7 +23,7 @@ jobs: - name: Fetch Git history for unit tests run: git fetch --no-tags --prune --unshallow - name: Checkout themis.vim - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: thinca/vim-themis path: vim-themis @@ -37,17 +37,17 @@ jobs: THEMIS_VIM: ${{ steps.vim.outputs.executable }} THEMIS_PROFILE: profile.txt run: ./vim-themis/bin/themis ./test/all.vimspec - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v5 + with: + python-version: '3' - name: Report coverage run: | - # https://github.com/Vimjas/covimerage/issues/95 - pip install 'click<8.0.0' pip install covimerage covimerage write_coverage profile.txt coverage report coverage xml - name: Upload coverage to codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -58,7 +58,7 @@ jobs: neovim: [true, false] runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set Git user for running Git commands in unit tests run: | git config --global user.email "users@noreply.github.com" @@ -66,7 +66,7 @@ jobs: - name: Fetch Git history for unit tests run: git fetch --no-tags --prune --unshallow - name: Checkout themis.vim - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: thinca/vim-themis path: vim-themis @@ -84,7 +84,9 @@ jobs: name: Run vint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 - - run: pip install vim-vint + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3' + - run: pip install setuptools vim-vint - run: vint --warning --verbose --enable-neovim ./autoload ./plugin diff --git a/config/neovim/store/lazy-plugins/git-messenger.vim/README.md b/config/neovim/store/lazy-plugins/git-messenger.vim/README.md index 9b21d091..9fc57759 100644 --- a/config/neovim/store/lazy-plugins/git-messenger.vim/README.md +++ b/config/neovim/store/lazy-plugins/git-messenger.vim/README.md @@ -348,8 +348,8 @@ On Vim, please install [vim-healthcheck](https://github.com/rhysd/vim-healthchec Distributed under [the MIT License](LICENSE) [repo]: https://github.com/rhysd/git-messenger.vim -[ci-badge]: https://github.com/rhysd/git-messenger.vim/workflows/CI/badge.svg?branch=master&event=push -[ci]: https://github.com/rhysd/git-messenger.vim/actions?query=workflow%3ACI+branch%3Amaster +[ci-badge]: https://github.com/rhysd/git-messenger.vim/actions/workflows/ci.yml/badge.svg +[ci]: https://github.com/rhysd/git-messenger.vim/actions/workflows/ci.yml [codecov]: https://codecov.io/gh/rhysd/git-messenger.vim [codecov-badge]: https://codecov.io/gh/rhysd/git-messenger.vim/branch/master/graph/badge.svg [doc]: ./doc/git-messenger.txt diff --git a/config/neovim/store/lazy-plugins/git-messenger.vim/autoload/health/gitmessenger.vim b/config/neovim/store/lazy-plugins/git-messenger.vim/autoload/health/gitmessenger.vim index bbc9b77e..c3bad86a 100644 --- a/config/neovim/store/lazy-plugins/git-messenger.vim/autoload/health/gitmessenger.vim +++ b/config/neovim/store/lazy-plugins/git-messenger.vim/autoload/health/gitmessenger.vim @@ -1,8 +1,34 @@ +if has('nvim') + function! s:report_error(msg, ...) abort + if a:0 ==# 0 + call v:lua.vim.health.error(a:msg) + else + call v:lua.vim.health.error(a:msg, a:1) + endif + endfunction + function! s:report_warn(msg, note) abort + call v:lua.vim.health.warn(a:msg, a:note) + endfunction + function! s:report_ok(msg) abort + call v:lua.vim.health.ok(a:msg) + endfunction +else + function! s:report_error(msg) abort + call health#report_error(a:msg) + endfunction + function! s:report_warn(msg, note) abort + call health#report_warn(a:msg, a:note) + endfunction + function! s:report_ok(msg) abort + call health#report_ok(a:msg) + endfunction +endif + function! s:check_job() abort if !has('nvim') && !has('job') - call health#report_error('Not supported since +job feature is not enabled') + call s:report_error('Not supported since +job feature is not enabled') else - call health#report_ok('+job is available to execute Git command') + call s:report_ok('+job is available to execute Git command') endif endfunction @@ -12,7 +38,7 @@ function! s:check_floating_window() abort endif if !exists('*nvim_win_set_config') - call health#report_warn( + call s:report_warn( \ 'Neovim 0.3.0 or earlier does not support floating window feature. Preview window is used instead', \ 'Please install Neovim 0.4.0 or later') return @@ -29,7 +55,7 @@ function! s:check_floating_window() abort \ }) noautocmd call nvim_win_close(win_id, v:true) catch /^Vim\%((\a\+)\)\=:E118/ - call health#report_error( + call s:report_error( \ 'Your Neovim is too old', \ [ \ 'Please update Neovim to 0.4.0 or later', @@ -38,23 +64,23 @@ function! s:check_floating_window() abort return endtry - call health#report_ok('Floating window is available for popup window') + call s:report_ok('Floating window is available for popup window') endfunction function! s:check_git_binary() abort let cmd = get(g:, 'git_messenger_git_command', 'git') if !executable(cmd) - call health#report_error('`' . cmd . '` command is not found. Please set proper command to g:git_messenger_git_command') + call s:report_error('`' . cmd . '` command is not found. Please set proper command to g:git_messenger_git_command') return endif let output = substitute(system(cmd . ' -C . --version'), '\r\=\n', '', 'g') if v:shell_error - call health#report_error('Git command `' . cmd . '` is broken (v1.8.5 or later is required): ' . output) + call s:report_error('Git command `' . cmd . '` is broken (v1.8.5 or later is required): ' . output) return endif - call health#report_ok('Git command `' . cmd . '` is available: ' . output) + call s:report_ok('Git command `' . cmd . '` is available: ' . output) endfunction function! s:check_vim_version() abort @@ -63,13 +89,13 @@ function! s:check_vim_version() abort endif if v:version < 800 - call health#report_error( + call s:report_error( \ 'Your Vim version is too old: ' . v:version, \ 'Please install Vim 8.0 or later') return endif - call health#report_ok('Vim version is fine: ' . v:version) + call s:report_error('Vim version is fine: ' . v:version) endfunction function! health#gitmessenger#check() abort diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/doc/gitsigns.txt b/config/neovim/store/lazy-plugins/gitsigns.nvim/doc/gitsigns.txt index 1e6d35b9..bf5bacb1 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/doc/gitsigns.txt +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/doc/gitsigns.txt @@ -67,6 +67,7 @@ of the default settings: delay = 1000, ignore_whitespace = false, virt_text_priority = 100, + use_focus = true, }, current_line_blame_formatter = ', - ', sign_priority = 6, @@ -821,6 +822,7 @@ current_line_blame_opts *gitsigns-config-current_line_blame_opts* Default: > `{ delay = 1000, + use_focus = true, virt_text = true, virt_text_pos = "eol", virt_text_priority = 100 @@ -844,6 +846,8 @@ current_line_blame_opts *gitsigns-config-current_line_blame_opts* Ignore whitespace when running blame. • virt_text_priority: integer Priority of virtual text. + • use_focus: boolean + Enable only when buffer is in focus • extra_opts: string[] Extra options passed to `git-blame`. diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-08-04-rocks/gitsigns.nvim/scm-1/doc/gitsigns.txt b/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-09-04-rocks/gitsigns.nvim/scm-1/doc/gitsigns.txt similarity index 99% rename from config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-08-04-rocks/gitsigns.nvim/scm-1/doc/gitsigns.txt rename to config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-09-04-rocks/gitsigns.nvim/scm-1/doc/gitsigns.txt index 1e6d35b9..bf5bacb1 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-08-04-rocks/gitsigns.nvim/scm-1/doc/gitsigns.txt +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-09-04-rocks/gitsigns.nvim/scm-1/doc/gitsigns.txt @@ -67,6 +67,7 @@ of the default settings: delay = 1000, ignore_whitespace = false, virt_text_priority = 100, + use_focus = true, }, current_line_blame_formatter = ', - ', sign_priority = 6, @@ -821,6 +822,7 @@ current_line_blame_opts *gitsigns-config-current_line_blame_opts* Default: > `{ delay = 1000, + use_focus = true, virt_text = true, virt_text_pos = "eol", virt_text_priority = 100 @@ -844,6 +846,8 @@ current_line_blame_opts *gitsigns-config-current_line_blame_opts* Ignore whitespace when running blame. • virt_text_priority: integer Priority of virtual text. + • use_focus: boolean + Enable only when buffer is in focus • extra_opts: string[] Extra options passed to `git-blame`. diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-08-04-rocks/gitsigns.nvim/scm-1/gitsigns.nvim-scm-1.rockspec b/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-09-04-rocks/gitsigns.nvim/scm-1/gitsigns.nvim-scm-1.rockspec similarity index 100% rename from config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-08-04-rocks/gitsigns.nvim/scm-1/gitsigns.nvim-scm-1.rockspec rename to config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-09-04-rocks/gitsigns.nvim/scm-1/gitsigns.nvim-scm-1.rockspec diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-08-04-rocks/gitsigns.nvim/scm-1/rock_manifest b/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-09-04-rocks/gitsigns.nvim/scm-1/rock_manifest similarity index 75% rename from config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-08-04-rocks/gitsigns.nvim/scm-1/rock_manifest rename to config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-09-04-rocks/gitsigns.nvim/scm-1/rock_manifest index fcdb7cf9..a20ff0dc 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-08-04-rocks/gitsigns.nvim/scm-1/rock_manifest +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-09-04-rocks/gitsigns.nvim/scm-1/rock_manifest @@ -1,21 +1,21 @@ rock_manifest = { doc = { - ["gitsigns.txt"] = "ed2c2a9eac117833753afc9dd55adcf4" + ["gitsigns.txt"] = "701ffdce0c14beaede62a3d0e551c7a8" }, ["gitsigns.nvim-scm-1.rockspec"] = "a9b165d604ce401cfeea760a9366418d", lua = { gitsigns = { - ["actions.lua"] = "ac0661d45e50424f5f59924528b1c031", - ["async.lua"] = "ab34c767e5b6c917335d19f2acc6fd36", + ["actions.lua"] = "395d48d459147a4505ec15bd9c7f4f49", + ["async.lua"] = "9c3d111da582ae7eef17c64ce2519a2a", ["attach.lua"] = "44664690d66389b4487d934ebcad98e6", ["blame.lua"] = "05feea95e221a2409a8d44334c47529f", - ["cache.lua"] = "523c72aa06168f06b3ecd34fd04cbe9d", + ["cache.lua"] = "b48aea0d367198dc603ab7775513fe87", cli = { ["argparse.lua"] = "fb6c9ffda01b2090f3c252ecaf00f68a" }, ["cli.lua"] = "00273191aa1ca467c5edbd9531f8fd9d", - ["config.lua"] = "8743742b5a5b0a0713f0352ff4e88db0", - ["current_line_blame.lua"] = "48e477d836e39ab98e58c2b027dd9db8", + ["config.lua"] = "d2e4c0fb951edf984cf534f7d0e90bfd", + ["current_line_blame.lua"] = "660345d06ddf374bf8fdde0ee2200634", ["debounce.lua"] = "5a28036b5ac45c1f93f9883b855e564f", debug = { ["log.lua"] = "f7e994b68e9cbcf91adfeb5bc379d7b1" @@ -27,14 +27,14 @@ rock_manifest = { ["diffthis.lua"] = "aaac58016e9982bb14e942f9e4e24c52", git = { ["blame.lua"] = "e779f4344bcc41cdb92c1a1be5eb2815", - ["cmd.lua"] = "449c03c67b7ae516babc41d6da0dc66e", - ["repo.lua"] = "1efe3178f64b77e0fc22cad55d9586a0", + ["cmd.lua"] = "87e37bb8fd03083a530970eb4d6943c8", + ["repo.lua"] = "8db0a2c7d221ae5ba42db2b8ef24492d", ["version.lua"] = "068a582ed4565978eb1f6eb089a6fa6c" }, - ["git.lua"] = "0d3e8859ff8cf7ebd3beb739b64a8c49", + ["git.lua"] = "1b97799c57ef1392c67c2d9599da509b", ["highlight.lua"] = "f0bf039b629818fbfae8a6fad161f9a2", ["hunks.lua"] = "ee058ee8b056b055cd8404460ca6921f", - ["manager.lua"] = "f6e7e2430f2f28a4dbcfd2479f2c8480", + ["manager.lua"] = "394b58f67de90f8138453061eca03d4d", ["message.lua"] = "523ee4df9da4a7fa9b5ab2100eb27ac4", ["popup.lua"] = "2fcf3052f95d81cb5c0bb04ca4e06aae", ["repeat.lua"] = "798544de97c774bc8e10eecfd6479585", diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-08-04-rocks/manifest b/config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-09-04-rocks/manifest similarity index 100% rename from config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-08-04-rocks/manifest rename to config/neovim/store/lazy-plugins/gitsigns.nvim/gitsigns.nvim-scm-1-unstable-2024-09-04-rocks/manifest diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/actions.lua b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/actions.lua index a019af84..e831d15d 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/actions.lua +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/actions.lua @@ -275,6 +275,11 @@ M.stage_hunk = mk_repeatable(async.create(2, function(range, opts) return end + if bcache:locked() then + print('Error: busy') + return + end + if not util.path_exists(bcache.file) then print('Error: Cannot stage lines. Please add the file to the working tree.') return @@ -294,7 +299,6 @@ M.stage_hunk = mk_repeatable(async.create(2, function(range, opts) end bcache.git_obj:stage_hunks({ hunk }, invert) - table.insert(bcache.staged_diffs, hunk) bcache:invalidate(true) @@ -397,6 +401,11 @@ M.undo_stage_hunk = async.create(function() return end + if bcache:locked() then + print('Error: busy') + return + end + local hunk = table.remove(bcache.staged_diffs) if not hunk then print('No hunks to undo') @@ -419,6 +428,11 @@ M.stage_buffer = async.create(function() return end + if bcache:locked() then + print('Error: busy') + return + end + -- Only process files with existing hunks local hunks = bcache.hunks if not hunks or #hunks == 0 then @@ -454,6 +468,11 @@ M.reset_buffer_index = async.create(function() return end + if bcache:locked() then + print('Error: busy') + return + end + -- `bcache.staged_diffs` won't contain staged changes outside of current -- neovim session so signs added from this unstage won't be complete They will -- however be fixed by gitdir watcher and properly updated We should implement @@ -463,7 +482,6 @@ M.reset_buffer_index = async.create(function() bcache.staged_diffs = {} bcache.git_obj:unstage_file() - bcache:invalidate(true) update(bufnr) end) @@ -551,6 +569,9 @@ local function get_nav_hunks(bufnr, target, greedy) if target == 'all' then hunks = hunks_main vim.list_extend(hunks, hunks_head) + table.sort(hunks, function(h1, h2) + return h1.added.start < h2.added.start + end) elseif target == 'staged' then hunks = hunks_head end diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/async.lua b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/async.lua index 5b6a42b4..b116d219 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/async.lua +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/async.lua @@ -69,27 +69,37 @@ function Async_T:is_cancelled() end --- @param func function +--- @param protected boolean --- @param callback? fun(...: any) --- @param ... any --- @return Gitsigns.Async_T -local function run(func, callback, ...) +local function run(func, protected, callback, ...) local co = coroutine.create(func) local handle = Async_T.new(co) + if protected then + assert(type(callback) == 'function') + end + local function step(...) local ret = { coroutine.resume(co, ...) } local stat = ret[1] if not stat then - local err = ret[2] --[[@as string]] - error( - string.format('The coroutine failed with this message: %s\n%s', err, debug.traceback(co)) - ) + local co_err = ret[2] --- @type string + local err = debug.traceback(co, string.format('The async coroutine failed: %s', co_err)) + if protected then + --- @cast callback -nil + callback(false, err) + else + error(err) + end end if coroutine.status(co) == 'dead' then if callback then - callback(unpack(ret, 2, table.maxn(ret))) + -- Include status if protected + callback(unpack(ret, protected and 1 or 2, table.maxn(ret))) end return end @@ -99,13 +109,21 @@ local function run(func, callback, ...) assert(type(fn) == 'function', 'type error :: expected func') - local args = { select(4, unpack(ret)) } + --- @type any[] + local args = { unpack(ret, 4, table.maxn(ret)) } args[nargs] = step - local r = fn(unpack(args, 1, nargs)) - if is_Async_T(r) then - --- @cast r Gitsigns.Async_T - handle._current = r + if protected then + --- @cast callback -nil + xpcall(fn, function(err) + callback(false, string.format('The wrapped function failed: %s', err)) + end, unpack(args, 1, nargs)) + else + local r = fn(unpack(args, 1, nargs)) + if is_Async_T(r) then + --- @cast r Gitsigns.Async_T + handle._current = r + end end end @@ -182,7 +200,7 @@ function M.create(argc_or_func, func) return function(...) local callback = argc and select(argc + 1, ...) or nil assert(not callback or type(callback) == 'function') - return run(func, callback, unpack({ ... }, 1, argc)) + return run(func, false, callback, unpack({ ... }, 1, argc)) end end @@ -191,7 +209,16 @@ end M.scheduler = M.wrap(1, vim.schedule) function M.run(func, ...) - return run(func, nil, ...) + return run(func, false, nil, ...) +end + +--- @param func fun() +--- @return boolean stat +--- @return string? err +function M.pcall(func) + return M.wait(1, function(cb) + run(func, true, cb) + end) end return M diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/cache.lua b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/cache.lua index 9934aad3..7af3bc3a 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/cache.lua +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/cache.lua @@ -20,6 +20,8 @@ local M = { --- @field gitdir_watcher? uv.uv_fs_event_t --- @field git_obj Gitsigns.GitObj --- @field blame? table +--- +--- @field update_lock? true Update in progress local CacheEntry = M.CacheEntry function CacheEntry:get_rev_bufname(rev, nofile) @@ -30,6 +32,10 @@ function CacheEntry:get_rev_bufname(rev, nofile) return string.format('gitsigns://%s//%s:%s', self.git_obj.repo.gitdir, rev, self.git_obj.relpath) end +function CacheEntry:locked() + return self.git_obj.lock or self.update_lock or false +end + --- Invalidate any state dependent on the buffer content. --- If 'all' is passed, then invalidate everything. --- @param all? boolean diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/config.lua b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/config.lua index 0d92a713..622cd8cc 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/config.lua +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/config.lua @@ -42,6 +42,7 @@ --- @field virt_text_pos? 'eol'|'overlay'|'right_align' --- @field delay? integer --- @field virt_text_priority? integer +--- @field use_focus? boolean --- @class (exact) Gitsigns.BlameOpts --- @field ignore_whitespace? boolean @@ -680,6 +681,7 @@ M.schema = { virt_text_pos = 'eol', virt_text_priority = 100, delay = 1000, + use_focus = true, }, description = [[ Options for the current line blame annotation. @@ -700,6 +702,8 @@ M.schema = { Ignore whitespace when running blame. • virt_text_priority: integer Priority of virtual text. + • use_focus: boolean + Enable only when buffer is in focus • extra_opts: string[] Extra options passed to `git-blame`. ]], diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/current_line_blame.lua b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/current_line_blame.lua index 1f56454c..94b0b550 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/current_line_blame.lua +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/current_line_blame.lua @@ -225,13 +225,18 @@ function M.setup() -- show current buffer line blame immediately M.update(api.nvim_get_current_buf()) - local events = { 'FocusGained', 'BufEnter', 'CursorMoved', 'CursorMovedI' } + local update_events = { 'BufEnter', 'CursorMoved', 'CursorMovedI' } + local reset_events = { 'InsertEnter', 'BufLeave' } if vim.fn.exists('#WinResized') == 1 then -- For nvim 0.9+ - events[#events + 1] = 'WinResized' + update_events[#update_events + 1] = 'WinResized' + end + if opts.use_focus then + update_events[#update_events + 1] = 'FocusGained' + reset_events[#reset_events + 1] = 'FocusLost' end - api.nvim_create_autocmd(events, { + api.nvim_create_autocmd(update_events, { group = group, callback = function(args) reset(args.buf) @@ -239,7 +244,7 @@ function M.setup() end, }) - api.nvim_create_autocmd({ 'InsertEnter', 'FocusLost', 'BufLeave' }, { + api.nvim_create_autocmd(reset_events, { group = group, callback = function(args) reset(args.buf) diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git.lua b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git.lua index 00beacb7..bec3d355 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git.lua +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git.lua @@ -1,4 +1,5 @@ local log = require('gitsigns.debug.log') +local async = require('gitsigns.async') local util = require('gitsigns.util') local Repo = require('gitsigns.git.repo') @@ -31,6 +32,8 @@ end --- @field orig_relpath? string Use for tracking moved files --- @field repo Gitsigns.Repo --- @field has_conflicts? boolean +--- +--- @field lock? true local Obj = {} M.Obj = Obj @@ -61,12 +64,14 @@ function M.diff(file_cmp, file_buf, indent_heuristic, diff_algo) }) end +--- @async --- @param revision? string function Obj:update_revision(revision) self.revision = util.norm_base(revision) self:update() end +--- @async --- @param update_relpath? boolean --- @param silent? boolean --- @return boolean @@ -98,6 +103,7 @@ function Obj:from_tree() return self.revision and not vim.startswith(self.revision, ':') end +--- @async --- @param file? string --- @param silent? boolean --- @return Gitsigns.FileInfo @@ -110,6 +116,7 @@ function Obj:file_info(file, silent) end --- @private +--- @async --- Get information about files in the index and the working tree --- @param file? string --- @param silent? boolean @@ -177,6 +184,7 @@ function Obj:file_info_index(file, silent) end --- @private +--- @async --- Get information about files in a certain revision --- @param file? string --- @param silent? boolean @@ -213,6 +221,7 @@ function Obj:file_info_tree(file, silent) } end +--- @async --- @param revision? string --- @return string[] stdout, string? stderr function Obj:get_show_text(revision) @@ -251,11 +260,15 @@ local function autocmd_changed(file) end) end +--- @async function Obj:unstage_file() + self.lock = true self.repo:command({ 'reset', self.file }) + self.lock = nil autocmd_changed(self.file) end +--- @async --- @param lines string[] --- @param lnum? integer --- @param revision? string @@ -265,28 +278,33 @@ function Obj:run_blame(lines, lnum, revision, opts) return require('gitsigns.git.blame').run_blame(self, lines, lnum, revision, opts) end ---- @param obj Gitsigns.GitObj -local function ensure_file_in_index(obj) - if obj.object_name and not obj.has_conflicts then +--- @async +--- @private +function Obj:ensure_file_in_index() + self.lock = true + if self.object_name and not self.has_conflicts then return end - if not obj.object_name then + if not self.object_name then -- If there is no object_name then it is not yet in the index so add it - obj.repo:command({ 'add', '--intent-to-add', obj.file }) + self.repo:command({ 'add', '--intent-to-add', self.file }) else -- Update the index with the common ancestor (stage 1) which is what bcache -- stores - local info = string.format('%s,%s,%s', obj.mode_bits, obj.object_name, obj.relpath) - obj.repo:command({ 'update-index', '--add', '--cacheinfo', info }) + local info = string.format('%s,%s,%s', self.mode_bits, self.object_name, self.relpath) + self.repo:command({ 'update-index', '--add', '--cacheinfo', info }) end - obj:update() + self:update() + self.lock = nil end +--- @async --- Stage 'lines' as the entire contents of the file --- @param lines string[] function Obj:stage_lines(lines) + self.lock = true local new_object = self.repo:command({ 'hash-object', '-w', @@ -301,13 +319,20 @@ function Obj:stage_lines(lines) string.format('%s,%s,%s', self.mode_bits, new_object, self.relpath), }) + self.lock = nil autocmd_changed(self.file) end +local sleep = async.wrap(2, function(duration, cb) + vim.defer_fn(cb, duration) +end) + +--- @async --- @param hunks Gitsigns.Hunk.Hunk[] --- @param invert? boolean function Obj:stage_hunks(hunks, invert) - ensure_file_in_index(self) + self.lock = true + self:ensure_file_in_index() local patch = require('gitsigns.hunks').create_patch(self.relpath, hunks, self.mode_bits, invert) @@ -318,19 +343,32 @@ function Obj:stage_hunks(hunks, invert) end end - self.repo:command({ - 'apply', - '--whitespace=nowarn', - '--cached', - '--unidiff-zero', - '-', - }, { - stdin = patch, - }) + local stat, err = async.pcall(function() + self.repo:command({ + 'apply', + '--whitespace=nowarn', + '--cached', + '--unidiff-zero', + '-', + }, { + stdin = patch, + }) + end) + if not stat then + self.lock = nil + error(err) + end + + -- Staging operations cause IO of the git directory so wait some time + -- for the changes to settle. + sleep(100) + + self.lock = nil autocmd_changed(self.file) end +--- @async --- @return string? function Obj:has_moved() local out = self.repo:command({ 'diff', '--name-status', '-C', '--cached' }) @@ -349,6 +387,7 @@ function Obj:has_moved() end end +--- @async --- @param file string --- @param revision string? --- @param encoding string diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git/cmd.lua b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git/cmd.lua index 6ec0b4ae..d43886ee 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git/cmd.lua +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git/cmd.lua @@ -12,7 +12,7 @@ local asystem = async.wrap(3, system) --- @async --- @param args string[] --- @param spec? Gitsigns.Git.JobSpec ---- @return string[] stdout, string? stderr +--- @return string[] stdout, string? stderr, integer code local function git_command(args, spec) spec = spec or {} @@ -66,7 +66,7 @@ local function git_command(args, spec) obj.stderr = nil end - return stdout_lines, obj.stderr + return stdout_lines, obj.stderr, obj.code end return git_command diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git/repo.lua b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git/repo.lua index 2bd61160..bc33adbd 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git/repo.lua +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/git/repo.lua @@ -81,6 +81,7 @@ local function iconv_supported(encoding) return true end +--- @async --- Get version of file in the index, return array lines --- @param object string --- @param encoding? string @@ -99,9 +100,9 @@ end --- @async function M:update_abbrev_head() - local info = M.get_info(self.toplevel) + local info, err = M.get_info(self.toplevel) if not info then - log.eprintf('Could not get info for repo at %s', self.gitdir) + log.eprintf('Could not get info for repo at %s: %s', self.gitdir, err or '') return end self.abbrev_head = info.abbrev_head @@ -211,7 +212,7 @@ end --- @param cwd string --- @param gitdir? string --- @param toplevel? string ---- @return Gitsigns.RepoInfo? +--- @return Gitsigns.RepoInfo? info, string? err function M.get_info(cwd, gitdir, toplevel) -- Does git rev-parse have --absolute-git-dir, added in 2.13: -- https://public-inbox.org/git/20170203024829.8071-16-szeder.dev@gmail.com/ @@ -238,13 +239,13 @@ function M.get_info(cwd, gitdir, toplevel) 'HEAD', }) - local stdout = git_command(args, { + local stdout, stderr, code = git_command(args, { ignore_error = true, cwd = toplevel or cwd, }) - if not stdout[1] then - return + if code > 0 then + return nil, string.format('got stderr: %s', stderr or '') end local toplevel_r = normalize_path(stdout[1]) diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/manager.lua b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/manager.lua index 44c836fe..d1cce707 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/manager.lua +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/lua/gitsigns/manager.lua @@ -448,6 +448,8 @@ M.update = throttle_by_id(function(bufnr) return end local bcache = assert(cache[bufnr]) + bcache.update_lock = true + local old_hunks, old_hunks_staged = bcache.hunks, bcache.hunks_staged bcache.hunks, bcache.hunks_staged = nil, nil @@ -505,6 +507,7 @@ M.update = throttle_by_id(function(bufnr) summary.head = git_obj.repo.abbrev_head Status:update(bufnr, summary) end + bcache.update_lock = nil end, true) --- @param bufnr integer diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/nix-support/propagated-build-inputs b/config/neovim/store/lazy-plugins/gitsigns.nvim/nix-support/propagated-build-inputs index 62cc882a..8766e61e 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/nix-support/propagated-build-inputs +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/nix-support/propagated-build-inputs @@ -1 +1 @@ -/nix/store/rn8bzg423wwkayzbsbmhmvcgjmbzrq5z-lua-5.1.5 \ No newline at end of file +/nix/store/k55zni8plmbwkbv9l6ds65p981ndxk7x-lua-5.1.5 \ No newline at end of file diff --git a/config/neovim/store/lazy-plugins/gitsigns.nvim/rock_manifest b/config/neovim/store/lazy-plugins/gitsigns.nvim/rock_manifest index fcdb7cf9..a20ff0dc 100644 --- a/config/neovim/store/lazy-plugins/gitsigns.nvim/rock_manifest +++ b/config/neovim/store/lazy-plugins/gitsigns.nvim/rock_manifest @@ -1,21 +1,21 @@ rock_manifest = { doc = { - ["gitsigns.txt"] = "ed2c2a9eac117833753afc9dd55adcf4" + ["gitsigns.txt"] = "701ffdce0c14beaede62a3d0e551c7a8" }, ["gitsigns.nvim-scm-1.rockspec"] = "a9b165d604ce401cfeea760a9366418d", lua = { gitsigns = { - ["actions.lua"] = "ac0661d45e50424f5f59924528b1c031", - ["async.lua"] = "ab34c767e5b6c917335d19f2acc6fd36", + ["actions.lua"] = "395d48d459147a4505ec15bd9c7f4f49", + ["async.lua"] = "9c3d111da582ae7eef17c64ce2519a2a", ["attach.lua"] = "44664690d66389b4487d934ebcad98e6", ["blame.lua"] = "05feea95e221a2409a8d44334c47529f", - ["cache.lua"] = "523c72aa06168f06b3ecd34fd04cbe9d", + ["cache.lua"] = "b48aea0d367198dc603ab7775513fe87", cli = { ["argparse.lua"] = "fb6c9ffda01b2090f3c252ecaf00f68a" }, ["cli.lua"] = "00273191aa1ca467c5edbd9531f8fd9d", - ["config.lua"] = "8743742b5a5b0a0713f0352ff4e88db0", - ["current_line_blame.lua"] = "48e477d836e39ab98e58c2b027dd9db8", + ["config.lua"] = "d2e4c0fb951edf984cf534f7d0e90bfd", + ["current_line_blame.lua"] = "660345d06ddf374bf8fdde0ee2200634", ["debounce.lua"] = "5a28036b5ac45c1f93f9883b855e564f", debug = { ["log.lua"] = "f7e994b68e9cbcf91adfeb5bc379d7b1" @@ -27,14 +27,14 @@ rock_manifest = { ["diffthis.lua"] = "aaac58016e9982bb14e942f9e4e24c52", git = { ["blame.lua"] = "e779f4344bcc41cdb92c1a1be5eb2815", - ["cmd.lua"] = "449c03c67b7ae516babc41d6da0dc66e", - ["repo.lua"] = "1efe3178f64b77e0fc22cad55d9586a0", + ["cmd.lua"] = "87e37bb8fd03083a530970eb4d6943c8", + ["repo.lua"] = "8db0a2c7d221ae5ba42db2b8ef24492d", ["version.lua"] = "068a582ed4565978eb1f6eb089a6fa6c" }, - ["git.lua"] = "0d3e8859ff8cf7ebd3beb739b64a8c49", + ["git.lua"] = "1b97799c57ef1392c67c2d9599da509b", ["highlight.lua"] = "f0bf039b629818fbfae8a6fad161f9a2", ["hunks.lua"] = "ee058ee8b056b055cd8404460ca6921f", - ["manager.lua"] = "f6e7e2430f2f28a4dbcfd2479f2c8480", + ["manager.lua"] = "394b58f67de90f8138453061eca03d4d", ["message.lua"] = "523ee4df9da4a7fa9b5ab2100eb27ac4", ["popup.lua"] = "2fcf3052f95d81cb5c0bb04ca4e06aae", ["repeat.lua"] = "798544de97c774bc8e10eecfd6479585", diff --git a/config/neovim/store/lazy-plugins/haskell-tools.nvim/nix-support/propagated-build-inputs b/config/neovim/store/lazy-plugins/haskell-tools.nvim/nix-support/propagated-build-inputs index 62cc882a..8766e61e 100644 --- a/config/neovim/store/lazy-plugins/haskell-tools.nvim/nix-support/propagated-build-inputs +++ b/config/neovim/store/lazy-plugins/haskell-tools.nvim/nix-support/propagated-build-inputs @@ -1 +1 @@ -/nix/store/rn8bzg423wwkayzbsbmhmvcgjmbzrq5z-lua-5.1.5 \ No newline at end of file +/nix/store/k55zni8plmbwkbv9l6ds65p981ndxk7x-lua-5.1.5 \ No newline at end of file diff --git a/config/neovim/store/lazy-plugins/lazygit.nvim/README.md b/config/neovim/store/lazy-plugins/lazygit.nvim/README.md index bd774c1a..7d681553 100644 --- a/config/neovim/store/lazy-plugins/lazygit.nvim/README.md +++ b/config/neovim/store/lazy-plugins/lazygit.nvim/README.md @@ -187,9 +187,6 @@ os: The Telescope plugin is used to track all git repository visited in one nvim session. -![lazygittelplugin](https://user-images.githubusercontent.com/10464534/156933468-c89abee4-6afb-457c-8b02-55b67913aef2.png) -(background image is not included :smirk:) - **Why a telescope Plugin** ? Assuming you have one or more submodule(s) in your project and you want to commit changes in both the submodule(s) diff --git a/config/neovim/store/lazy-plugins/lualine.nvim/lua/lualine_require.lua b/config/neovim/store/lazy-plugins/lualine.nvim/lua/lualine_require.lua index 968e9af1..a4a369b5 100644 --- a/config/neovim/store/lazy-plugins/lualine.nvim/lua/lualine_require.lua +++ b/config/neovim/store/lazy-plugins/lualine.nvim/lua/lualine_require.lua @@ -54,16 +54,17 @@ function M.require(module) end pattern_path = table.concat { 'lua/', module:gsub('%.', '/'), '.lua' } - local paths = vim.api.nvim_get_runtime_file(pattern_path, false) + local paths = vim.api.nvim_get_runtime_file(pattern_path, true) if #paths <= 0 then pattern_path = table.concat { 'lua/', module:gsub('%.', '/'), '/init.lua' } - paths = vim.api.nvim_get_runtime_file(pattern_path, false) + paths = vim.api.nvim_get_runtime_file(pattern_path, true) end if #paths > 0 then -- put entries from user config path in front local user_config_path = vim.fn.stdpath('config') table.sort(paths, function(a, b) - return vim.startswith(a, user_config_path) or not vim.startswith(b, user_config_path) + local pattern = table.concat { user_config_path, M.sep } + return string.match(a, pattern) or not string.match(b, pattern) end) local mod_result = dofile(paths[1]) package.loaded[module] = mod_result diff --git a/config/neovim/store/lazy-plugins/luasnip/doc/luasnip.txt b/config/neovim/store/lazy-plugins/luasnip/doc/luasnip.txt index 91a9d88f..0bcbe40c 100644 --- a/config/neovim/store/lazy-plugins/luasnip/doc/luasnip.txt +++ b/config/neovim/store/lazy-plugins/luasnip/doc/luasnip.txt @@ -1,4 +1,4 @@ -*luasnip.txt* For NVIM v0.8.0 Last change: 2024 August 01 +*luasnip.txt* For NVIM v0.8.0 Last change: 2024 August 28 ============================================================================== Table of Contents *luasnip-table-of-contents* @@ -60,10 +60,11 @@ Table of Contents *luasnip-table-of-contents* 26. Cleanup |luasnip-cleanup| 27. Logging |luasnip-logging| 28. Source |luasnip-source| -29. Config-Options |luasnip-config-options| -30. Troubleshooting |luasnip-troubleshooting| +29. Selection |luasnip-selection| +30. Config-Options |luasnip-config-options| +31. Troubleshooting |luasnip-troubleshooting| - Adding Snippets |luasnip-troubleshooting-adding-snippets| -31. API |luasnip-api| +32. API |luasnip-api| > __ ____ /\ \ /\ _`\ __ @@ -3259,6 +3260,8 @@ The node and `event_args` can be accessed through `require("luasnip").session`: `event_args`: - `expand_pos`: `{, }`, position at which the snippet will be expanded. `` and `` are both 0-indexed. + - `expand_pos_mark_id`: `number`, the id of the extmark luasnip uses to track + `expand_pos`. This may be moved around freely. `event_res`: - `env_override`: `map string->(string[]|string)`, override or extend the snippet’s environment (`snip.env`). @@ -3364,7 +3367,33 @@ It is also possible to get/set the source of a snippet via API: ============================================================================== -29. Config-Options *luasnip-config-options* +29. Selection *luasnip-selection* + +Many snippets use the `$TM_SELECTED_TEXT` or (for LuaSnip, preferably +`LS_SELECT_RAW` or `LS_SELECT_DEDENT`) variable, which has to be populated by +selecting and then yanking (and usually also cutting) text from the buffer +before expanding. + +By default, this is disabled (as to not pollute keybindings which may be used +for something else), so one has to * either set `cut_selection_keys` in `setup` +(see |luasnip-config-options|). * or map `ls.cut_keys` as the rhs of a mapping +* or manually configure the keybinding. For this, create a new keybinding that +1. ``es to NORMAL (to populate the `<` and `>`-markers) 2. calls +`luasnip.pre_yank()` 3. yanks text to some named register +`` 4. calls `luasnip.post_yank()` Take care that the +yanking actually takes place between the two calls. One way to ensure this is +to call the two functions via `lua ...`: `lua vim.keymap.set("v", +"", [[lua +require("luasnip.util.select").pre_yank("z")gv"zslua +require('luasnip.util.select').post_yank("z")]])` The reason for this +specific order is to allow us to take a snapshot of registers (in the +pre-callback), and then restore them (in the post-callback) (so that we may get +the visual selection directly from the register, which seems to be the most +foolproof way of doing this). + + +============================================================================== +30. Config-Options *luasnip-config-options* These are the settings you can provide to `luasnip.setup()`: @@ -3399,9 +3428,9 @@ These are the settings you can provide to `luasnip.setup()`: so, remove it from the history. Off by default, `'TextChanged'` (perhaps `'InsertLeave'`, to react to changes done in Insert mode) should work just fine (alternatively, this can also be mapped using `luasnip-delete-check`). -- `store_selection_keys`: Mapping for populating `TM_SELECTED_TEXT` and related - variables (not set by default). If you want to set this mapping yourself, map - `ls.select_keys` (not a function, actually a string/key-combination) as a rhs. +- `cut_selection_keys`: Mapping for populating `TM_SELECTED_TEXT` and related + variables (not set by default). See |luasnip-selection| for more infos. +- `store_selection_keys` (deprecated): same as `cut_selection_keys` - `enable_autosnippets`: Autosnippets are disabled by default to minimize performance penalty if unused. Set to `true` to enable. - `ext_opts`: Additional options passed to extmarks. Can be used to add @@ -3449,7 +3478,7 @@ These are the settings you can provide to `luasnip.setup()`: ============================================================================== -30. Troubleshooting *luasnip-troubleshooting* +31. Troubleshooting *luasnip-troubleshooting* ADDING SNIPPETS *luasnip-troubleshooting-adding-snippets* @@ -3518,7 +3547,7 @@ GENERAL ~ ============================================================================== -31. API *luasnip-api* +32. API *luasnip-api* `require("luasnip")`: diff --git a/config/neovim/store/lazy-plugins/luasnip/doc/tags b/config/neovim/store/lazy-plugins/luasnip/doc/tags index 3c6f662a..35a36845 100644 --- a/config/neovim/store/lazy-plugins/luasnip/doc/tags +++ b/config/neovim/store/lazy-plugins/luasnip/doc/tags @@ -48,6 +48,7 @@ luasnip-node luasnip.txt /*luasnip-node* luasnip-node-api luasnip.txt /*luasnip-node-api* luasnip-node-reference luasnip.txt /*luasnip-node-reference* luasnip-restorenode luasnip.txt /*luasnip-restorenode* +luasnip-selection luasnip.txt /*luasnip-selection* luasnip-snippetnode luasnip.txt /*luasnip-snippetnode* luasnip-snippetproxy luasnip.txt /*luasnip-snippetproxy* luasnip-snippets luasnip.txt /*luasnip-snippets* diff --git a/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/config.lua b/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/config.lua index aaaaa9c7..7acbca80 100644 --- a/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/config.lua +++ b/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/config.lua @@ -65,6 +65,12 @@ c = { conf.history = nil end + if user_config.store_selection_keys ~= nil then + conf.cut_selection_keys = user_config.store_selection_keys + + user_config.store_selection_keys = nil + end + for k, v in pairs(user_config) do conf[k] = v end @@ -125,12 +131,12 @@ c = { end) end - if session.config.store_selection_keys then + if session.config.cut_selection_keys then vim.cmd( string.format( [[xnoremap %s %s]], - session.config.store_selection_keys, - require("luasnip.util.select").select_keys + session.config.cut_selection_keys, + require("luasnip.util.select").cut_keys ) ) end diff --git a/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/default_config.lua b/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/default_config.lua index 68ed80c4..9793cf5c 100644 --- a/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/default_config.lua +++ b/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/default_config.lua @@ -110,7 +110,10 @@ return { -- see :h User, event should never be triggered(except if it is `doautocmd`'d) region_check_events = nil, delete_check_events = nil, - store_selection_keys = nil, -- Supossed to be the same as the expand shortcut + + -- preserve default of store_selection_keys. + cut_selection_keys = nil, + ext_opts = { [types.textNode] = { active = { hl_group = "LuasnipTextNodeActive" }, diff --git a/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/init.lua b/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/init.lua index 14d07443..96cced87 100644 --- a/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/init.lua +++ b/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/init.lua @@ -844,7 +844,11 @@ local ls_lazy = { config = function() return require("luasnip.config") end, multi_snippet = function() return require("luasnip.nodes.multiSnippet").new_multisnippet end, snippet_source = function() return require("luasnip.session.snippet_collection.source") end, - select_keys = function() return require("luasnip.util.select").select_keys end + cut_keys = function() return require("luasnip.util.select").cut_keys end, + -- keep select_keys for backwards-compatibility. + select_keys = function() return require("luasnip.util.select").cut_keys end, + pre_yank = function() return require("luasnip.util.select").pre_yank end, + post_yank = function() return require("luasnip.util.select").post_yank end, } ls = lazy_table({ diff --git a/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/nodes/snippet.lua b/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/nodes/snippet.lua index a0be2fb9..bfd39b5f 100644 --- a/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/nodes/snippet.lua +++ b/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/nodes/snippet.lua @@ -632,6 +632,14 @@ end function Snippet:trigger_expand(current_node, pos_id, env, indent_nodes) local pos = vim.api.nvim_buf_get_extmark_by_id(0, session.ns_id, pos_id, {}) + local pre_expand_res = self:event( + events.pre_expand, + { expand_pos = pos, expand_pos_mark_id = pos_id } + ) or {} + + -- update pos, event-callback might have moved the extmark. + pos = vim.api.nvim_buf_get_extmark_by_id(0, session.ns_id, pos_id, {}) + -- find tree-node the snippet should be inserted at (could be before another node). local _, sibling_snippets, own_indx, parent_node = node_util.snippettree_find_undamaged_node(pos, { @@ -697,11 +705,6 @@ function Snippet:trigger_expand(current_node, pos_id, env, indent_nodes) end end - local pre_expand_res = self:event(events.pre_expand, { expand_pos = pos }) - or {} - -- update pos, event-callback might have moved the extmark. - pos = vim.api.nvim_buf_get_extmark_by_id(0, session.ns_id, pos_id, {}) - Environ:override(env, pre_expand_res.env_override or {}) if indent_nodes then diff --git a/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/util/select.lua b/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/util/select.lua index decf8fb5..70f64351 100644 --- a/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/util/select.lua +++ b/config/neovim/store/lazy-plugins/luasnip/lua/luasnip/util/select.lua @@ -59,19 +59,30 @@ end -- subtle: `:lua` exits VISUAL, which means that the '< '>-marks will be set correctly! -- Afterwards, we can just use lua, which does not change the mode. -M.select_keys = - [[:lua require("luasnip.util.select").pre_cut()gv"zslua require('luasnip.util.select').post_cut("z")]] +M.cut_keys = + [[lua require("luasnip.util.select").pre_yank("z")gv"zslua require('luasnip.util.select').post_yank("z")]] local saved_registers local lines local start_line, start_col, end_line, end_col local mode -function M.pre_cut() +function M.pre_yank(yank_register) -- store registers so we don't change any of them. -- "" is affected since we perform a cut (s), 1-9 also (although :h -- quote_number seems to state otherwise for cuts to specific registers..?). - saved_registers = - store_registers("", "1", "2", "3", "4", "5", "6", "7", "8", "9", "z") + saved_registers = store_registers( + "", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + yank_register + ) -- store data needed for de-indenting lines. start_line = vim.fn.line("'<") - 1 @@ -83,9 +94,9 @@ function M.pre_cut() mode = vim.fn.visualmode() end -function M.post_cut(register_name) +function M.post_yank(yank_register) -- remove trailing newline. - local chunks = vim.split(vim.fn.getreg(register_name):gsub("\n$", ""), "\n") + local chunks = vim.split(vim.fn.getreg(yank_register):gsub("\n$", ""), "\n") -- make sure to restore the registers to the state they were before cutting. restore_registers(saved_registers) diff --git a/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/doc/luasnip.txt b/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/doc/luasnip.txt similarity index 98% rename from config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/doc/luasnip.txt rename to config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/doc/luasnip.txt index 91a9d88f..0bcbe40c 100644 --- a/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/doc/luasnip.txt +++ b/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/doc/luasnip.txt @@ -1,4 +1,4 @@ -*luasnip.txt* For NVIM v0.8.0 Last change: 2024 August 01 +*luasnip.txt* For NVIM v0.8.0 Last change: 2024 August 28 ============================================================================== Table of Contents *luasnip-table-of-contents* @@ -60,10 +60,11 @@ Table of Contents *luasnip-table-of-contents* 26. Cleanup |luasnip-cleanup| 27. Logging |luasnip-logging| 28. Source |luasnip-source| -29. Config-Options |luasnip-config-options| -30. Troubleshooting |luasnip-troubleshooting| +29. Selection |luasnip-selection| +30. Config-Options |luasnip-config-options| +31. Troubleshooting |luasnip-troubleshooting| - Adding Snippets |luasnip-troubleshooting-adding-snippets| -31. API |luasnip-api| +32. API |luasnip-api| > __ ____ /\ \ /\ _`\ __ @@ -3259,6 +3260,8 @@ The node and `event_args` can be accessed through `require("luasnip").session`: `event_args`: - `expand_pos`: `{, }`, position at which the snippet will be expanded. `` and `` are both 0-indexed. + - `expand_pos_mark_id`: `number`, the id of the extmark luasnip uses to track + `expand_pos`. This may be moved around freely. `event_res`: - `env_override`: `map string->(string[]|string)`, override or extend the snippet’s environment (`snip.env`). @@ -3364,7 +3367,33 @@ It is also possible to get/set the source of a snippet via API: ============================================================================== -29. Config-Options *luasnip-config-options* +29. Selection *luasnip-selection* + +Many snippets use the `$TM_SELECTED_TEXT` or (for LuaSnip, preferably +`LS_SELECT_RAW` or `LS_SELECT_DEDENT`) variable, which has to be populated by +selecting and then yanking (and usually also cutting) text from the buffer +before expanding. + +By default, this is disabled (as to not pollute keybindings which may be used +for something else), so one has to * either set `cut_selection_keys` in `setup` +(see |luasnip-config-options|). * or map `ls.cut_keys` as the rhs of a mapping +* or manually configure the keybinding. For this, create a new keybinding that +1. ``es to NORMAL (to populate the `<` and `>`-markers) 2. calls +`luasnip.pre_yank()` 3. yanks text to some named register +`` 4. calls `luasnip.post_yank()` Take care that the +yanking actually takes place between the two calls. One way to ensure this is +to call the two functions via `lua ...`: `lua vim.keymap.set("v", +"", [[lua +require("luasnip.util.select").pre_yank("z")gv"zslua +require('luasnip.util.select').post_yank("z")]])` The reason for this +specific order is to allow us to take a snapshot of registers (in the +pre-callback), and then restore them (in the post-callback) (so that we may get +the visual selection directly from the register, which seems to be the most +foolproof way of doing this). + + +============================================================================== +30. Config-Options *luasnip-config-options* These are the settings you can provide to `luasnip.setup()`: @@ -3399,9 +3428,9 @@ These are the settings you can provide to `luasnip.setup()`: so, remove it from the history. Off by default, `'TextChanged'` (perhaps `'InsertLeave'`, to react to changes done in Insert mode) should work just fine (alternatively, this can also be mapped using `luasnip-delete-check`). -- `store_selection_keys`: Mapping for populating `TM_SELECTED_TEXT` and related - variables (not set by default). If you want to set this mapping yourself, map - `ls.select_keys` (not a function, actually a string/key-combination) as a rhs. +- `cut_selection_keys`: Mapping for populating `TM_SELECTED_TEXT` and related + variables (not set by default). See |luasnip-selection| for more infos. +- `store_selection_keys` (deprecated): same as `cut_selection_keys` - `enable_autosnippets`: Autosnippets are disabled by default to minimize performance penalty if unused. Set to `true` to enable. - `ext_opts`: Additional options passed to extmarks. Can be used to add @@ -3449,7 +3478,7 @@ These are the settings you can provide to `luasnip.setup()`: ============================================================================== -30. Troubleshooting *luasnip-troubleshooting* +31. Troubleshooting *luasnip-troubleshooting* ADDING SNIPPETS *luasnip-troubleshooting-adding-snippets* @@ -3518,7 +3547,7 @@ GENERAL ~ ============================================================================== -31. API *luasnip-api* +32. API *luasnip-api* `require("luasnip")`: diff --git a/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/ftplugin/snippets.vim b/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/ftplugin/snippets.vim similarity index 100% rename from config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/ftplugin/snippets.vim rename to config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/ftplugin/snippets.vim diff --git a/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/luasnip-2.3.0-1.rockspec b/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/luasnip-2.3.0-1.rockspec similarity index 100% rename from config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/luasnip-2.3.0-1.rockspec rename to config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/luasnip-2.3.0-1.rockspec diff --git a/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/plugin/luasnip.lua b/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/plugin/luasnip.lua similarity index 100% rename from config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/plugin/luasnip.lua rename to config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/plugin/luasnip.lua diff --git a/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/plugin/luasnip.vim b/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/plugin/luasnip.vim similarity index 100% rename from config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/plugin/luasnip.vim rename to config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/plugin/luasnip.vim diff --git a/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/rock_manifest b/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/rock_manifest similarity index 93% rename from config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/rock_manifest rename to config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/rock_manifest index 45747bdd..a41a132d 100644 --- a/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/rock_manifest +++ b/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/rock_manifest @@ -1,6 +1,6 @@ rock_manifest = { doc = { - ["luasnip.txt"] = "ab6768dea4b13a6eec600fa0b60b72c9" + ["luasnip.txt"] = "56f185c21667b647e6d99e300a92fc49" }, ftplugin = { ["snippets.vim"] = "f8c461751ad539fc449c15a85bf70be4" @@ -8,8 +8,8 @@ rock_manifest = { lua = { luasnip = { ["_types.lua"] = "a1b1fc45d496f8ece3e17dc3541e5f93", - ["config.lua"] = "1bb0edf593b14b243b116d70cbb605c9", - ["default_config.lua"] = "51eea9c217eed18af81d580129c70461", + ["config.lua"] = "66f8d59053f6a1edfee8845e5afe0d6c", + ["default_config.lua"] = "787cac3056704f9ca6e93030bbdf3c36", extras = { ["_extra_types.lua"] = "b8f4a120d5abe22f0112efdcae358817", ["_lambda.lua"] = "e94a2ad0606ed3c4276a573d4e7ab205", @@ -32,7 +32,7 @@ rock_manifest = { ["treesitter_postfix.lua"] = "42a5143ad3c647d292b2183566fd6776" }, ["health.lua"] = "b6bd288f728f6897674347ad46917a5b", - ["init.lua"] = "96451aae98dbaf3ece53873298479172", + ["init.lua"] = "702ec608eb5de12e5fb1e73ed5aa8a90", loaders = { ["data.lua"] = "498490d7dfcf2f0374b0d20f429ba6fb", ["from_lua.lua"] = "78d20ec3694e16581e21ed4948c26385", @@ -55,7 +55,7 @@ rock_manifest = { ["multiSnippet.lua"] = "2eab1e75c5ee87096f03db006da31844", ["node.lua"] = "c1d2f45dd25dcf5c1574ff63e0f9e88c", ["restoreNode.lua"] = "9613ce23458968aa12737365dd302be7", - ["snippet.lua"] = "d6a31a62f45a460bc642822b6d0244f7", + ["snippet.lua"] = "352d6ba76f615a833c6de4a1793f485a", ["snippetProxy.lua"] = "68262858f0f9a20a41640d5a11c43481", ["textNode.lua"] = "c22395ab8305a581f021982cd88e2931", util = { @@ -96,7 +96,7 @@ rock_manifest = { }, ["path.lua"] = "3767ba134238fa42469cfcbcfdf16147", ["pattern_tokenizer.lua"] = "f4f99d27e6a6fb5385f583abc70beaab", - ["select.lua"] = "b0a8180922f7995a86ea9df7eabb162e", + ["select.lua"] = "2c46eb195573850fe2a3057ff534c464", ["str.lua"] = "06645f5bc876c73af9c4fd3296d620e0", ["table.lua"] = "f4a54a5775133c776d65643be728cfdb", ["time.lua"] = "54483e160266c85209e4399fbfc43e1b", diff --git a/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/syntax/snippets.vim b/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/syntax/snippets.vim similarity index 100% rename from config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/luasnip/2.3.0-1/syntax/snippets.vim rename to config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/luasnip/2.3.0-1/syntax/snippets.vim diff --git a/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/manifest b/config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/manifest similarity index 100% rename from config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-01-rocks/manifest rename to config/neovim/store/lazy-plugins/luasnip/luasnip-2.3.0-1-unstable-2024-08-28-rocks/manifest diff --git a/config/neovim/store/lazy-plugins/luasnip/nix-support/propagated-build-inputs b/config/neovim/store/lazy-plugins/luasnip/nix-support/propagated-build-inputs index 3a21d55c..0feb206f 100644 --- a/config/neovim/store/lazy-plugins/luasnip/nix-support/propagated-build-inputs +++ b/config/neovim/store/lazy-plugins/luasnip/nix-support/propagated-build-inputs @@ -1 +1 @@ -/nix/store/74x3q8qvr31hbdbk7zxckfvyd4q92d79-lua5.1-jsregexp-0.0.7-1 /nix/store/rn8bzg423wwkayzbsbmhmvcgjmbzrq5z-lua-5.1.5 \ No newline at end of file +/nix/store/5jji4dabr6sml48pyp2ap76yh58xd48r-lua5.1-jsregexp-0.0.7-1 /nix/store/k55zni8plmbwkbv9l6ds65p981ndxk7x-lua-5.1.5 \ No newline at end of file diff --git a/config/neovim/store/lazy-plugins/luasnip/rock_manifest b/config/neovim/store/lazy-plugins/luasnip/rock_manifest index 45747bdd..a41a132d 100644 --- a/config/neovim/store/lazy-plugins/luasnip/rock_manifest +++ b/config/neovim/store/lazy-plugins/luasnip/rock_manifest @@ -1,6 +1,6 @@ rock_manifest = { doc = { - ["luasnip.txt"] = "ab6768dea4b13a6eec600fa0b60b72c9" + ["luasnip.txt"] = "56f185c21667b647e6d99e300a92fc49" }, ftplugin = { ["snippets.vim"] = "f8c461751ad539fc449c15a85bf70be4" @@ -8,8 +8,8 @@ rock_manifest = { lua = { luasnip = { ["_types.lua"] = "a1b1fc45d496f8ece3e17dc3541e5f93", - ["config.lua"] = "1bb0edf593b14b243b116d70cbb605c9", - ["default_config.lua"] = "51eea9c217eed18af81d580129c70461", + ["config.lua"] = "66f8d59053f6a1edfee8845e5afe0d6c", + ["default_config.lua"] = "787cac3056704f9ca6e93030bbdf3c36", extras = { ["_extra_types.lua"] = "b8f4a120d5abe22f0112efdcae358817", ["_lambda.lua"] = "e94a2ad0606ed3c4276a573d4e7ab205", @@ -32,7 +32,7 @@ rock_manifest = { ["treesitter_postfix.lua"] = "42a5143ad3c647d292b2183566fd6776" }, ["health.lua"] = "b6bd288f728f6897674347ad46917a5b", - ["init.lua"] = "96451aae98dbaf3ece53873298479172", + ["init.lua"] = "702ec608eb5de12e5fb1e73ed5aa8a90", loaders = { ["data.lua"] = "498490d7dfcf2f0374b0d20f429ba6fb", ["from_lua.lua"] = "78d20ec3694e16581e21ed4948c26385", @@ -55,7 +55,7 @@ rock_manifest = { ["multiSnippet.lua"] = "2eab1e75c5ee87096f03db006da31844", ["node.lua"] = "c1d2f45dd25dcf5c1574ff63e0f9e88c", ["restoreNode.lua"] = "9613ce23458968aa12737365dd302be7", - ["snippet.lua"] = "d6a31a62f45a460bc642822b6d0244f7", + ["snippet.lua"] = "352d6ba76f615a833c6de4a1793f485a", ["snippetProxy.lua"] = "68262858f0f9a20a41640d5a11c43481", ["textNode.lua"] = "c22395ab8305a581f021982cd88e2931", util = { @@ -96,7 +96,7 @@ rock_manifest = { }, ["path.lua"] = "3767ba134238fa42469cfcbcfdf16147", ["pattern_tokenizer.lua"] = "f4f99d27e6a6fb5385f583abc70beaab", - ["select.lua"] = "b0a8180922f7995a86ea9df7eabb162e", + ["select.lua"] = "2c46eb195573850fe2a3057ff534c464", ["str.lua"] = "06645f5bc876c73af9c4fd3296d620e0", ["table.lua"] = "f4a54a5775133c776d65643be728cfdb", ["time.lua"] = "54483e160266c85209e4399fbfc43e1b", diff --git a/config/neovim/store/lazy-plugins/mini.nvim/.github/workflows/lint.yml b/config/neovim/store/lazy-plugins/mini.nvim/.github/workflows/lint.yml index 0c547231..c3c51c3f 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/.github/workflows/lint.yml +++ b/config/neovim/store/lazy-plugins/mini.nvim/.github/workflows/lint.yml @@ -63,23 +63,3 @@ jobs: fetch-depth: 0 - name: Check Case Sensitivity uses: credfeto/action-case-checker@v1.2.1 - - checkout: - # Test possibility of checking out and setting up 'mini.nvim' on non-Linux - # This can guard from possible problems: - # - Long file names (particularly from reference screenshots). - name: Test checkout - strategy: - fail-fast: false - matrix: - os: [windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: Setup neovim - uses: rhysd/action-setup-vim@v1 - with: - # Uses latest stable by default - neovim: true - - name: Test setup - run: make basic_setup diff --git a/config/neovim/store/lazy-plugins/mini.nvim/.github/workflows/tests.yml b/config/neovim/store/lazy-plugins/mini.nvim/.github/workflows/tests.yml index e0ac7192..4f99f956 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/.github/workflows/tests.yml +++ b/config/neovim/store/lazy-plugins/mini.nvim/.github/workflows/tests.yml @@ -15,17 +15,17 @@ concurrency: jobs: build: name: Run tests - timeout-minutes: 10 + timeout-minutes: 15 strategy: fail-fast: false matrix: os: [ubuntu-latest] - neovim_version: ['v0.8.3', 'v0.9.5', 'v0.10.0', 'nightly'] - # include: - # - os: macos-latest - # neovim_version: v0.10.0 - # - os: windows-latest - # neovim_version: v0.10.0 + neovim_version: ['v0.8.3', 'v0.9.5', 'v0.10.1', 'nightly'] + include: + - os: macos-latest + neovim_version: v0.10.1 + - os: windows-latest + neovim_version: v0.10.1 runs-on: ${{ matrix.os }} steps: diff --git a/config/neovim/store/lazy-plugins/mini.nvim/CHANGELOG.md b/config/neovim/store/lazy-plugins/mini.nvim/CHANGELOG.md index 1b2c56af..bf6026db 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/CHANGELOG.md +++ b/config/neovim/store/lazy-plugins/mini.nvim/CHANGELOG.md @@ -6,6 +6,16 @@ - Tree-sitter parser is built-in in Neovim 0.9.x, needs manual enabling via `vim.treesitter.start()`. - Has visual regressions on Neovim 0.8.0 and 0.8.1 without enabled tree-sitter (code blocks are highlighted as normal text). Use 0.8.2 or newer. - Universally prefer 'mini.icons' module over 'nvim-tree/nvim-web-devicons'. +- Start automated testing on Windows and MacOS. +- Universally ensure that all plugin's highlight groups are defined after any color scheme takes effect. + +## mini.base16 + +- FEATURE: add 'kevinhwang91/nvim-bqf' plugin integration. + +## mini.completion + +- FEATURE: add highlighting of LSP kind (like "Function", "Keyword", etc.). Works only on Neovim>=0.11. Requires enabled 'mini.icons' to work out of the box. ## mini.doc @@ -13,10 +23,17 @@ ## mini.extra -- FEATURE: update `pickers.oldfiles()` to have `current_dir` option which if `true` shows files only from picker's working directory. By @abeldekat, PR #997. +- FEATURE: update `oldfiles` picker to have `current_dir` option which if `true` shows files only from picker's working directory. By @abeldekat, PR #997. - FEATURE: make `git_hunks`, `list`, and `lsp` pickers show icons. Scopes `document_symbol` and `workspace_symbol` in `lsp` picker show icon based on LSP kind (requires set up 'mini.icons'), others - based on path data. +- FEATURE: update `buf_lines` and `oldfiles` pickers to have `preserve_order` local option, similar to `visit_paths` picker. Other possible candidates for this option are intentionally not updated to not increase maintenance (manually override `match` source method to call `MiniPick.default_match()` with `{ preserve_order = true }` options). +- FEATURE: update `buf_lines` picker to pad line numbers to achieve more aligned look. - BREAKING FEATURE: use "│" as line/position separator instead of ":". This aligns with changes in 'mini.pick' and makes line/position more easily visible. +## mini.git + +- FEATURE: update `show_at_cursor()` to include commit's statistics when showing commit. +- FEATURE: update `show_at_cursor()` to show relevant at cursor commit data inside 'mini.deps' confirmation buffer. + ## mini.hipatterns - BREAKING FEATURE: update `compute_hex_color_group()` to compute based on combination of `hex_color` and `style`, opposed to just `hex_color`. This allows simultaneous usage of several styles in user's custom highlighters. @@ -24,10 +41,26 @@ ## mini.hues - FEATURE: implement `apply_palette()` (to compliment `make_palette()`) providing a way to tweak applied palette before applying it. +- FEATURE: add 'kevinhwang91/nvim-bqf' plugin integration. ## mini.files - FEATURE: prefer using 'mini.icons' as icon provider. +- FEATURE: implement bookmarks. With default config: + - Type `m` followed by a single character `` to set directory path of focused window as a bookmark with id ``. + - Type `'` followed by a bookmark id to make bookmark's path focused in explorer. + - Use `MiniFiles.set_bookmark()` inside `MiniFilesExplorerOpen` event to set custom bookmarks. +- FEATURE: make data for `MiniFilesActionDelete` contain `to` field in case of not permanent delete. +- FEATURE: make file manipulation work better for special complex/overlapping cases (like delete 'file-a' and copy 'file-b' as 'file-a'). It is **still** a better idea to split overlapping manipulations into smaller and not related steps, as there *are* cases which won't work. +- FEATURE: add `get_explorer_state()` to allow more reliable user customizations. +- FEATURE: add `set_branch()` to allow to set what paths should be displayed and focused. +- BREAKING: soft deprecate `get_target_window()` in favor of `get_explorer_state().target_window`. Will be completely removed after the next release. +- BREAKING: update how confirmation lines are computed: + - Show create actions in the group directory where text manipulation took place. This matters during creating nested entries and is usually a more intuitive representation. + - For delete show its type after the file name ("permanently" or "to trash") as an additional visual indication of delete type. + - For create, copy and move prefer showing its "to" path relative to group directory. + - Separate action name and paths with "│" (instead of ":") for better visual separation. + - Don't enclose paths in quotes. Initially it was done to reliably show possible whitespace in paths, but inferring it from overall line structure should be good enough. ## mini.icons @@ -35,14 +68,17 @@ ## mini.misc -- FEATURE: implement `setup_termbg_sync()` to set up terminal background synchronization (removes possible "frame" around current Neovim instance). +- FEATURE: implement `setup_termbg_sync()` to set up terminal background synchronization (removes possible "frame" around current Neovim instance). Works only on Neovim>=0.10. ## mini.pick - FEATURE: prefer using 'mini.icons' as icon provider. +- BREAKING: update `default_match()` to have table `opts` as fourth argument (instead of boolean `do_sync`). Use `{ sync = true }` to run synchronously. The new design is more aligned with other functions and is more forward compatible. +- FEATURE: add `preserve_order` option to `default_match()` to allow asynchronous matching which preserves order (i.e. doesn't do sort step of fuzzy matching). - BREAKING: encoding line or position in string items has changed: - Use "\0" (null character; use "\000" form if it is in a string before digit) instead of ":" as delimiter. This makes it work with files similar to ":" position encoding (like "time_12:34:56"). This only matters for custom sources which provide line or position in string items. - Update `default_show()` to display "│" character instead of "\0" in item's string representation (previously was ":"). In particular, this changes how line/position is displayed in `grep` and `grep_live` built-in pickers. This change was done because "│" is more visible as separator. +- FEATURE: explicitly hide cursor when picker is active (instead of putting it in command line). ## mini.starter @@ -51,6 +87,7 @@ ## mini.statusline - BREAKING FEATURE: update `section_fileinfo()` to show non-empty filetype even in not normal buffers (like plugin's scratch buffers, help, quickfix, etc.). Previously it showed nothing, which was a mistake as filetype can be a valuable information. +- BREAKING FEATURE: the default `set_vim_settings` config value now does not affect `laststatus = 3` (aka global statusline). - FEATURE: prefer using 'mini.icons' as icon provider for `section_fileinfo()`. ## mini.surround @@ -61,6 +98,10 @@ - FEATURE: prefer using 'mini.icons' as icon provider. +## mini.test + +- FEATURE: make it work on Windows. By @cameronr, PR #1101. + # Version 0.13.0 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/CONTRIBUTING.md b/config/neovim/store/lazy-plugins/mini.nvim/CONTRIBUTING.md index 16d4c45e..11645284 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/CONTRIBUTING.md +++ b/config/neovim/store/lazy-plugins/mini.nvim/CONTRIBUTING.md @@ -95,7 +95,7 @@ If your contribution updates annotations used to generate help file, please rege ## Testing -If your contribution updates code and you use Linux (not Windows or MacOS), please make sure that it doesn't break existing tests. If it adds new functionality or fixes a recognized bug, add new test case(s). There are two ways of running tests: +If your contribution updates code, please make sure that it doesn't break existing tests. If it adds new functionality or fixes a recognized bug, add new test case(s). There are two ways of running tests: - From command line: - Execute `make test` to run all tests (with `nvim` as executable). @@ -107,11 +107,13 @@ If your contribution updates code and you use Linux (not Windows or MacOS), plea This plugin uses 'mini.test' to manage its tests. For a more hands-on introduction, see [TESTING.md](TESTING.md). **Notes**: -- If you have Windows or MacOS and want to contribute code related change, make your best effort to not break existing behavior. It will later be tested automatically after making Pull Request. The reason for this distinction is that tests are not well designed to be run on those operating systems. - If new functionality relies on an external dependency (`git` CLI tool, LSP server, etc.), use mocking (writing Lua code which emulates dependency usage as close as reasonably possible). For examples, take a look at tests for 'mini.pick', 'mini.completion', and 'mini.statusline'. - There is a certain number of tests that are flaky (i.e. will sometimes report an error due to other reasons than actual functionality being broke). It is usually the ones which test time related functionality (i.e. that certain action was done after specific amount of delay). A commonly used way to know if the test is flaky is that it fails on non-nightly Neovim version yet there were no changes to its tested module after it had passed in the past. For example, some 'mini.animate' test is shown to break but there were no changes to it since test passed in CI couple of days before. In case there is some test breaking which reasonably should not, rerun that test (or the whole file) at least several times. +- Advice for writing more robust tests: + - To test asynchronous or slow execution, use common `sleep()` test helper. For a more robust testing code, **never** directly use numbers to compute sleep time. Use precomputed time delay constants, which should always take into account different testing OSs (like be bigger on Windows, etc.). If module testing requires its extensive use and tests can not be made robust enough (examples are 'mini.animate', 'mini.jump', etc.), consider using it with argument that skips entire test case if `sleep()` is called in slow context. + - Take into account that Windows uses "\" as default path separator instead of Unix "/". This should be accounted either in module's code (preferably) or in test files (for example, by computing path separator and relying on it). ## Formatting @@ -226,6 +228,7 @@ Here is a list of all highlight groups defined inside 'mini.nvim' modules. See d - `MiniPickBorder` - `MiniPickBorderBusy` - `MiniPickBorderText` + - `MiniPickCursor` - `MiniPickIconDirectory` - `MiniPickIconFile` - `MiniPickHeader` diff --git a/config/neovim/store/lazy-plugins/mini.nvim/MAINTAINING.md b/config/neovim/store/lazy-plugins/mini.nvim/MAINTAINING.md index 12e98c96..97ff3d9d 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/MAINTAINING.md +++ b/config/neovim/store/lazy-plugins/mini.nvim/MAINTAINING.md @@ -145,7 +145,6 @@ Begin the process of stopping official support for outdated Neovim version short - Add Lua source code in 'lua' directory. - Add tests in 'tests' directory. Use 'tests/dir-xxx' name for module-specific non-test helpers. - Update 'lua/init.lua' to mention new module: both in initial table of contents and list of modules. -- Update 'scripts/basic-setup_init.lua' to include new module. - Update 'scripts/dual_sync.sh' to include new module. - Update 'scripts/minidoc.lua' to generate separate help file. - Generate help files. diff --git a/config/neovim/store/lazy-plugins/mini.nvim/Makefile b/config/neovim/store/lazy-plugins/mini.nvim/Makefile index 6e460468..abcc0f44 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/Makefile +++ b/config/neovim/store/lazy-plugins/mini.nvim/Makefile @@ -27,9 +27,6 @@ documentation: lintcommit-ci: export LINTCOMMIT_STRICT=true && chmod u+x scripts/lintcommit-ci.sh && scripts/lintcommit-ci.sh -basic_setup: - $(NVIM_EXEC) --headless --noplugin -u ./scripts/basic-setup_init.lua - dual_sync: chmod u+x scripts/dual_sync.sh && scripts/dual_sync.sh diff --git a/config/neovim/store/lazy-plugins/mini.nvim/README.md b/config/neovim/store/lazy-plugins/mini.nvim/README.md index 56bfa796..012a1752 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/README.md +++ b/config/neovim/store/lazy-plugins/mini.nvim/README.md @@ -145,7 +145,7 @@ If you are browsing without particular objective and don't know which module to - **Silencing**. Each module providing non-error feedback can be configured to not do that by setting `config.silent = true` (either inside `setup()` call or on the fly). -- **Highlighting**. Appearance of module's output is controlled by certain set of highlight groups (see `:h highlight-groups`). By default they usually link to some semantically close built-in highlight group. Use `:highlight` command or `vim.api.nvim_set_hl()` Lua function to customize highlighting. To see a more calibrated look, use 'mini.hues', 'mini.base16', or plugin's colorscheme. +- **Highlighting**. Appearance of module's output is controlled by certain set of highlight groups (see `:h highlight-groups`). By default they usually link to some semantically close built-in highlight group and are ensured to be defined after any color scheme takes effect. Use `:highlight` command or `vim.api.nvim_set_hl()` Lua function to customize highlighting. To see a more calibrated look, use 'mini.hues', 'mini.base16', or plugin's color scheme. - **Stability**. Each module upon release is considered to be relatively stable: both in terms of setup and functionality. Any non-bugfix backward-incompatible change will be released gradually as much as possible. diff --git a/config/neovim/store/lazy-plugins/mini.nvim/benchmarks/starter/benchmark.sh b/config/neovim/store/lazy-plugins/mini.nvim/benchmarks/starter/benchmark.sh index 54b38623..70807afc 100755 --- a/config/neovim/store/lazy-plugins/mini.nvim/benchmarks/starter/benchmark.sh +++ b/config/neovim/store/lazy-plugins/mini.nvim/benchmarks/starter/benchmark.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash # Perform benchmarking of startup times with different Neovim 'init' files. # Execute `nvim -u <*> --startuptime <*>` several times (as closely to actual diff --git a/config/neovim/store/lazy-plugins/mini.nvim/benchmarks/starter/install.sh b/config/neovim/store/lazy-plugins/mini.nvim/benchmarks/starter/install.sh index 168ee7f0..f3d95ab5 100755 --- a/config/neovim/store/lazy-plugins/mini.nvim/benchmarks/starter/install.sh +++ b/config/neovim/store/lazy-plugins/mini.nvim/benchmarks/starter/install.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash PLUGINPATH=/tmp/nvim/site/pack/bench/opt rm -rf $PLUGINPATH mkdir -p $PLUGINPATH diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-base16.txt b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-base16.txt index f6f935bc..95f28bbf 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-base16.txt +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-base16.txt @@ -33,6 +33,7 @@ Supported highlight groups: - 'HiPhish/rainbow-delimiters.nvim' - 'hrsh7th/nvim-cmp' - 'justinmk/vim-sneak' + - 'kevinhwang91/nvim-bqf' - 'kevinhwang91/nvim-ufo' - 'lewis6991/gitsigns.nvim' - 'lukas-reineke/indent-blankline.nvim' diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-completion.txt b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-completion.txt index f0c3a75b..1aeaa59a 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-completion.txt +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-completion.txt @@ -45,12 +45,25 @@ Features: ``) or fallback completion via |MiniCompletion.complete_fallback()| (mapped to ``). +- LSP kind highlighting ("Function", "Keyword", etc.). Requires Neovim>=0.11. + By default uses "lsp" category of |MiniIcons| (if enabled). Can be customized + via `config.lsp_completion.process_items` by adding field + (same meaning as in |complete-items|) to items. + What it doesn't do: - Snippet expansion. - Many configurable sources. - Automatic mapping of ``, ``, etc., as those tend to have highly variable user expectations. See 'Helpful key mappings' for suggestions. +# Dependencies ~ + +Suggested dependencies (provide extra functionality, will work without them): + +- Enabled |MiniIcons| module to highlight LSP kind (requires Neovim>=0.11). + Otherwise |MiniCompletion.default_process_items()| does not add highlighting. + Also take a look at |MiniIcons.tweak_lsp_kind()|. + # Setup ~ This module needs a setup with `require('mini.completion').setup({})` @@ -199,12 +212,10 @@ Default values: -- on every `BufEnter` event. auto_setup = true, - -- `process_items` should be a function which takes LSP - -- 'textDocument/completion' response items and word to complete. Its - -- output should be a table of the same nature as input items. The most - -- common use-cases are custom filtering and sorting. You can use - -- default `process_items` as `MiniCompletion.default_process_items()`. - process_items = --, + -- A function which takes LSP 'textDocument/completion' response items + -- and word to complete. Output should be a table of the same nature as + -- input items. Common use case is custom filter/sort. + process_items = --, }, -- Fallback action. It will always be run in Insert mode. To use Neovim's @@ -269,5 +280,10 @@ No need to use it directly, everything is setup in |MiniCompletion.setup|. `MiniCompletion.default_process_items`({items}, {base}) Default `MiniCompletion.config.lsp_completion.process_items` +Steps: +- Filter out items not matching `base` and snippet items. +- Sort by LSP specification. +- If |MiniIcons| is enabled, add based on the "lsp" category. + vim:tw=78:ts=8:noet:ft=help:norl: \ No newline at end of file diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-extra.txt b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-extra.txt index 7674a2e5..a81174b5 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-extra.txt +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-extra.txt @@ -240,6 +240,8 @@ Parameters ~ Possible fields: - `(string)` - one of "all" (normal listed buffers) or "current". Default: "all". + - `(boolean)` - whether to preserve original order + during query. Default: `false`. {opts} `(table|nil)` Options forwarded to |MiniPick.start()|. Return ~ @@ -608,7 +610,7 @@ Examples ~ - `:Pick lsp scope='document_symbol'` - symbols in current file. Parameters ~ -{local_opts} `(table)` Options defining behavior of this particular picker. +{local_opts} `(table|nil)` Options defining behavior of this particular picker. Possible fields: - `(string)` - LSP method to use. One of the supported ones (see list above). Default: `nil` which means explicit scope is needed. @@ -648,6 +650,8 @@ Parameters ~ Possible fields: - `(boolean)` - whether to return files only from current working directory and its subdirectories. Default: `false`. + - `(boolean)` - whether to preserve original order + during query. Default: `false`. {opts} `(table|nil)` Options forwarded to |MiniPick.start()|. Return ~ diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-files.txt b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-files.txt index 11d79096..6fa5f811 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-files.txt +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-files.txt @@ -20,6 +20,7 @@ Features: - Filter/prefix/sort of file system entries. - Mappings used for common explorer actions. - UI options: whether to show preview of file/directory under cursor, etc. + - Bookmarks for quicker navigation. What it doesn't do: - Try to be replacement of system file explorer. It is mostly designed to @@ -159,6 +160,10 @@ Available built-in actions (see "Details" for more information): > |-------------|------|------------------------------------------------| | Go out plus | H | Focus on parent directory plus extra action | |-------------|------|------------------------------------------------| + | Go to mark | ' | Jump to bookmark (waits for single key id) | + |-------------|------|------------------------------------------------| + | Set mark | m | Set bookmark (waits for single key id) | + |-------------|------|------------------------------------------------| | Reset | | Reset current explorer | |-------------|------|------------------------------------------------| | Reveal cwd | @ | Reset current current working directory | @@ -183,6 +188,11 @@ Details: - "Go out plus" is regular "Go out" but trims right part of branch. +- "Set mark" and "Go to mark" both wait for user to press a single character + of a bookmark id. Example: `ma` sets directory path of focused window as + bookmark "a"; `'a` jumps (sets as whole branch) to bookmark "a". + Special bookmark "'" always points to path before the latest bookmark jump. + - "Reset" focuses only on "anchor" directory (the one used to open current explorer) and resets all stored directory cursor positions. @@ -190,7 +200,7 @@ Details: If it is not an ancestor of the current branch, nothing is done. - "Show help" results into new window with helpful information about current - explorer. Press `q` to close it. + explorer (like buffer mappings and bookmarks). Press `q` to close it. - "Synchronize" parses user edits in directory buffers, applies them (after confirmation), and updates all directory buffers with the most relevant @@ -226,11 +236,14 @@ General workflow: so you can navigate in and out of directory with modified buffer. - Execute |MiniFiles.synchronize()| (default key is `=`). This will prompt - confirmation dialog listing all file system actions it is about to perform. - READ IT CAREFULLY. + confirmation dialog listing all file system actions (per directory) it is + about to perform. READ IT CAREFULLY. -- Confirm by pressing `y`/`` (applies edits and updates buffers) or - don't confirm by pressing `n`/`` (updates buffers without applying edits). +- Confirm by pressing `y` / `` (apply edits and update buffers) or + don't confirm by pressing `n` / `` (update buffers without applying edits). + +Note: prefer small and not related steps with more frequent synchronization +over single complex manipulation. There are (known) cases which won't work. # How does it work ~ @@ -244,6 +257,7 @@ DO NOT modify text to the left of entry name. During synchronization, actual text for entry name is compared to path index at that line (if present) to deduce which file system action to perform. +Note that order of text manipulation steps does not affect performed actions. # Supported file system actions ~ @@ -327,8 +341,8 @@ UI events ~ - `MiniFilesWindowOpen` - when new window is opened. Can be used to set window-local settings (like border, 'winblend', etc.) -- `MiniFilesWindowUpdate` - when a window is updated. Triggers frequently, - for example, for every "go in" or "go out" action. +- `MiniFilesWindowUpdate` - when a window is updated. Triggers VERY frequently. + At least after every cursor movement and "go in" / "go out" action. Callback for each UI event will receive `data` field (see |nvim_create_autocmd()|) with the following information: @@ -354,8 +368,8 @@ Callback for each file action event will receive `data` field (see |nvim_create_autocmd()|) with the following information: - - string with action name. -- - absolute path of entry before action (`nil` for "create" action). -- - absolute path of entry after action (`nil` for "delete" action). +- - full path of entry before action (`nil` for "create" action). +- - full path of entry after action (`nil` for permanent "delete" action). ------------------------------------------------------------------------------ *MiniFiles-examples* @@ -371,7 +385,8 @@ Use a combination of |MiniFiles.open()| and |MiniFiles.close()|: >lua < # Customize windows ~ -Create an autocommand for `MiniFilesWindowOpen` event: >lua +For most of the common customizations using `MiniFilesWindowOpen` event +autocommand is the suggested approach: >lua vim.api.nvim_create_autocmd('User', { pattern = 'MiniFilesWindowOpen', @@ -386,9 +401,32 @@ Create an autocommand for `MiniFilesWindowOpen` event: >lua end, }) < +However, some parts (like window title and height) of window config are later +updated internally. Use `MiniFilesWindowUpdate` event for them: >lua + + vim.api.nvim_create_autocmd('User', { + pattern = 'MiniFilesWindowUpdate', + callback = function(args) + local config = vim.api.nvim_win_get_config(args.data.win_id) + + -- Ensure fixed height + config.height = 10 + + -- Ensure title padding + if config.title[#config.title][1] ~= ' ' then + table.insert(config.title, { ' ', 'NormalFloat' }) + end + if config.title[1][1] ~= ' ' then + table.insert(config.title, 1, { ' ', 'NormalFloat' }) + end + + vim.api.nvim_win_set_config(args.data.win_id, config) + end, + }) +< # Customize icons ~ -Use different directory icon: >lua +Use different directory icon (if you don't use |mini.icons|): >lua local my_prefix = function(fs_entry) if fs_entry.fs_type == 'directory' then @@ -434,18 +472,18 @@ Create an autocommand for `MiniFilesBufferCreate` event which calls < # Create mappings to modify target window via split ~ -Combine |MiniFiles.get_target_window()| and |MiniFiles.set_target_window()|: >lua +Combine |MiniFiles.get_explorer_state()| and |MiniFiles.set_target_window()|: >lua local map_split = function(buf_id, lhs, direction) local rhs = function() -- Make new window and set it as target - local new_target_window - vim.api.nvim_win_call(MiniFiles.get_target_window(), function() + local cur_target = MiniFiles.get_explorer_state().target_window + local new_target = vim.api.nvim_win_call(cur_target, function() vim.cmd(direction .. ' split') - new_target_window = vim.api.nvim_get_current_win() + return vim.api.nvim_get_current_win() end) - MiniFiles.set_target_window(new_target_window) + MiniFiles.set_target_window(new_target) end -- Adding `desc` will result into `show_help` entries @@ -458,8 +496,8 @@ Combine |MiniFiles.get_target_window()| and |MiniFiles.set_target_window()|: >lu callback = function(args) local buf_id = args.data.buf_id -- Tweak keys to your liking - map_split(buf_id, 'gs', 'belowright horizontal') - map_split(buf_id, 'gv', 'belowright vertical') + map_split(buf_id, '', 'belowright horizontal') + map_split(buf_id, '', 'belowright vertical') end, }) < @@ -481,6 +519,22 @@ Use |MiniFiles.get_fs_entry()| together with |vim.fs.dirname()|: >lua end, }) < +# Set custom bookmarks ~ + +Use |MiniFiles.set_bookmark()| inside `MiniFilesExplorerOpen` event: >lua + + local set_mark = function(id, path, desc) + MiniFiles.set_bookmark(id, path, { desc = desc }) + end + vim.api.nvim_create_autocmd('User', { + pattern = 'MiniFilesExplorerOpen', + callback = function() + set_mark('c', vim.fn.stdpath('config'), 'Config') -- path + set_mark('w', vim.fn.getcwd, 'Working directory') -- callable + set_mark('~', '~', 'Home directory') + end, + }) +< ------------------------------------------------------------------------------ *MiniFiles.setup()* `MiniFiles.setup`({config}) @@ -521,6 +575,8 @@ Default values: go_in_plus = 'L', go_out = 'h', go_out_plus = 'H', + mark_goto = "'", + mark_set = 'm', reset = '', reveal_cwd = '@', show_help = 'g?', @@ -712,7 +768,7 @@ Depends on entry under cursor: Explorer is not closed after that. Parameters ~ -{opts} Options. Possible fields: +{opts} `(table|nil)` Options. Possible fields: - `(boolean)` - whether to close explorer after going inside a file. Powers the `go_in_plus` mapping. Default: `false`. @@ -775,14 +831,35 @@ Return ~ Returns `nil` if there is no proper file system entry path at the line. +------------------------------------------------------------------------------ + *MiniFiles.get_explorer_state()* + `MiniFiles.get_explorer_state`() +Get state of active explorer + +Return ~ +`(table|nil)` Table with explorer state data or `nil` if no active explorer. + State data is a table with the following fields: + - `(string)` - anchor directory path (see |MiniFiles.open()|). + - `(table)` - map from bookmark id (single character) to its data: + table with and fields (see |MiniFiles.set_bookmark()|). + - `(table)` - array of nested paths for currently opened branch. + - `(number)` - an index in for currently focused path. + - `(number)` - identifier of target window. + - `(table)` - array with data about currently opened windows. + Each element is a table with (window identifier) and (path + shown in the window) fields. + +See also ~ +- |MiniFiles.set_bookmark()| +- |MiniFiles.set_branch()| +- |MiniFiles.set_target_window()| + ------------------------------------------------------------------------------ *MiniFiles.get_target_window()* `MiniFiles.get_target_window`() Get target window -Return ~ -`(number|nil)` Window identifier inside which file will be opened or - `nil` if no explorer is opened. +Deprecated. Use |MiniFiles.get_explorer_state()|. ------------------------------------------------------------------------------ *MiniFiles.set_target_window()* @@ -792,6 +869,38 @@ Set target window Parameters ~ {win_id} `(number)` Window identifier inside which file will be opened. +------------------------------------------------------------------------------ + *MiniFiles.set_branch()* + `MiniFiles.set_branch`({branch}, {opts}) +Set branch + +Set which paths to display. Preview (if enabled) is applied afterwards. + +Parameters ~ +{branch} `(table)` Array of strings representing actually present on disk paths. + Each consecutive pair should represent direct parent-child paths. + Should contain at least one directory path. + May end with file path (will be previwed). + Relative paths are resolved using |current-directory|. +{opts} `(table|nil)` Options. Possible fields: + - `(number)` - an index in `branch` for path to focus. Will + be normalized to fit inside `branch`. Default: index of deepest directory. + +See also ~ +|MiniFiles.get_explorer_state()| + +------------------------------------------------------------------------------ + *MiniFiles.set_bookmark()* + `MiniFiles.set_bookmark`({id}, {path}, {opts}) +Set bookmark + +Parameters ~ +{id} `(string)` Single character bookmark id. +{path} `(string|function)` Path of a present on disk directory to set as + a bookmark's path. If callable, should return such path. +{opts} `(table|nil)` Options. Possible fields: + - `(string)` - bookmark description (used in help window). + ------------------------------------------------------------------------------ *MiniFiles.get_latest_path()* `MiniFiles.get_latest_path`() diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-git.txt b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-git.txt index 9046be38..c671a5e1 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-git.txt +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-git.txt @@ -270,7 +270,8 @@ Default: "auto". `MiniGit.show_at_cursor`({opts}) Show Git related data at cursor -- If there is a commit-like ||, show it in split with `git show`. +- If inside |mini.deps| confirmation buffer, show in split relevant commit data. +- If there is a commit-like ||, show it in split. - If possible, show diff source via |MiniGit.show_diff_source()|. - If possible, show range history via |MiniGit.show_range_history()|. - Otherwise throw an error. diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-hues.txt b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-hues.txt index d9cab66e..42caf642 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-hues.txt +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-hues.txt @@ -49,6 +49,7 @@ Supported highlight groups: - 'HiPhish/rainbow-delimiters.nvim' - 'hrsh7th/nvim-cmp' - 'justinmk/vim-sneak' + - 'kevinhwang91/nvim-bqf' - 'kevinhwang91/nvim-ufo' - 'lewis6991/gitsigns.nvim' - 'lukas-reineke/indent-blankline.nvim' diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-misc.txt b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-misc.txt index 34f13f36..4f388030 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-misc.txt +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-misc.txt @@ -173,18 +173,20 @@ Parameters ~ Set up terminal background synchronization What it does: -- Checks if terminal emulator supports OSC 11 control sequence. Stops if not. -- Creates |UIEnter| and |ColorScheme| autocommands which change terminal - background to have same color as |guibg| of |hl-Normal|. -- Creates |UILeave| autocommand which sets terminal background back to the - color at the time this function was called first time in current session. +- Checks if terminal emulator supports OSC 11 control sequence through + appropriate `stdout`. Stops if not. +- Creates autocommands for |ColorScheme| and |VimResume| events, which + change terminal background to have same color as |guibg| of |hl-Normal|. +- Creates autocommands for |VimLeavePre| and |VimSuspend| events which set + terminal background back to the color at the time this function was + called first time in current session. - Synchronizes background immediately to allow not depend on loading order. Primary use case is to remove possible "frame" around current Neovim instance which appears if Neovim's |hl-Normal| background color differs from what is used by terminal emulator itself. -Make sure to call it only during interactive session in terminal emulator. +Works only on Neovim>=0.10. ------------------------------------------------------------------------------ *MiniMisc.setup_restore_cursor()* diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-pick.txt b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-pick.txt index 5d668ea3..62110cc7 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-pick.txt +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-pick.txt @@ -117,6 +117,7 @@ See |mini.nvim-buffer-local-config| for more details. * `MiniPickBorder` - window border. * `MiniPickBorderBusy` - window border while picker is busy processing. * `MiniPickBorderText` - non-prompt on border. +* `MiniPickCursor` - cursor during active picker (hidden by default). * `MiniPickIconDirectory` - default icon for directory. * `MiniPickIconFile` - default icon for file. * `MiniPickHeader` - headers in info buffer and previews. @@ -854,7 +855,7 @@ Refresh active picker ------------------------------------------------------------------------------ *MiniPick.default_match()* - `MiniPick.default_match`({stritems}, {inds}, {query}, {do_sync}) + `MiniPick.default_match`({stritems}, {inds}, {query}, {opts}) Default match Filter target stritems to contain query and sort from best to worst matches. @@ -926,11 +927,13 @@ Parameters ~ {inds} `(table)` Array of `stritems` indexes to match. All of them should point at string elements of `stritems`. No check is done for performance reasons. {query} `(table)` Array of strings. -{do_sync} `(boolean|nil)` Whether to match synchronously. Default: `nil`. +{opts} `(table|nil)` Options. Possible fields: + - `(boolean)` - Whether to match synchronously. Default: `false`. + - `(boolean)` - Whether to skip sort step. Default: `false`. Return ~ -`(table|nil)` Depending on whether computation is synchronous (either `do_sync` - is truthy or there is an active picker): +`(table|nil)` Depending on whether computation is synchronous (either `opts.sync` + is `true` or there is an active picker): - If yes, array of `stritems` indexes matching the `query` (from best to worst). - If no, `nil` is returned with |MiniPick.set_picker_match_inds()| used later. diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-statusline.txt b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-statusline.txt index 57acaac0..12a6264c 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-statusline.txt +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-statusline.txt @@ -150,9 +150,7 @@ Default values: -- Whether to use icons by default use_icons = true, - -- Whether to set Vim's settings for statusline (make it always shown with - -- 'laststatus' set to 2). - -- To use global statusline, set this to `false` and 'laststatus' to 3. + -- Whether to set Vim's settings for statusline (make it always shown) set_vim_settings = true, } < diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-test.txt b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-test.txt index ad2182e1..6e2507a0 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-test.txt +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/mini-test.txt @@ -32,6 +32,8 @@ Features: - Customizable project specific testing script. +- Works on Unix (Linux, MacOS, etc.) and Windows. + What it doesn't support: - Parallel execution. Due to idea of limiting implementation complexity. diff --git a/config/neovim/store/lazy-plugins/mini.nvim/doc/tags b/config/neovim/store/lazy-plugins/mini.nvim/doc/tags index bd0669df..604c06b5 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/doc/tags +++ b/config/neovim/store/lazy-plugins/mini.nvim/doc/tags @@ -278,6 +278,7 @@ MiniFiles.config mini-files.txt /*MiniFiles.config* MiniFiles.default_filter() mini-files.txt /*MiniFiles.default_filter()* MiniFiles.default_prefix() mini-files.txt /*MiniFiles.default_prefix()* MiniFiles.default_sort() mini-files.txt /*MiniFiles.default_sort()* +MiniFiles.get_explorer_state() mini-files.txt /*MiniFiles.get_explorer_state()* MiniFiles.get_fs_entry() mini-files.txt /*MiniFiles.get_fs_entry()* MiniFiles.get_latest_path() mini-files.txt /*MiniFiles.get_latest_path()* MiniFiles.get_target_window() mini-files.txt /*MiniFiles.get_target_window()* @@ -287,6 +288,8 @@ MiniFiles.open() mini-files.txt /*MiniFiles.open()* MiniFiles.refresh() mini-files.txt /*MiniFiles.refresh()* MiniFiles.reset() mini-files.txt /*MiniFiles.reset()* MiniFiles.reveal_cwd() mini-files.txt /*MiniFiles.reveal_cwd()* +MiniFiles.set_bookmark() mini-files.txt /*MiniFiles.set_bookmark()* +MiniFiles.set_branch() mini-files.txt /*MiniFiles.set_branch()* MiniFiles.set_target_window() mini-files.txt /*MiniFiles.set_target_window()* MiniFiles.setup() mini-files.txt /*MiniFiles.setup()* MiniFiles.show_help() mini-files.txt /*MiniFiles.show_help()* diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/ai.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/ai.lua index f6a1189f..aaf67ffd 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/ai.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/ai.lua @@ -704,7 +704,7 @@ MiniAi.gen_spec = {} --- Default: `{ '%b""', "%b''", '%b()', '%b[]', '%b{}' }` (separators --- inside balanced quotes or brackets are ignored). MiniAi.gen_spec.argument = function(opts) - opts = vim.tbl_deep_extend('force', { + opts = vim.tbl_extend('force', { brackets = { '%b()', '%b[]', '%b{}' }, separator = ',', exclude_regions = { '%b""', "%b''", '%b()', '%b[]', '%b{}' }, @@ -1425,7 +1425,7 @@ H.find_textobject_region = function(tobj_spec, ai_type, opts) end -- Convert to region - return neigh.span_to_region(final_span) + return neigh.span_to_region(final_span, find_res.vis_mode) end H.get_default_opts = function() @@ -1540,11 +1540,10 @@ end ---@param opts table Fields: . ---@private H.find_best_match = function(neighborhood, tobj_spec, reference_span, opts) - local best_span, best_nested_pattern, current_nested_pattern - local f = function(span) + local best_span, best_nested_pattern, best_vis_mode, current_nested_pattern + local f = function(span, vis_mode) if H.is_better_span(span, best_span, reference_span, opts) then - best_span = span - best_nested_pattern = current_nested_pattern + best_span, best_nested_pattern, best_vis_mode = span, current_nested_pattern, vis_mode end end @@ -1552,7 +1551,7 @@ H.find_best_match = function(neighborhood, tobj_spec, reference_span, opts) -- Iterate over all spans representing regions in array for _, region in ipairs(tobj_spec) do -- Consider region only if it is completely within neighborhood - if neighborhood.is_region_inside(region) then f(neighborhood.region_to_span(region)) end + if neighborhood.is_region_inside(region) then f(neighborhood.region_to_span(region), region.vis_mode) end end else -- Iterate over all matched spans @@ -1564,7 +1563,7 @@ H.find_best_match = function(neighborhood, tobj_spec, reference_span, opts) local extract_pattern if best_nested_pattern ~= nil then extract_pattern = best_nested_pattern[#best_nested_pattern] end - return { span = best_span, extract_pattern = extract_pattern } + return { span = best_span, vis_mode = best_vis_mode, extract_pattern = extract_pattern } end H.iterate_matched_spans = function(line, nested_pattern, f) @@ -1842,12 +1841,12 @@ H.get_neighborhood = function(reference_region, n_neighbors) end -- Convert 1d span to 2d region - local span_to_region = function(span) + local span_to_region = function(span, vis_mode) if span == nil then return nil end -- NOTE: this might lead to outside of line positions due to added `\n` at -- the end of lines in 1d-neighborhood. However, this is crucial for -- allowing `i` textobjects to collapse multiline selections. - local res = { from = offset_to_pos(span.from) } + local res = { from = offset_to_pos(span.from), vis_mode = vis_mode } -- Convert empty span to empty region if span.from < span.to then res.to = offset_to_pos(span.to - 1) end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/align.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/align.lua index da4fa7e8..67bb6022 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/align.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/align.lua @@ -1330,8 +1330,10 @@ end H.is_disabled = function() return vim.g.minialign_disable == true or vim.b.minialign_disable == true end -H.get_config = function(config) - return vim.tbl_deep_extend('force', MiniAlign.config, vim.b.minialign_config or {}, config or {}) +H.get_config = function() + -- Using `tbl_deep_extend()` works even in presense of `steps.pre_*` arrays + -- because default ones are empty. + return vim.tbl_deep_extend('force', MiniAlign.config, vim.b.minialign_config or {}) end -- Mappings ------------------------------------------------------------------- @@ -1396,7 +1398,8 @@ end H.normalize_steps = function(steps, steps_name) -- Infer all defaults from module config - local res = vim.tbl_deep_extend('force', H.get_config().steps, steps or {}) + -- NOTE: Don't use `tbl_deep_extend` to prefer full input arrays (if present) + local res = vim.tbl_extend('force', H.get_config().steps, steps or {}) H.validate_steps(res, steps_name) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/animate.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/animate.lua index 06242f1d..30b0366f 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/animate.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/animate.lua @@ -1211,10 +1211,10 @@ end H.apply_config = function(config) MiniAnimate.config = config end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniAnimate', {}) + local gr = vim.api.nvim_create_augroup('MiniAnimate', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au('CursorMoved', '*', H.auto_cursor, 'Animate cursor') @@ -1246,7 +1246,7 @@ H.create_autocommands = function() au('WinClosed', '*', function() H.auto_openclose('close') end, 'Animate window close') - au('ColorScheme', '*', H.create_default_hl, 'Ensure proper colors') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end H.create_default_hl = function() @@ -1783,8 +1783,7 @@ H.make_openclose_step = function(action_type, win_id, config) vim.api.nvim_win_set_config(float_win_id, float_config) end - local new_winblend = H.round(winblend(step, n_steps)) - vim.api.nvim_win_set_option(float_win_id, 'winblend', new_winblend) + vim.wo[float_win_id].winblend = H.round(winblend(step, n_steps)) return true end, diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/base16.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/base16.lua index 6f7cfbe9..2830a83c 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/base16.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/base16.lua @@ -33,6 +33,7 @@ --- - 'HiPhish/rainbow-delimiters.nvim' --- - 'hrsh7th/nvim-cmp' --- - 'justinmk/vim-sneak' +--- - 'kevinhwang91/nvim-bqf' --- - 'kevinhwang91/nvim-ufo' --- - 'lewis6991/gitsigns.nvim' --- - 'lukas-reineke/indent-blankline.nvim' @@ -468,73 +469,79 @@ H.apply_palette = function(palette, use_cterm) -- stylua: ignore start -- Builtin highlighting groups. Some groups which are missing in 'base16-vim' -- are added based on groups to which they are linked. - hi('ColorColumn', {fg=nil, bg=p.base01, attr=nil, sp=nil}) - hi('Conceal', {fg=p.base0D, bg=nil, attr=nil, sp=nil}) - hi('CurSearch', {fg=p.base01, bg=p.base09, attr=nil, sp=nil}) - hi('Cursor', {fg=p.base00, bg=p.base05, attr=nil, sp=nil}) - hi('CursorColumn', {fg=nil, bg=p.base01, attr=nil, sp=nil}) - hi('CursorIM', {fg=p.base00, bg=p.base05, attr=nil, sp=nil}) - hi('CursorLine', {fg=nil, bg=p.base01, attr=nil, sp=nil}) - hi('CursorLineFold', {fg=p.base0C, bg=p.base01, attr=nil, sp=nil}) - hi('CursorLineNr', {fg=p.base04, bg=p.base01, attr=nil, sp=nil}) - hi('CursorLineSign', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) - hi('DiffAdd', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil}) + hi('ColorColumn', {fg=nil, bg=p.base01, attr=nil, sp=nil}) + hi('Conceal', {fg=p.base0D, bg=nil, attr=nil, sp=nil}) + hi('CurSearch', {fg=p.base01, bg=p.base09, attr=nil, sp=nil}) + hi('Cursor', {fg=p.base00, bg=p.base05, attr=nil, sp=nil}) + hi('CursorColumn', {fg=nil, bg=p.base01, attr=nil, sp=nil}) + hi('CursorIM', {fg=p.base00, bg=p.base05, attr=nil, sp=nil}) + hi('CursorLine', {fg=nil, bg=p.base01, attr=nil, sp=nil}) + hi('CursorLineFold', {fg=p.base0C, bg=p.base01, attr=nil, sp=nil}) + hi('CursorLineNr', {fg=p.base04, bg=p.base01, attr=nil, sp=nil}) + hi('CursorLineSign', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) + hi('DiffAdd', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil}) -- Differs from base16-vim, but according to general style guide - hi('DiffChange', {fg=p.base0E, bg=p.base01, attr=nil, sp=nil}) - hi('DiffDelete', {fg=p.base08, bg=p.base01, attr=nil, sp=nil}) - hi('DiffText', {fg=p.base0D, bg=p.base01, attr=nil, sp=nil}) - hi('Directory', {fg=p.base0D, bg=nil, attr=nil, sp=nil}) - hi('EndOfBuffer', {fg=p.base03, bg=nil, attr=nil, sp=nil}) - hi('ErrorMsg', {fg=p.base08, bg=p.base00, attr=nil, sp=nil}) - hi('FoldColumn', {fg=p.base0C, bg=p.base01, attr=nil, sp=nil}) - hi('Folded', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) - hi('IncSearch', {fg=p.base01, bg=p.base09, attr=nil, sp=nil}) - hi('lCursor', {fg=p.base00, bg=p.base05, attr=nil, sp=nil}) - hi('LineNr', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) - hi('LineNrAbove', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) - hi('LineNrBelow', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) + hi('DiffChange', {fg=p.base0E, bg=p.base01, attr=nil, sp=nil}) + hi('DiffDelete', {fg=p.base08, bg=p.base01, attr=nil, sp=nil}) + hi('DiffText', {fg=p.base0D, bg=p.base01, attr=nil, sp=nil}) + hi('Directory', {fg=p.base0D, bg=nil, attr=nil, sp=nil}) + hi('EndOfBuffer', {fg=p.base03, bg=nil, attr=nil, sp=nil}) + hi('ErrorMsg', {fg=p.base08, bg=p.base00, attr=nil, sp=nil}) + hi('FoldColumn', {fg=p.base0C, bg=p.base01, attr=nil, sp=nil}) + hi('Folded', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) + hi('IncSearch', {fg=p.base01, bg=p.base09, attr=nil, sp=nil}) + hi('lCursor', {fg=p.base00, bg=p.base05, attr=nil, sp=nil}) + hi('LineNr', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) + hi('LineNrAbove', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) + hi('LineNrBelow', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) -- Slight difference from base16, where `bg=base03` is used. This makes -- it possible to comfortably see this highlighting in comments. - hi('MatchParen', {fg=nil, bg=p.base02, attr=nil, sp=nil}) - hi('ModeMsg', {fg=p.base0B, bg=nil, attr=nil, sp=nil}) - hi('MoreMsg', {fg=p.base0B, bg=nil, attr=nil, sp=nil}) - hi('MsgArea', {fg=p.base05, bg=p.base00, attr=nil, sp=nil}) - hi('MsgSeparator', {fg=p.base04, bg=p.base02, attr=nil, sp=nil}) - hi('NonText', {fg=p.base03, bg=nil, attr=nil, sp=nil}) - hi('Normal', {fg=p.base05, bg=p.base00, attr=nil, sp=nil}) - hi('NormalFloat', {fg=p.base05, bg=p.base01, attr=nil, sp=nil}) - hi('NormalNC', {fg=p.base05, bg=p.base00, attr=nil, sp=nil}) - hi('PMenu', {fg=p.base05, bg=p.base01, attr=nil, sp=nil}) - hi('PMenuSbar', {fg=nil, bg=p.base02, attr=nil, sp=nil}) - hi('PMenuSel', {fg=p.base01, bg=p.base05, attr=nil, sp=nil}) - hi('PMenuThumb', {fg=nil, bg=p.base07, attr=nil, sp=nil}) - hi('Question', {fg=p.base0D, bg=nil, attr=nil, sp=nil}) - hi('QuickFixLine', {fg=nil, bg=p.base01, attr=nil, sp=nil}) - hi('Search', {fg=p.base01, bg=p.base0A, attr=nil, sp=nil}) - hi('SignColumn', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) - hi('SpecialKey', {fg=p.base03, bg=nil, attr=nil, sp=nil}) - hi('SpellBad', {fg=nil, bg=nil, attr='undercurl', sp=p.base08}) - hi('SpellCap', {fg=nil, bg=nil, attr='undercurl', sp=p.base0D}) - hi('SpellLocal', {fg=nil, bg=nil, attr='undercurl', sp=p.base0C}) - hi('SpellRare', {fg=nil, bg=nil, attr='undercurl', sp=p.base0E}) - hi('StatusLine', {fg=p.base04, bg=p.base02, attr=nil, sp=nil}) - hi('StatusLineNC', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) - hi('Substitute', {fg=p.base01, bg=p.base0A, attr=nil, sp=nil}) - hi('TabLine', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) - hi('TabLineFill', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) - hi('TabLineSel', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil}) - hi('TermCursor', {fg=nil, bg=nil, attr='reverse', sp=nil}) - hi('TermCursorNC', {fg=nil, bg=nil, attr='reverse', sp=nil}) - hi('Title', {fg=p.base0D, bg=nil, attr=nil, sp=nil}) - hi('VertSplit', {fg=p.base02, bg=p.base02, attr=nil, sp=nil}) - hi('Visual', {fg=nil, bg=p.base02, attr=nil, sp=nil}) - hi('VisualNOS', {fg=p.base08, bg=nil, attr=nil, sp=nil}) - hi('WarningMsg', {fg=p.base08, bg=nil, attr=nil, sp=nil}) - hi('Whitespace', {fg=p.base03, bg=nil, attr=nil, sp=nil}) - hi('WildMenu', {fg=p.base08, bg=p.base0A, attr=nil, sp=nil}) - hi('WinBar', {fg=p.base04, bg=p.base02, attr=nil, sp=nil}) - hi('WinBarNC', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) - hi('WinSeparator', {fg=p.base02, bg=p.base02, attr=nil, sp=nil}) + hi('MatchParen', {fg=nil, bg=p.base02, attr=nil, sp=nil}) + hi('ModeMsg', {fg=p.base0B, bg=nil, attr=nil, sp=nil}) + hi('MoreMsg', {fg=p.base0B, bg=nil, attr=nil, sp=nil}) + hi('MsgArea', {fg=p.base05, bg=p.base00, attr=nil, sp=nil}) + hi('MsgSeparator', {fg=p.base04, bg=p.base02, attr=nil, sp=nil}) + hi('NonText', {fg=p.base03, bg=nil, attr=nil, sp=nil}) + hi('Normal', {fg=p.base05, bg=p.base00, attr=nil, sp=nil}) + hi('NormalFloat', {fg=p.base05, bg=p.base01, attr=nil, sp=nil}) + hi('NormalNC', {fg=p.base05, bg=p.base00, attr=nil, sp=nil}) + hi('Pmenu', {fg=p.base05, bg=p.base01, attr=nil, sp=nil}) + hi('PmenuExtra', {fg=p.base05, bg=p.base01, attr=nil, sp=nil}) + hi('PmenuExtraSel', {fg=p.base05, bg=p.base01, attr='reverse', sp=nil}) + hi('PmenuKind', {fg=p.base05, bg=p.base01, attr=nil, sp=nil}) + hi('PmenuKindSel', {fg=p.base05, bg=p.base01, attr='reverse', sp=nil}) + hi('PmenuMatch', {fg=p.base05, bg=p.base01, attr='bold', sp=nil}) + hi('PmenuMatchSel', {fg=p.base05, bg=p.base01, attr='bold,reverse', sp=nil}) + hi('PmenuSbar', {fg=nil, bg=p.base02, attr=nil, sp=nil}) + hi('PmenuSel', {fg=p.base05, bg=p.base01, attr='reverse', sp=nil}) + hi('PmenuThumb', {fg=nil, bg=p.base07, attr=nil, sp=nil}) + hi('Question', {fg=p.base0D, bg=nil, attr=nil, sp=nil}) + hi('QuickFixLine', {fg=nil, bg=p.base01, attr=nil, sp=nil}) + hi('Search', {fg=p.base01, bg=p.base0A, attr=nil, sp=nil}) + hi('SignColumn', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) + hi('SpecialKey', {fg=p.base03, bg=nil, attr=nil, sp=nil}) + hi('SpellBad', {fg=nil, bg=nil, attr='undercurl', sp=p.base08}) + hi('SpellCap', {fg=nil, bg=nil, attr='undercurl', sp=p.base0D}) + hi('SpellLocal', {fg=nil, bg=nil, attr='undercurl', sp=p.base0C}) + hi('SpellRare', {fg=nil, bg=nil, attr='undercurl', sp=p.base0E}) + hi('StatusLine', {fg=p.base04, bg=p.base02, attr=nil, sp=nil}) + hi('StatusLineNC', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) + hi('Substitute', {fg=p.base01, bg=p.base0A, attr=nil, sp=nil}) + hi('TabLine', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) + hi('TabLineFill', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) + hi('TabLineSel', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil}) + hi('TermCursor', {fg=nil, bg=nil, attr='reverse', sp=nil}) + hi('TermCursorNC', {fg=nil, bg=nil, attr='reverse', sp=nil}) + hi('Title', {fg=p.base0D, bg=nil, attr=nil, sp=nil}) + hi('VertSplit', {fg=p.base02, bg=p.base02, attr=nil, sp=nil}) + hi('Visual', {fg=nil, bg=p.base02, attr=nil, sp=nil}) + hi('VisualNOS', {fg=p.base08, bg=nil, attr=nil, sp=nil}) + hi('WarningMsg', {fg=p.base08, bg=nil, attr=nil, sp=nil}) + hi('Whitespace', {fg=p.base03, bg=nil, attr=nil, sp=nil}) + hi('WildMenu', {fg=p.base08, bg=p.base0A, attr=nil, sp=nil}) + hi('WinBar', {fg=p.base04, bg=p.base02, attr=nil, sp=nil}) + hi('WinBarNC', {fg=p.base03, bg=p.base01, attr=nil, sp=nil}) + hi('WinSeparator', {fg=p.base02, bg=p.base02, attr=nil, sp=nil}) -- Standard syntax (affects treesitter) hi('Boolean', {fg=p.base09, bg=nil, attr=nil, sp=nil}) @@ -649,9 +656,10 @@ H.apply_palette = function(palette, use_cterm) hi('@symbol', {fg=p.base0E, bg=nil, attr=nil, sp=nil}) hi('@variable', {fg=p.base05, bg=nil, attr=nil, sp=nil}) - hi('@text.strong', {fg=nil, bg=nil, attr='bold', sp=nil}) - hi('@text.emphasis', {fg=nil, bg=nil, attr='italic', sp=nil}) - hi('@text.strike', {fg=nil, bg=nil, attr='strikethrough', sp=nil}) + hi('@text.strong', {fg=nil, bg=nil, attr='bold', sp=nil}) + hi('@text.emphasis', {fg=nil, bg=nil, attr='italic', sp=nil}) + hi('@text.strike', {fg=nil, bg=nil, attr='strikethrough', sp=nil}) + hi('@text.underline', {link='Underlined'}) -- Semantic tokens if vim.fn.has('nvim-0.9') == 1 then @@ -669,8 +677,11 @@ H.apply_palette = function(palette, use_cterm) -- Included only those differing from default links hi('@markup.strong', {link='@text.strong'}) hi('@markup.italic', {link='@text.emphasis'}) - hi('@markup.strikethrough', {link='@text.strikethrough'}) + hi('@markup.strikethrough', {link='@text.strike'}) hi('@markup.underline', {link='@text.underline'}) + + hi('@string.special.vimdoc', {link='SpecialChar'}) + hi('@variable.parameter.vimdoc', {fg=p.base09, bg=nil, attr=nil, sp=nil}) end -- Plugins @@ -757,18 +768,19 @@ H.apply_palette = function(palette, use_cterm) hi('MiniOperatorsExchangeFrom', {link='IncSearch'}) hi('MiniPickBorder', {link='NormalFloat'}) - hi('MiniPickBorderBusy', {fg=p.base0E, bg=p.base01, attr=nil, sp=nil}) - hi('MiniPickBorderText', {fg=p.base0D, bg=p.base01, attr='bold', sp=nil}) + hi('MiniPickBorderBusy', {fg=p.base0E, bg=p.base01, attr=nil, sp=nil}) + hi('MiniPickBorderText', {fg=p.base0D, bg=p.base01, attr='bold', sp=nil}) + hi('MiniPickCursor', {fg=nil, bg=nil, attr='nocombine', sp=nil, blend=100}) hi('MiniPickIconDirectory', {link='Directory'}) - hi('MiniPickIconFile', {fg=p.base05, bg=nil, attr=nil, sp=nil}) + hi('MiniPickIconFile', {fg=p.base05, bg=nil, attr=nil, sp=nil}) hi('MiniPickHeader', {link='DiagnosticFloatingHint'}) - hi('MiniPickMatchCurrent', {fg=nil, bg=p.base02, attr=nil, sp=nil}) - hi('MiniPickMatchMarked', {fg=nil, bg=p.base03, attr=nil, sp=nil}) + hi('MiniPickMatchCurrent', {fg=nil, bg=p.base02, attr=nil, sp=nil}) + hi('MiniPickMatchMarked', {fg=nil, bg=p.base03, attr=nil, sp=nil}) hi('MiniPickMatchRanges', {link='DiagnosticFloatingHint'}) hi('MiniPickNormal', {link='NormalFloat'}) - hi('MiniPickPreviewLine', {fg=nil, bg=p.base02, attr=nil, sp=nil}) + hi('MiniPickPreviewLine', {fg=nil, bg=p.base02, attr=nil, sp=nil}) hi('MiniPickPreviewRegion', {link='IncSearch'}) - hi('MiniPickPrompt', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil}) + hi('MiniPickPrompt', {fg=p.base0B, bg=p.base01, attr=nil, sp=nil}) hi('MiniStarterCurrent', {fg=nil, bg=nil, attr=nil, sp=nil}) hi('MiniStarterFooter', {fg=p.base0D, bg=nil, attr=nil, sp=nil}) @@ -995,6 +1007,13 @@ H.apply_palette = function(palette, use_cterm) hi('SneakLabel', {fg=p.base00, bg=p.base0E, attr='bold', sp=nil}) end + -- 'kevinhwang91/nvim-bqf' + if H.has_integration('kevinhwang91/nvim-bqf') then + hi('BqfPreviewFloat', {link='NormalFloat'}) + hi('BqfPreviewTitle', {fg=p.base0D, bg=p.base01, attr=nil, sp=nil}) + hi('BqfSign', {fg=p.base0C, bg=p.base01, attr=nil, sp=nil}) + end + -- 'kevinhwang91/nvim-ufo' -- Everything works correctly out of the box @@ -1238,12 +1257,13 @@ H.highlight_gui = function(group, args) command = string.format('highlight! link %s %s', group, args.link) else command = string.format( - 'highlight %s guifg=%s guibg=%s gui=%s guisp=%s', + 'highlight %s guifg=%s guibg=%s gui=%s guisp=%s blend=%s', group, args.fg or 'NONE', args.bg or 'NONE', args.attr or 'NONE', - args.sp or 'NONE' + args.sp or 'NONE', + args.blend or 'NONE' ) end vim.cmd(command) @@ -1255,7 +1275,7 @@ H.highlight_both = function(group, args) command = string.format('highlight! link %s %s', group, args.link) else command = string.format( - 'highlight %s guifg=%s ctermfg=%s guibg=%s ctermbg=%s gui=%s cterm=%s guisp=%s', + 'highlight %s guifg=%s ctermfg=%s guibg=%s ctermbg=%s gui=%s cterm=%s guisp=%s blend=%s', group, args.fg and args.fg.gui or 'NONE', args.fg and args.fg.cterm or 'NONE', @@ -1263,7 +1283,8 @@ H.highlight_both = function(group, args) args.bg and args.bg.cterm or 'NONE', args.attr or 'NONE', args.attr or 'NONE', - args.sp and args.sp.gui or 'NONE' + args.sp and args.sp.gui or 'NONE', + args.blend or 'NONE' ) end vim.cmd(command) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/basics.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/basics.lua index 853198a7..5f185fb8 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/basics.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/basics.lua @@ -708,10 +708,10 @@ end -- Autocommands --------------------------------------------------------------- H.apply_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniBasicsAutocommands', {}) + local gr = vim.api.nvim_create_augroup('MiniBasicsAutocommands', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end if config.autocommands.basic then diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/bracketed.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/bracketed.lua index 4631e58f..d1209986 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/bracketed.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/bracketed.lua @@ -342,7 +342,7 @@ MiniBracketed.comment = function(direction, opts) if opts.add_to_jumplist then H.add_to_jumplist() end -- Apply. Open just enough folds and put cursor on first non-blank. - vim.api.nvim_win_set_cursor(0, { res_line_num, 0 }) + H.set_cursor(res_line_num, 0) vim.cmd('normal! zv^') end @@ -404,7 +404,7 @@ MiniBracketed.conflict = function(direction, opts) if opts.add_to_jumplist then H.add_to_jumplist() end -- Apply. Open just enough folds and put cursor on first non-blank. - vim.api.nvim_win_set_cursor(0, { res_line_num, 0 }) + H.set_cursor(res_line_num, 0) vim.cmd('normal! zv^') end @@ -643,7 +643,7 @@ MiniBracketed.indent = function(direction, opts) if opts.add_to_jumplist then H.add_to_jumplist() end -- Apply. Open just enough folds and put cursor on first non-blank. - vim.api.nvim_win_set_cursor(0, { res_line_num, 0 }) + H.set_cursor(res_line_num, 0) vim.cmd('normal! zv^') end @@ -919,8 +919,7 @@ MiniBracketed.treesitter = function(direction, opts) if opts.add_to_jumplist then H.add_to_jumplist() end -- Apply - local row, col = res_node_pos.pos[1], res_node_pos.pos[2] - vim.api.nvim_win_set_cursor(0, { row + 1, col }) + H.set_cursor(res_node_pos.pos[1] + 1, res_node_pos.pos[2]) end --- Undo along a tracked linear history @@ -1136,12 +1135,9 @@ MiniBracketed.yank = function(direction, opts) if H.is_disabled() then return end H.validate_direction(direction, { 'first', 'backward', 'forward', 'last' }, 'yank') - opts = vim.tbl_deep_extend( - 'force', - { n_times = vim.v.count1, operators = { 'c', 'd', 'y' }, wrap = true }, - H.get_config().yank.options, - opts or {} - ) + -- NOTE: Don't use `tbl_deep_extend` to prefer full input `operators` array + local default_opts = { n_times = vim.v.count1, operators = { 'c', 'd', 'y' }, wrap = true } + opts = vim.tbl_extend('force', default_opts, H.get_config().yank.options, opts or {}) -- Update yank history data local cache_yank, history = H.cache.yank, H.cache.yank.history @@ -1600,10 +1596,10 @@ end H.get_suffix_variants = function(char) return char:lower(), char:upper() end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniBracketed', {}) + local gr = vim.api.nvim_create_augroup('MiniBracketed', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au('BufEnter', '*', H.track_oldfile, 'Track oldfile') @@ -1975,7 +1971,7 @@ end H.region_delete = function(region, normal_fun) -- Start with `to` to have cursor positioned on region start after deletion - vim.api.nvim_win_set_cursor(0, { region.to.line, region.to.col - 1 }) + H.set_cursor(region.to.line, region.to.col - 1) -- Do nothing more if region is empty (or leads to unnecessary line deletion) local is_empty = region.from.line == region.to.line @@ -1986,7 +1982,7 @@ H.region_delete = function(region, normal_fun) -- Select region in correct Visual mode normal_fun(region.mode) - vim.api.nvim_win_set_cursor(0, { region.from.line, region.from.col - 1 }) + H.set_cursor(region.from.line, region.from.col - 1) -- Delete region in "black hole" register -- - NOTE: it doesn't affect history as `"_` doesn't trigger `TextYankPost` @@ -2017,4 +2013,12 @@ end H.add_to_jumplist = function() vim.cmd([[normal! m']]) end +H.set_cursor = function(row, col) + if row <= 0 then return vim.api.nvim_win_set_cursor(0, { 1, 0 }) end + local n_lines = vim.api.nvim_buf_line_count(0) + if n_lines < row then return vim.api.nvim_win_set_cursor(0, { n_lines, vim.fn.getline(n_lines):len() - 1 }) end + col = math.min(math.max(col, 0), vim.fn.getline(row):len()) + return vim.api.nvim_win_set_cursor(0, { row, col }) +end + return MiniBracketed diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/clue.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/clue.lua index a120c997..8227d51d 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/clue.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/clue.lua @@ -492,7 +492,7 @@ MiniClue.setup = function(config) H.apply_config(config) -- Define behavior - H.create_autocommands(config) + H.create_autocommands() -- Create default highlighting H.create_default_hl() @@ -1171,11 +1171,11 @@ H.is_disabled = function(buf_id) return vim.g.miniclue_disable == true or buf_disable == true end -H.create_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniClue', {}) +H.create_autocommands = function() + local gr = vim.api.nvim_create_augroup('MiniClue', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end -- Ensure buffer-local mappings for triggers are the latest ones to fully @@ -1195,6 +1195,7 @@ H.create_autocommands = function(config) au('RecordingLeave', '*', MiniClue.enable_all_triggers, 'Enable all triggers') au('VimResized', '*', H.window_update, 'Update window on resize') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end --stylua: ignore @@ -1557,6 +1558,7 @@ H.window_open = function(config) local win_id = vim.api.nvim_open_win(H.state.buf_id, false, config) vim.wo[win_id].foldenable = false + vim.wo[win_id].foldmethod = 'manual' vim.wo[win_id].wrap = false vim.wo[win_id].list = true vim.wo[win_id].listchars = 'extends:…' diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/completion.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/completion.lua index fa42e23f..c7c76371 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/completion.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/completion.lua @@ -45,12 +45,25 @@ --- ``) or fallback completion via --- |MiniCompletion.complete_fallback()| (mapped to ``). --- +--- - LSP kind highlighting ("Function", "Keyword", etc.). Requires Neovim>=0.11. +--- By default uses "lsp" category of |MiniIcons| (if enabled). Can be customized +--- via `config.lsp_completion.process_items` by adding field +--- (same meaning as in |complete-items|) to items. +--- --- What it doesn't do: --- - Snippet expansion. --- - Many configurable sources. --- - Automatic mapping of ``, ``, etc., as those tend to have highly --- variable user expectations. See 'Helpful key mappings' for suggestions. --- +--- # Dependencies ~ +--- +--- Suggested dependencies (provide extra functionality, will work without them): +--- +--- - Enabled |MiniIcons| module to highlight LSP kind (requires Neovim>=0.11). +--- Otherwise |MiniCompletion.default_process_items()| does not add highlighting. +--- Also take a look at |MiniIcons.tweak_lsp_kind()|. +--- --- # Setup ~ --- --- This module needs a setup with `require('mini.completion').setup({})` @@ -252,12 +265,10 @@ MiniCompletion.config = { -- on every `BufEnter` event. auto_setup = true, - -- `process_items` should be a function which takes LSP - -- 'textDocument/completion' response items and word to complete. Its - -- output should be a table of the same nature as input items. The most - -- common use-cases are custom filtering and sorting. You can use - -- default `process_items` as `MiniCompletion.default_process_items()`. - --minidoc_replace_start process_items = --, + -- A function which takes LSP 'textDocument/completion' response items + -- and word to complete. Output should be a table of the same nature as + -- input items. Common use case is custom filter/sort. + --minidoc_replace_start process_items = --, process_items = function(items, base) local res = vim.tbl_filter(function(item) -- Keep items which match the base and are not snippets @@ -265,8 +276,17 @@ MiniCompletion.config = { return vim.startswith(text, base) and item.kind ~= 15 end, items) + res = vim.deepcopy(res) table.sort(res, function(a, b) return (a.sortText or a.label) < (b.sortText or b.label) end) + -- Possibly add "kind" highlighting + if _G.MiniIcons ~= nil then + local add_kind_hlgroup = H.make_add_kind_hlgroup() + for _, item in ipairs(res) do + add_kind_hlgroup(item) + end + end + return res end, --minidoc_replace_end @@ -410,6 +430,11 @@ MiniCompletion.completefunc_lsp = function(findstart, base) end --- Default `MiniCompletion.config.lsp_completion.process_items` +--- +--- Steps: +--- - Filter out items not matching `base` and snippet items. +--- - Sort by LSP specification. +--- - If |MiniIcons| is enabled, add based on the "lsp" category. MiniCompletion.default_process_items = function(items, base) return H.default_config.lsp_completion.process_items(items, base) end @@ -550,10 +575,10 @@ H.apply_config = function(config) end H.create_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniCompletion', {}) + local gr = vim.api.nvim_create_augroup('MiniCompletion', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au('InsertCharPre', '*', H.auto_completion, 'Auto show completion') @@ -570,7 +595,7 @@ H.create_autocommands = function(config) au('BufEnter', '*', callback, 'Set completion function') end - au('ColorScheme', '*', H.create_default_hl, 'Ensure proper colors') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') au('FileType', 'TelescopePrompt', function() vim.b.minicompletion_disable = true end, 'Disable locally') end @@ -850,19 +875,19 @@ H.is_lsp_current = function(cache, id) return cache.lsp.id == id and cache.lsp.s H.lsp_completion_response_items_to_complete_items = function(items, client_id) if vim.tbl_count(items) == 0 then return {} end - local res = {} - local docs, info + local res, item_kinds = {}, vim.lsp.protocol.CompletionItemKind for _, item in pairs(items) do -- Documentation info - docs = item.documentation - info = H.table_get(docs, { 'value' }) + local docs = item.documentation + local info = H.table_get(docs, { 'value' }) if not info and type(docs) == 'string' then info = docs end info = info or '' table.insert(res, { word = H.get_completion_word(item), abbr = item.label, - kind = vim.lsp.protocol.CompletionItemKind[item.kind] or 'Unknown', + kind = item_kinds[item.kind] or 'Unknown', + kind_hlgroup = item.kind_hlgroup, menu = item.detail or '', info = info, icase = 1, @@ -874,6 +899,25 @@ H.lsp_completion_response_items_to_complete_items = function(items, client_id) return res end +H.make_add_kind_hlgroup = function() + -- Account for possible effect of `MiniIcons.tweak_lsp_kind()` which modifies + -- only array part of `CompletionItemKind` but not "map" part + if H.kind_map == nil then + -- Cache kind map so as to not recompute it each time (as it will be called + -- in performance sensitive context). Assumes `tweak_lsp_kind()` is called + -- right after `require('mini.icons').setup()`. + H.kind_map = {} + for k, v in pairs(vim.lsp.protocol.CompletionItemKind) do + if type(k) == 'string' and type(v) == 'number' then H.kind_map[v] = k end + end + end + + return function(item) + local _, hl, is_default = _G.MiniIcons.get('lsp', H.kind_map[item.kind] or 'Unknown') + item.kind_hlgroup = not is_default and hl or nil + end +end + H.get_completion_word = function(item) -- Completion word (textEdit.newText > insertText > label). This doesn't -- support snippet expansion. @@ -1280,10 +1324,13 @@ H.floating_dimensions = function(lines, max_height, max_width) end H.open_action_window = function(cache, opts) - cache.win_id = vim.api.nvim_open_win(cache.bufnr, false, opts) - vim.api.nvim_win_set_option(cache.win_id, 'wrap', true) - vim.api.nvim_win_set_option(cache.win_id, 'linebreak', true) - vim.api.nvim_win_set_option(cache.win_id, 'breakindent', false) + local win_id = vim.api.nvim_open_win(cache.bufnr, false, opts) + vim.wo[win_id].breakindent = false + vim.wo[win_id].foldenable = false + vim.wo[win_id].foldmethod = 'manual' + vim.wo[win_id].linebreak = true + vim.wo[win_id].wrap = true + cache.win_id = win_id end H.close_action_window = function(cache, keep_timer) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/cursorword.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/cursorword.lua index b4930099..5f4b1e86 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/cursorword.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/cursorword.lua @@ -157,17 +157,17 @@ H.apply_config = function(config) end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniCursorword', {}) + local gr = vim.api.nvim_create_augroup('MiniCursorword', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au('CursorMoved', '*', H.auto_highlight, 'Auto highlight cursorword') au({ 'InsertEnter', 'TermEnter', 'QuitPre' }, '*', H.auto_unhighlight, 'Auto unhighlight cursorword') au('ModeChanged', '*:[^i]', H.auto_highlight, 'Auto highlight cursorword') - au('ColorScheme', '*', H.create_default_hl, 'Ensure proper colors') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') au('FileType', 'TelescopePrompt', function() vim.b.minicursorword_disable = true end, 'Disable locally') end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/deps.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/deps.lua index 1f3fb057..c3c497d7 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/deps.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/deps.lua @@ -366,6 +366,9 @@ MiniDeps.setup = function(config) -- Apply config H.apply_config(config) + -- Define behavior + H.create_autocommands() + -- Create default highlighting H.create_default_hl() @@ -710,9 +713,11 @@ MiniDeps.get_session = function() -- Add 'start/' plugins that are in 'rtp'. NOTE: not whole session concept is -- built around presence in 'rtp' to 100% ensure to preserve the order in -- which user called `add()`. - local start_path = H.get_package_path() .. '/pack/deps/start' + local start_path = H.full_path(H.get_package_path() .. '/pack/deps/start') local pattern = string.format('^%s/([^/]+)$', vim.pesc(start_path)) - for _, path in ipairs(vim.api.nvim_list_runtime_paths()) do + for _, runtime_path in ipairs(vim.api.nvim_list_runtime_paths()) do + -- Make sure plugin path is normalized (matters on Windows) + local path = H.full_path(runtime_path) local name = string.match(path, pattern) if name ~= nil then add_spec({ path = path, name = name, hooks = {}, depends = {} }) end end @@ -818,6 +823,11 @@ H.get_config = function(config) return vim.tbl_deep_extend('force', MiniDeps.config, vim.b.minideps_config or {}, config or {}) end +H.create_autocommands = function() + local gr = vim.api.nvim_create_augroup('MiniDeps', {}) + vim.api.nvim_create_autocmd('ColorScheme', { group = gr, callback = H.create_default_hl, desc = 'Ensure colors' }) +end + --stylua: ignore H.create_default_hl = function() local hi = function(name, opts) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/diff.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/diff.lua index df143bb5..40665f07 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/diff.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/diff.lua @@ -981,16 +981,17 @@ H.apply_config = function(config) end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniDiff', {}) + local gr = vim.api.nvim_create_augroup('MiniDiff', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end -- NOTE: Try auto enabling buffer on every `BufEnter` to not have `:edit` -- disabling buffer, as it calls `on_detach()` from buffer watcher au('BufEnter', '*', H.auto_enable, 'Enable diff') au('VimResized', '*', H.on_resize, 'Track Neovim resizing') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end --stylua: ignore diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/doc.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/doc.lua index f4eaf01c..6636edcd 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/doc.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/doc.lua @@ -808,11 +808,11 @@ end -- Default documentation targets ---------------------------------------------- H.default_input = function() - -- Search in current and recursively in other directories for files with - -- 'lua' extension + -- Search in current and recursively in other directories for Lua files local res = {} - for _, dir_glob in ipairs({ '.', 'lua/**', 'after/**', 'colors/**' }) do - local files = vim.fn.globpath(dir_glob, '*.lua', false, true) + for _, dir in ipairs({ '.', 'lua', 'after', 'colors' }) do + local glob = (dir == '.' and '' or '**/') .. '*.lua' + local files = vim.fn.globpath(dir, glob, false, true) -- Use full paths files = vim.tbl_map(function(x) return vim.fn.fnamemodify(x, ':p') end, files) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/extra.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/extra.lua index 1110a844..60ac5ba0 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/extra.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/extra.lua @@ -64,6 +64,8 @@ --- - Requires target path to be part of git repository. --- - Present for exploration and navigation purposes. Doing any Git operations --- is suggested to be done in a dedicated Git client and is not planned. +---@alias __extra_pickers_preserve_order - `(boolean)` - whether to preserve original order +--- during query. Default: `false`. ---@alias __extra_pickers_git_path - `(string|nil)` - target path for Git operation (if required). Also --- used to find Git repository inside which to construct items. --- Default: `nil` for root of Git repository containing |current-directory|. @@ -324,12 +326,13 @@ MiniExtra.pickers = {} --- Possible fields: --- - `(string)` - one of "all" (normal listed buffers) or "current". --- Default: "all". +--- __extra_pickers_preserve_order ---@param opts __extra_pickers_opts --- ---@return __extra_pickers_return MiniExtra.pickers.buf_lines = function(local_opts, opts) local pick = H.validate_pick('buf_lines') - local_opts = vim.tbl_deep_extend('force', { scope = 'all' }, local_opts or {}) + local_opts = vim.tbl_deep_extend('force', { scope = 'all', preserve_order = false }, local_opts or {}) local scope = H.pick_validate_scope(local_opts, { 'all', 'current' }, 'buf_lines') local is_scope_all = scope == 'all' @@ -352,9 +355,11 @@ MiniExtra.pickers.buf_lines = function(local_opts, opts) if not poke_picker() then return end H.buf_ensure_loaded(buf_id) local buf_name = H.buf_get_name(buf_id) or '' + local n_digits = math.floor(math.log10(vim.api.nvim_buf_line_count(buf_id))) + 1 + local format_pattern = '%s%' .. n_digits .. 'd\0%s' for lnum, l in ipairs(vim.api.nvim_buf_get_lines(buf_id, 0, -1, false)) do - local prefix = is_scope_all and string.format('%s\0', buf_name) or '' - table.insert(items, { text = string.format('%s%s\0%s', prefix, lnum, l), bufnr = buf_id, lnum = lnum }) + local prefix = is_scope_all and (buf_name .. '\0') or '' + table.insert(items, { text = format_pattern:format(prefix, lnum, l), bufnr = buf_id, lnum = lnum }) end end pick.set_picker_items(items) @@ -363,7 +368,10 @@ MiniExtra.pickers.buf_lines = function(local_opts, opts) local show = H.pick_get_config().source.show if is_scope_all and show == nil then show = H.show_with_icons end - return H.pick_start(items, { source = { name = string.format('Buffer lines (%s)', scope), show = show } }, opts) + local match_opts = { preserve_order = local_opts.preserve_order } + local match = function(stritems, inds, query) pick.default_match(stritems, inds, query, match_opts) end + local default_source = { name = string.format('Buffer lines (%s)', scope), show = show, match = match } + return H.pick_start(items, { source = default_source }, opts) end --- Neovim commands picker @@ -1089,7 +1097,7 @@ end --- under cursor. --- - `:Pick lsp scope='document_symbol'` - symbols in current file. --- ----@param local_opts table Options defining behavior of this particular picker. +---@param local_opts __extra_pickers_local_opts --- Possible fields: --- - `(string)` - LSP method to use. One of the supported ones (see --- list above). Default: `nil` which means explicit scope is needed. @@ -1164,20 +1172,22 @@ end --- Possible fields: --- - `(boolean)` - whether to return files only from current --- working directory and its subdirectories. Default: `false`. +--- __extra_pickers_preserve_order ---@param opts __extra_pickers_opts --- ---@return __extra_pickers_return MiniExtra.pickers.oldfiles = function(local_opts, opts) local pick = H.validate_pick('oldfiles') - local_opts = vim.tbl_deep_extend('force', { current_dir = false }, local_opts or {}) + local_opts = vim.tbl_deep_extend('force', { current_dir = false, preserve_order = false }, local_opts or {}) local oldfiles = vim.v.oldfiles if not H.islist(oldfiles) then H.error('`pickers.oldfiles` picker needs valid `v:oldfiles`.') end local show_all = not local_opts.current_dir local items = vim.schedule_wrap(function() - local cwd = pick.get_picker_opts().source.cwd .. '/' + local cwd = H.normalize_path(pick.get_picker_opts().source.cwd) .. '/' local res = {} for _, path in ipairs(oldfiles) do + path = H.normalize_path(path) if vim.fn.filereadable(path) == 1 and (show_all or vim.startswith(path, cwd)) then table.insert(res, H.short_path(path, cwd)) end @@ -1186,7 +1196,9 @@ MiniExtra.pickers.oldfiles = function(local_opts, opts) end) local show = H.pick_get_config().source.show or H.show_with_icons - return H.pick_start(items, { source = { name = 'Old files', show = show } }, opts) + local match_opts = { preserve_order = local_opts.preserve_order } + local match = function(stritems, inds, query) pick.default_match(stritems, inds, query, match_opts) end + return H.pick_start(items, { source = { name = 'Old files', show = show, match = match } }, opts) end --- Neovim options picker @@ -1398,8 +1410,7 @@ end --- Default: `nil` to get paths registered for |current-directory|. --- - `(function|string)` - forwarded to |MiniVisits.list_paths()|. --- Default: `nil` to use all paths. ---- - `(boolean)` - whether to preserve original order ---- during query. Default: `false`. +--- __extra_pickers_preserve_order --- - `(number)` - forwarded to |MiniVisits.gen_sort.default()|. --- Default: 0.5 to use "robust frecency" sorting. --- - `(function)` - forwarded to |MiniVisits.list_paths()|. @@ -1419,28 +1430,20 @@ MiniExtra.pickers.visit_paths = function(local_opts, opts) local cwd = local_opts.cwd or vim.fn.getcwd() -- NOTE: Use separate cwd to allow `cwd = ''` to not mean "current directory" local is_for_cwd = cwd ~= '' - local picker_cwd = cwd == '' and vim.fn.getcwd() or H.full_path(cwd) + local picker_cwd = H.normalize_path(cwd == '' and vim.fn.getcwd() or H.full_path(cwd)) -- Define source local filter = local_opts.filter or visits.gen_filter.default() local sort = local_opts.sort or visits.gen_sort.default({ recency_weight = local_opts.recency_weight }) local items = vim.schedule_wrap(function() local paths = visits.list_paths(cwd, { filter = filter, sort = sort }) - paths = vim.tbl_map(function(x) return H.short_path(x, picker_cwd) end, paths) + paths = vim.tbl_map(function(x) return H.normalize_path(H.short_path(x, picker_cwd)) end, paths) pick.set_picker_items(paths) end) local show = H.pick_get_config().source.show or H.show_with_icons - - local match - if local_opts.preserve_order then - match = function(stritems, inds, query) - -- Return makes call synchronous, but it shouldn't be too big problem - local res = pick.default_match(stritems, inds, query, true) or {} - table.sort(res) - return res - end - end + local match_opts = { preserve_order = local_opts.preserve_order } + local match = function(stritems, inds, query) pick.default_match(stritems, inds, query, match_opts) end local name = string.format('Visit paths (%s)', is_for_cwd and 'cwd' or 'all') local default_source = { name = name, cwd = picker_cwd, match = match, show = show } @@ -1488,7 +1491,7 @@ MiniExtra.pickers.visit_labels = function(local_opts, opts) local cwd = local_opts.cwd or vim.fn.getcwd() -- NOTE: Use separate cwd to allow `cwd = ''` to not mean "current directory" local is_for_cwd = cwd ~= '' - local picker_cwd = cwd == '' and vim.fn.getcwd() or H.full_path(cwd) + local picker_cwd = H.normalize_path(cwd == '' and vim.fn.getcwd() or H.full_path(cwd)) local filter = local_opts.filter or visits.gen_filter.default() local items = visits.list_labels(local_opts.path, local_opts.cwd, { filter = filter }) @@ -1499,7 +1502,7 @@ MiniExtra.pickers.visit_labels = function(local_opts, opts) return filter(path_data) and type(path_data.labels) == 'table' and path_data.labels[label] end local all_paths = visits.list_paths(local_opts.cwd, { filter = new_filter, sort = local_opts.sort }) - return vim.tbl_map(function(path) return H.short_path(path, picker_cwd) end, all_paths) + return vim.tbl_map(function(x) return H.normalize_path(H.short_path(x, picker_cwd)) end, all_paths) end local preview = function(buf_id, label) vim.api.nvim_buf_set_lines(buf_id, 0, -1, false, list_label_paths(label)) end @@ -1539,6 +1542,9 @@ H.ns_id = { -- Various cache H.cache = {} +-- File system information +H.is_windows = vim.loop.os_uname().sysname == 'Windows_NT' + -- Helper functionality ======================================================= -- Settings ------------------------------------------------------------------- H.setup_config = function(config) end @@ -1836,13 +1842,22 @@ H.lsp_make_on_list = function(source, opts) add_decor_data = function(item) if type(item.kind) ~= 'string' then return end local icon, hl = MiniIcons.get('lsp', item.kind) - item.text, item.hl = icon .. ' ' .. item.text, hl + -- If kind is not original, assume it already contains an icon + local icon_prefix = item.kind_orig == item.kind and (icon .. ' ') or '' + item.text, item.hl = icon_prefix .. item.text, hl end end local process = function(items) if source ~= 'document_symbol' then items = vim.tbl_map(H.pick_prepend_position, items) end - vim.tbl_map(add_decor_data, items) + -- Input `item.kind` is a string (resolved before `on_list`). Account for + -- possibly tweaked symbol map (like after `MiniIcons.tweak_lsp_kind`). + local kind_map = H.get_symbol_kind_map() + for _, item in ipairs(items) do + item.kind_orig, item.kind = item.kind, kind_map[item.kind] + add_decor_data(item) + item.kind_orig = nil + end table.sort(items, H.lsp_items_compare) return items end @@ -1875,6 +1890,17 @@ H.lsp_make_on_list = function(source, opts) end end +H.get_symbol_kind_map = function() + -- Compute symbol kind map from "resolved" string kind to its "original" (as in + -- LSP protocol). Those can be different after `MiniIcons.tweak_lsp_kind()`. + local res = {} + local double_map = vim.lsp.protocol.SymbolKind + for k, v in pairs(double_map) do + if type(k) == 'string' and type(v) == 'number' then res[double_map[v]] = k end + end + return res +end + H.lsp_items_compare = function(a, b) local a_path, b_path = a.path or '', b.path or '' if a_path < b_path then return true end @@ -2040,13 +2066,17 @@ H.ensure_text_width = function(text, width) end H.full_path = function(path) return (vim.fn.fnamemodify(path, ':p'):gsub('(.)/$', '%1')) end +H.normalize_path = function(path) return path end +if H.is_windows then + H.full_path = function(path) return (vim.fn.fnamemodify(path, ':p'):gsub('(.)[\\/]$', '%1')) end + H.normalize_path = function(path) return path:gsub('\\', '/') end +end H.short_path = function(path, cwd) cwd = cwd or vim.fn.getcwd() + -- Ensure `cwd` is treated as directory path (to not match similar prefix) cwd = cwd:sub(-1) == '/' and cwd or (cwd .. '/') - if not vim.startswith(path, cwd) then return vim.fn.fnamemodify(path, ':~') end - local res = path:sub(cwd:len() + 1):gsub('^/+', ''):gsub('/+$', '') - return res + return vim.startswith(path, cwd) and path:sub(cwd:len() + 1) or vim.fn.fnamemodify(path, ':~') end -- TODO: Remove after compatibility with Neovim=0.9 is dropped diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/files.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/files.lua index 343bf509..d58a11e4 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/files.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/files.lua @@ -20,6 +20,7 @@ --- - Filter/prefix/sort of file system entries. --- - Mappings used for common explorer actions. --- - UI options: whether to show preview of file/directory under cursor, etc. +--- - Bookmarks for quicker navigation. --- --- What it doesn't do: --- - Try to be replacement of system file explorer. It is mostly designed to @@ -157,6 +158,10 @@ --- |-------------|------|------------------------------------------------| --- | Go out plus | H | Focus on parent directory plus extra action | --- |-------------|------|------------------------------------------------| +--- | Go to mark | ' | Jump to bookmark (waits for single key id) | +--- |-------------|------|------------------------------------------------| +--- | Set mark | m | Set bookmark (waits for single key id) | +--- |-------------|------|------------------------------------------------| --- | Reset | | Reset current explorer | --- |-------------|------|------------------------------------------------| --- | Reveal cwd | @ | Reset current current working directory | @@ -181,6 +186,11 @@ --- --- - "Go out plus" is regular "Go out" but trims right part of branch. --- +--- - "Set mark" and "Go to mark" both wait for user to press a single character +--- of a bookmark id. Example: `ma` sets directory path of focused window as +--- bookmark "a"; `'a` jumps (sets as whole branch) to bookmark "a". +--- Special bookmark "'" always points to path before the latest bookmark jump. +--- --- - "Reset" focuses only on "anchor" directory (the one used to open current --- explorer) and resets all stored directory cursor positions. --- @@ -188,7 +198,7 @@ --- If it is not an ancestor of the current branch, nothing is done. --- --- - "Show help" results into new window with helpful information about current ---- explorer. Press `q` to close it. +--- explorer (like buffer mappings and bookmarks). Press `q` to close it. --- --- - "Synchronize" parses user edits in directory buffers, applies them (after --- confirmation), and updates all directory buffers with the most relevant @@ -223,11 +233,14 @@ --- so you can navigate in and out of directory with modified buffer. --- --- - Execute |MiniFiles.synchronize()| (default key is `=`). This will prompt ---- confirmation dialog listing all file system actions it is about to perform. ---- READ IT CAREFULLY. +--- confirmation dialog listing all file system actions (per directory) it is +--- about to perform. READ IT CAREFULLY. --- ---- - Confirm by pressing `y`/`` (applies edits and updates buffers) or ---- don't confirm by pressing `n`/`` (updates buffers without applying edits). +--- - Confirm by pressing `y` / `` (apply edits and update buffers) or +--- don't confirm by pressing `n` / `` (update buffers without applying edits). +--- +--- Note: prefer small and not related steps with more frequent synchronization +--- over single complex manipulation. There are (known) cases which won't work. --- --- # How does it work ~ --- @@ -241,6 +254,7 @@ --- --- During synchronization, actual text for entry name is compared to path index --- at that line (if present) to deduce which file system action to perform. +--- Note that order of text manipulation steps does not affect performed actions. --- --- # Supported file system actions ~ --- @@ -323,8 +337,8 @@ --- - `MiniFilesWindowOpen` - when new window is opened. Can be used to set --- window-local settings (like border, 'winblend', etc.) --- ---- - `MiniFilesWindowUpdate` - when a window is updated. Triggers frequently, ---- for example, for every "go in" or "go out" action. +--- - `MiniFilesWindowUpdate` - when a window is updated. Triggers VERY frequently. +--- At least after every cursor movement and "go in" / "go out" action. --- --- Callback for each UI event will receive `data` field (see |nvim_create_autocmd()|) --- with the following information: @@ -350,8 +364,8 @@ --- (see |nvim_create_autocmd()|) with the following information: --- --- - - string with action name. ---- - - absolute path of entry before action (`nil` for "create" action). ---- - - absolute path of entry after action (`nil` for "delete" action). +--- - - full path of entry before action (`nil` for "create" action). +--- - - full path of entry after action (`nil` for permanent "delete" action). ---@tag MiniFiles-events --- Common configuration examples ~ @@ -366,7 +380,8 @@ --- < --- # Customize windows ~ --- ---- Create an autocommand for `MiniFilesWindowOpen` event: >lua +--- For most of the common customizations using `MiniFilesWindowOpen` event +--- autocommand is the suggested approach: >lua --- --- vim.api.nvim_create_autocmd('User', { --- pattern = 'MiniFilesWindowOpen', @@ -381,9 +396,32 @@ --- end, --- }) --- < +--- However, some parts (like window title and height) of window config are later +--- updated internally. Use `MiniFilesWindowUpdate` event for them: >lua +--- +--- vim.api.nvim_create_autocmd('User', { +--- pattern = 'MiniFilesWindowUpdate', +--- callback = function(args) +--- local config = vim.api.nvim_win_get_config(args.data.win_id) +--- +--- -- Ensure fixed height +--- config.height = 10 +--- +--- -- Ensure title padding +--- if config.title[#config.title][1] ~= ' ' then +--- table.insert(config.title, { ' ', 'NormalFloat' }) +--- end +--- if config.title[1][1] ~= ' ' then +--- table.insert(config.title, 1, { ' ', 'NormalFloat' }) +--- end +--- +--- vim.api.nvim_win_set_config(args.data.win_id, config) +--- end, +--- }) +--- < --- # Customize icons ~ --- ---- Use different directory icon: >lua +--- Use different directory icon (if you don't use |mini.icons|): >lua --- --- local my_prefix = function(fs_entry) --- if fs_entry.fs_type == 'directory' then @@ -429,18 +467,18 @@ --- < --- # Create mappings to modify target window via split ~ --- ---- Combine |MiniFiles.get_target_window()| and |MiniFiles.set_target_window()|: >lua +--- Combine |MiniFiles.get_explorer_state()| and |MiniFiles.set_target_window()|: >lua --- --- local map_split = function(buf_id, lhs, direction) --- local rhs = function() --- -- Make new window and set it as target ---- local new_target_window ---- vim.api.nvim_win_call(MiniFiles.get_target_window(), function() +--- local cur_target = MiniFiles.get_explorer_state().target_window +--- local new_target = vim.api.nvim_win_call(cur_target, function() --- vim.cmd(direction .. ' split') ---- new_target_window = vim.api.nvim_get_current_win() +--- return vim.api.nvim_get_current_win() --- end) --- ---- MiniFiles.set_target_window(new_target_window) +--- MiniFiles.set_target_window(new_target) --- end --- --- -- Adding `desc` will result into `show_help` entries @@ -453,8 +491,8 @@ --- callback = function(args) --- local buf_id = args.data.buf_id --- -- Tweak keys to your liking ---- map_split(buf_id, 'gs', 'belowright horizontal') ---- map_split(buf_id, 'gv', 'belowright vertical') +--- map_split(buf_id, '', 'belowright horizontal') +--- map_split(buf_id, '', 'belowright vertical') --- end, --- }) --- < @@ -476,6 +514,22 @@ --- end, --- }) --- < +--- # Set custom bookmarks ~ +--- +--- Use |MiniFiles.set_bookmark()| inside `MiniFilesExplorerOpen` event: >lua +--- +--- local set_mark = function(id, path, desc) +--- MiniFiles.set_bookmark(id, path, { desc = desc }) +--- end +--- vim.api.nvim_create_autocmd('User', { +--- pattern = 'MiniFilesExplorerOpen', +--- callback = function() +--- set_mark('c', vim.fn.stdpath('config'), 'Config') -- path +--- set_mark('w', vim.fn.getcwd, 'Working directory') -- callable +--- set_mark('~', '~', 'Home directory') +--- end, +--- }) +--- < ---@tag MiniFiles-examples ---@diagnostic disable:luadoc-miss-type-name @@ -615,6 +669,8 @@ MiniFiles.config = { go_in_plus = 'L', go_out = 'h', go_out_plus = 'H', + mark_goto = "'", + mark_set = 'm', reset = '', reveal_cwd = '@', show_help = 'g?', @@ -759,7 +815,7 @@ MiniFiles.synchronize = function() -- Parse and apply file system operations local fs_actions = H.explorer_compute_fs_actions(explorer) - if fs_actions ~= nil and H.fs_actions_confirm(fs_actions) then H.fs_actions_apply(fs_actions, explorer.opts) end + if fs_actions ~= nil and H.fs_actions_confirm(fs_actions) then H.fs_actions_apply(fs_actions) end H.explorer_refresh(explorer, { force_update = true }) end @@ -843,7 +899,7 @@ end --- - If file, open it in the window which was current during |MiniFiles.open()|. --- Explorer is not closed after that. --- ----@param opts Options. Possible fields: +---@param opts table|nil Options. Possible fields: --- - `(boolean)` - whether to close explorer after going --- inside a file. Powers the `go_in_plus` mapping. --- Default: `false`. @@ -912,25 +968,18 @@ end --- - Prepend branch with parent paths until current working directory is reached. --- Do nothing if not inside it. MiniFiles.reveal_cwd = function() - local explorer = H.explorer_get() - if explorer == nil then return end + local state = MiniFiles.get_explorer_state() + if state == nil then return end + local branch, depth_focus = state.branch, state.depth_focus local cwd = H.fs_full_path(vim.fn.getcwd()) local cwd_ancestor_pattern = string.format('^%s/.', vim.pesc(cwd)) - while explorer.branch[1]:find(cwd_ancestor_pattern) ~= nil do - -- Add parent to branch - local parent, name = H.fs_get_parent(explorer.branch[1]), H.fs_get_basename(explorer.branch[1]) - table.insert(explorer.branch, 1, parent) - - explorer.depth_focus = explorer.depth_focus + 1 - - -- Set cursor on child entry - local parent_view = explorer.views[parent] or {} - parent_view.cursor = name - explorer.views[parent] = parent_view + while branch[1]:find(cwd_ancestor_pattern) ~= nil do + table.insert(branch, 1, H.fs_get_parent(branch[1])) + depth_focus = depth_focus + 1 end - H.explorer_refresh(explorer) + MiniFiles.set_branch(branch, { depth_focus = depth_focus }) end --- Show help window @@ -944,7 +993,7 @@ MiniFiles.show_help = function() local buf_id = vim.api.nvim_get_current_buf() if not H.is_opened_buffer(buf_id) then return end - H.explorer_show_help(buf_id, vim.api.nvim_get_current_win()) + H.explorer_show_help(explorer, buf_id, vim.api.nvim_get_current_win()) end --- Get file system entry data @@ -963,22 +1012,59 @@ MiniFiles.get_fs_entry = function(buf_id, line) line = H.validate_line(buf_id, line) local path_id = H.match_line_path_id(H.get_bufline(buf_id, line)) - if path_id == nil then return nil end + return H.get_fs_entry_from_path_index(path_id) +end - local path = H.path_index[path_id] - return { fs_type = H.fs_get_type(path), name = H.fs_get_basename(path), path = path } +--- Get state of active explorer +--- +---@return table|nil Table with explorer state data or `nil` if no active explorer. +--- State data is a table with the following fields: +--- - `(string)` - anchor directory path (see |MiniFiles.open()|). +--- - `(table)` - map from bookmark id (single character) to its data: +--- table with and fields (see |MiniFiles.set_bookmark()|). +--- - `(table)` - array of nested paths for currently opened branch. +--- - `(number)` - an index in for currently focused path. +--- - `(number)` - identifier of target window. +--- - `(table)` - array with data about currently opened windows. +--- Each element is a table with (window identifier) and (path +--- shown in the window) fields. +--- +---@seealso - |MiniFiles.set_bookmark()| +--- - |MiniFiles.set_branch()| +--- - |MiniFiles.set_target_window()| +MiniFiles.get_explorer_state = function() + local explorer = H.explorer_get() + if explorer == nil then return end + + H.explorer_ensure_target_window(explorer) + local windows = {} + for _, win_id in ipairs(explorer.windows) do + local buf_id = vim.api.nvim_win_get_buf(win_id) + local path = (H.opened_buffers[buf_id] or {}).path + table.insert(windows, { win_id = win_id, path = path }) + end + + return { + anchor = explorer.anchor, + bookmarks = vim.deepcopy(explorer.bookmarks), + branch = vim.deepcopy(explorer.branch), + depth_focus = explorer.depth_focus, + target_window = explorer.target_window, + windows = windows, + } end --- Get target window --- ----@return number|nil Window identifier inside which file will be opened or ---- `nil` if no explorer is opened. +--- Deprecated. Use |MiniFiles.get_explorer_state()|. MiniFiles.get_target_window = function() - local explorer = H.explorer_get() - if explorer == nil then return end - - explorer = H.explorer_ensure_target_window(explorer) - return explorer.target_window + -- TODO: remove after 'mini.nvim' 0.14 release + H.notify( + "`get_target_window()` is soft deprecated (currently works but will be removed after next 'mini.nvim' release)." + .. ' Use `get_explorer_state().target_window` instead. Sorry for the inconvenience.', + 'WARN' + ) + return (MiniFiles.get_explorer_state() or {}).target_window end --- Set target window @@ -993,6 +1079,70 @@ MiniFiles.set_target_window = function(win_id) explorer.target_window = win_id end +--- Set branch +--- +--- Set which paths to display. Preview (if enabled) is applied afterwards. +--- +---@param branch table Array of strings representing actually present on disk paths. +--- Each consecutive pair should represent direct parent-child paths. +--- Should contain at least one directory path. +--- May end with file path (will be previwed). +--- Relative paths are resolved using |current-directory|. +---@param opts table|nil Options. Possible fields: +--- - `(number)` - an index in `branch` for path to focus. Will +--- be normalized to fit inside `branch`. Default: index of deepest directory. +--- +---@seealso |MiniFiles.get_explorer_state()| +MiniFiles.set_branch = function(branch, opts) + local explorer = H.explorer_get() + if explorer == nil then return end + + -- Validate and normalize input + branch = H.validate_branch(branch) + opts = opts or {} + local depth_focus = opts.depth_focus or math.huge + if type(depth_focus) ~= 'number' then H.error('`depth_focus` should be a number') end + local max_depth = #branch - (H.fs_get_type(branch[#branch]) == 'file' and 1 or 0) + depth_focus = math.min(math.max(math.floor(depth_focus), 1), max_depth) + + -- Set data and ensure cursors are on child entries + explorer.branch, explorer.depth_focus = branch, depth_focus + for i = 1, #branch - 1 do + local parent, child = branch[i], H.fs_get_basename(branch[i + 1]) + local parent_view = explorer.views[parent] or {} + parent_view.cursor = child + explorer.views[parent] = parent_view + end + + -- Skip update cursors, as they are already set + H.explorer_refresh(explorer, { skip_update_cursor = true }) + -- Refresh second time to ensure that preview is shown. Doing that in other + -- way is not really feasible, as it requires knowing cursor at deepest path, + -- which might not yet be set before first refresh. + H.explorer_refresh(explorer) +end + +--- Set bookmark +--- +---@param id string Single character bookmark id. +---@param path string|function Path of a present on disk directory to set as +--- a bookmark's path. If callable, should return such path. +---@param opts table|nil Options. Possible fields: +--- - `(string)` - bookmark description (used in help window). +MiniFiles.set_bookmark = function(id, path, opts) + local explorer = H.explorer_get() + if explorer == nil then return end + + if not (type(id) == 'string' and id:len() == 1) then H.error('Bookmark id should be single character') end + local is_valid_path = vim.is_callable(path) + or (type(path) == 'string' and H.fs_get_type(vim.fn.expand(path)) == 'directory') + if not is_valid_path then H.error('Bookmark path should be a valid path to directory or a callable.') end + opts = opts or {} + if not (opts.desc == nil or type(opts.desc) == 'string') then H.error('Bookmark description should be string') end + + explorer.bookmarks[id] = { path = path, desc = opts.desc } +end + --- Get latest used anchor path --- --- Note: if latest used `path` argument for |MiniFiles.open()| was for file, @@ -1098,6 +1248,7 @@ H.latest_paths = {} -- Register of opened buffer data for quick access. Tables per buffer id: -- - - path which contents this buffer displays. +-- - - array of shown children path ids. -- - - id of window this buffer is shown. Can be `nil`. -- - - number of modifications since last update from this module. -- Values bigger than 0 can be treated as if buffer was modified by user. @@ -1108,9 +1259,6 @@ H.opened_buffers = {} -- File system information H.is_windows = vim.loop.os_uname().sysname == 'Windows_NT' --- Register table to decide whether certain autocmd events should be triggered -H.block_event_trigger = {} - -- Helper functionality ======================================================= -- Settings ------------------------------------------------------------------- H.setup_config = function(config) @@ -1136,6 +1284,8 @@ H.setup_config = function(config) ['mappings.go_in_plus'] = { config.mappings.go_in_plus, 'string' }, ['mappings.go_out'] = { config.mappings.go_out, 'string' }, ['mappings.go_out_plus'] = { config.mappings.go_out_plus, 'string' }, + ['mappings.mark_goto'] = { config.mappings.mark_goto, 'string' }, + ['mappings.mark_set'] = { config.mappings.mark_set, 'string' }, ['mappings.reset'] = { config.mappings.reset, 'string' }, ['mappings.reveal_cwd'] = { config.mappings.reveal_cwd, 'string' }, ['mappings.show_help'] = { config.mappings.show_help, 'string' }, @@ -1159,14 +1309,12 @@ end H.apply_config = function(config) MiniFiles.config = config end H.create_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniFiles', {}) + local gr = vim.api.nvim_create_augroup('MiniFiles', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end - au('VimResized', '*', MiniFiles.refresh, 'Refresh on resize') - if config.options.use_as_default_explorer then -- Stop 'netrw' from showing. Needs `VimEnter` event autocommand if -- this is called prior 'netrw' is set up @@ -1175,6 +1323,9 @@ H.create_autocommands = function(config) au('BufEnter', '*', H.track_dir_edit, 'Track directory edit') end + + au('VimResized', '*', MiniFiles.refresh, 'Refresh on resize') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end --stylua: ignore @@ -1233,16 +1384,17 @@ end -- Explorers ------------------------------------------------------------------ ---@class Explorer --- +---@field bookmarks table Map from single characters to bookmark data: table +--- with and fields. ---@field branch table Array of absolute directory paths from parent to child. --- Its ids are called depth. ---@field depth_focus number Depth to focus. ---@field views table Views for paths. Each view is a table with: --- - where to show directory content. +--- - - whether buffer was focused during current session. --- - to position cursor; can be: --- - `{ line, col }` table to set cursor when buffer changes window. --- - `entry_name` string entry name to find inside directory buffer. ---- - - array with children path ids present during ---- latest directory update. ---@field windows table Array of currently opened window ids (left to right). ---@field anchor string Anchor directory of the explorer. Used as index in --- history and for `reset()` operation. @@ -1259,6 +1411,7 @@ H.explorer_new = function(path) windows = {}, anchor = path, target_window = vim.api.nvim_get_current_win(), + bookmarks = {}, opts = {}, } end @@ -1296,13 +1449,23 @@ H.explorer_refresh = function(explorer, opts) -- cursors to "stick" to current items. if not opts.skip_update_cursor then explorer = H.explorer_update_cursors(explorer) end + -- Ensure no outdated views + for path, view in pairs(explorer.views) do + if not H.fs_is_present_path(path) then + H.buffer_delete(view.buf_id) + explorer.views[path] = nil + end + end + -- Possibly force content updates on all explorer buffers. Doing it for *all* - -- of them and not only on modified once to allow synch outside changes. + -- of them and not only on modified ones to allow sync changes from outside. if opts.force_update then for path, view in pairs(explorer.views) do -- Encode cursors to allow them to "stick" to current entry view = H.view_encode_cursor(view) - view.children_path_ids = H.buffer_update(view.buf_id, path, explorer.opts) + -- Force update of shown path ids + if H.opened_buffers[view.buf_id] then H.opened_buffers[view.buf_id].children_path_ids = nil end + H.buffer_update(view.buf_id, path, explorer.opts, not view.was_focused) explorer.views[path] = view end end @@ -1437,6 +1600,16 @@ H.explorer_go_in_range = function(explorer, buf_id, from_line, to_line) if fs_entry.fs_type == 'directory' then path, line = fs_entry.path, i end + if fs_entry.fs_type == nil and fs_entry.path == nil then + local entry = vim.inspect(H.get_bufline(buf_id, i)) + H.notify('Line ' .. entry .. ' does not have proper format. Did you modify without synchronization?', 'WARN') + end + if fs_entry.fs_type == nil and fs_entry.path ~= nil then + local path_resolved = vim.fn.resolve(fs_entry.path) + local symlink_info = path_resolved == fs_entry.path and '' + or (' Looks like miscreated symlink (resolved to ' .. path_resolved .. ').') + H.notify('Path ' .. fs_entry.path .. ' is not present on disk.' .. symlink_info, 'WARN') + end end for _, file_path in ipairs(files) do @@ -1476,18 +1649,18 @@ H.explorer_compute_fs_actions = function(explorer) -- Compute differences local fs_diffs = {} for _, view in pairs(explorer.views) do - local dir_fs_diff = H.buffer_compute_fs_diff(view.buf_id, view.children_path_ids) + local dir_fs_diff = H.buffer_compute_fs_diff(view.buf_id) if #dir_fs_diff > 0 then vim.list_extend(fs_diffs, dir_fs_diff) end end if #fs_diffs == 0 then return nil end -- Convert differences into actions - local create, delete_map, rename, move, raw_copy = {}, {}, {}, {}, {} + local create, delete_map, raw_copy = {}, {}, {} -- - Differentiate between create, delete, and copy for _, diff in ipairs(fs_diffs) do if diff.from == nil then - table.insert(create, diff.to) + table.insert(create, { action = 'create', dir = diff.dir, to = diff.to }) elseif diff.to == nil then delete_map[diff.from] = true else @@ -1495,26 +1668,51 @@ H.explorer_compute_fs_actions = function(explorer) end end - -- - Possibly narrow down copy action into move or rename: - -- `delete + copy` is `rename` if in same directory and `move` otherwise - local copy = {} + -- - Narrow down copy action into rename or move: `delete + copy` is `rename` + -- if in same directory and `move` otherwise + local rename, move, copy = {}, {}, {} for _, diff in pairs(raw_copy) do + local action, target = 'copy', copy if delete_map[diff.from] then - if H.fs_get_parent(diff.from) == H.fs_get_parent(diff.to) then - table.insert(rename, diff) - else - table.insert(move, diff) - end - - -- NOTE: Can't use `delete` as array here in order for path to be moved - -- or renamed only single time + action = H.fs_get_parent(diff.from) == H.fs_get_parent(diff.to) and 'rename' or 'move' + target = action == 'rename' and rename or move + -- NOTE: Use map instead of array to ensure single move/rename per path delete_map[diff.from] = nil - else - table.insert(copy, diff) + end + table.insert(target, { action = action, dir = diff.dir, from = diff.from, to = diff.to }) + end + + -- Compute delete actions accounting for (non) permanent delete + local delete, is_trash = {}, not explorer.opts.options.permanent_delete + local trash_dir = H.fs_child_path(vim.fn.stdpath('data'), 'mini.files/trash') + for p, _ in pairs(delete_map) do + local to = is_trash and H.fs_child_path(trash_dir, H.fs_get_basename(p)) or nil + table.insert(delete, { action = 'delete', from = p, to = to }) + end + + -- Construct final array with proper order of actions: + -- - If action depends on the path which will be deleted, perform it first. + -- - "Delete"/"move"/"rename" before "copy"/"create" to free space for them. + -- - Move/rename (if successful) will later adjust next steps at execution. + local before_delete, after_delete = {}, {} + for _, arr in ipairs({ move, rename, copy, create }) do + for _, diff in ipairs(arr) do + local will_be_deleted = false + for _, del in ipairs(delete) do + local from_is_affected = del.from == diff.from or vim.startswith(diff.from or '', del.from .. '/') + -- Don't directly account for deleted path to allow "act on freed path" + local to_is_affected = vim.startswith(diff.to, del.from .. '/') + will_be_deleted = will_be_deleted or from_is_affected or to_is_affected + end + table.insert(will_be_deleted and before_delete or after_delete, diff) end end - return { create = create, delete = vim.tbl_keys(delete_map), copy = copy, rename = rename, move = move } + local res = {} + vim.list_extend(res, before_delete) + vim.list_extend(res, delete) + vim.list_extend(res, after_delete) + return res end H.explorer_update_cursors = function(explorer) @@ -1533,17 +1731,17 @@ H.explorer_refresh_depth_window = function(explorer, depth, win_count, win_col) local path = explorer.branch[depth] local views, windows, opts = explorer.views, explorer.windows, explorer.opts - -- Prepare target view - local view = views[path] or {} - view = H.view_ensure_proper(view, path, opts) - views[path] = view - -- Compute width based on window role local win_is_focused = depth == explorer.depth_focus local win_is_preview = opts.windows.preview and (depth == (explorer.depth_focus + 1)) local cur_width = win_is_focused and opts.windows.width_focus or (win_is_preview and opts.windows.width_preview or opts.windows.width_nofocus) + -- Prepare target view + local view = views[path] or {} + view = H.view_ensure_proper(view, path, opts, win_is_focused, win_is_preview) + views[path] = view + -- Create relevant window config local config = { col = win_col, @@ -1602,9 +1800,11 @@ H.explorer_open_file = function(explorer, path) -- Try to use already created buffer, if present. This avoids not needed -- `:edit` call and avoids some problems with auto-root from 'mini.misc'. + path = H.fs_normalize_path(path) local path_buf_id for _, buf_id in ipairs(vim.api.nvim_list_bufs()) do - local is_target = H.is_valid_buf(buf_id) and vim.bo[buf_id].buflisted and vim.api.nvim_buf_get_name(buf_id) == path + local is_same_name = H.fs_normalize_path(vim.api.nvim_buf_get_name(buf_id)) == path + local is_target = H.is_valid_buf(buf_id) and vim.bo[buf_id].buflisted and is_same_name if is_target then path_buf_id = buf_id end end @@ -1668,7 +1868,7 @@ H.explorer_trim_branch_left = function(explorer) return explorer end -H.explorer_show_help = function(explorer_buf_id, explorer_win_id) +H.explorer_show_help = function(explorer, explorer_buf_id, explorer_win_id) -- Compute lines local buf_mappings = vim.api.nvim_buf_get_keymap(explorer_buf_id, 'n') local map_data, desc_width = {}, 0 @@ -1688,6 +1888,20 @@ H.explorer_show_help = function(explorer_buf_id, explorer_win_id) table.insert(lines, string.format(map_format, desc, map_data[desc])) end table.insert(lines, '') + + local bookmark_ids = vim.tbl_keys(explorer.bookmarks) + if #bookmark_ids > 0 then + table.insert(lines, 'Bookmarks:') + table.insert(lines, '') + table.sort(bookmark_ids) + for _, id in ipairs(bookmark_ids) do + local data = explorer.bookmarks[id] + local desc = data.desc or (vim.is_callable(data.path) and data.path() or data.path) + table.insert(lines, id .. ' │ ' .. desc) + end + table.insert(lines, '') + end + table.insert(lines, '(Press `q` to close)') -- Create buffer @@ -1758,17 +1972,21 @@ H.compute_visible_depth_range = function(explorer, opts) end -- Views ---------------------------------------------------------------------- -H.view_ensure_proper = function(view, path, opts) +H.view_ensure_proper = function(view, path, opts, is_focused, is_preview) -- Ensure proper buffer - if not H.is_valid_buf(view.buf_id) then + local needs_recreate, needs_reprocess = not H.is_valid_buf(view.buf_id), not view.was_focused and is_focused + if needs_recreate then H.buffer_delete(view.buf_id) view.buf_id = H.buffer_create(path, opts.mappings) + end + if needs_recreate or needs_reprocess then -- Make sure that pressing `u` in new buffer does nothing local cache_undolevels = vim.bo[view.buf_id].undolevels vim.bo[view.buf_id].undolevels = -1 - view.children_path_ids = H.buffer_update(view.buf_id, path, opts) + H.buffer_update(view.buf_id, path, opts, is_preview) vim.bo[view.buf_id].undolevels = cache_undolevels end + view.was_focused = view.was_focused or is_focused -- Ensure proper cursor. If string, find it as line in current buffer. view.cursor = view.cursor or { 1, 0 } @@ -1807,7 +2025,6 @@ end H.view_invalidate_buffer = function(view) H.buffer_delete(view.buf_id) view.buf_id = nil - view.children_path_ids = nil return view end @@ -1840,10 +2057,7 @@ H.view_track_cursor = vim.schedule_wrap(function(data) explorer = H.explorer_sync_cursor_and_branch(explorer, buf_depth) - -- Don't trigger redundant window update events - H.block_event_trigger['MiniFilesWindowUpdate'] = true H.explorer_refresh(explorer) - H.block_event_trigger['MiniFilesWindowUpdate'] = false end) H.view_track_text_change = function(data) @@ -1857,16 +2071,28 @@ H.view_track_text_change = function(data) -- Track window height if not H.is_valid_win(win_id) then return end + local cur_height = vim.api.nvim_win_get_height(win_id) local n_lines = vim.api.nvim_buf_line_count(buf_id) - local height = math.min(n_lines, H.window_get_max_height()) - vim.api.nvim_win_set_height(win_id, height) + local new_height = math.min(n_lines, H.window_get_max_height()) + vim.api.nvim_win_set_height(win_id, new_height) + + -- Trigger appropriate event if window height has changed + if cur_height ~= new_height then + H.trigger_event('MiniFilesWindowUpdate', { buf_id = buf_id, win_id = win_id }) + new_height = vim.api.nvim_win_get_height(win_id) + end -- Ensure that only buffer lines are shown. This can be not the case if after -- text edit cursor moved past previous last line. - local last_visible_line = vim.fn.line('w0', win_id) + height - 1 + local last_visible_line = vim.fn.line('w0', win_id) + new_height - 1 local out_of_buf_lines = last_visible_line - n_lines -- - Possibly scroll window upward (`\25` is an escaped ``) - if out_of_buf_lines > 0 then vim.cmd('normal! ' .. out_of_buf_lines .. '\25') end + if out_of_buf_lines > 0 then + -- Preserve cursor as scrolling might affect it (like in Insert mode) + local cursor = vim.api.nvim_win_get_cursor(win_id) + vim.cmd('normal! ' .. out_of_buf_lines .. '\25') + vim.api.nvim_win_set_cursor(win_id, cursor) + end end -- Buffers -------------------------------------------------------------------- @@ -1942,6 +2168,30 @@ H.buffer_make_mappings = function(buf_id, mappings) return [[]] end + local mark_goto = function() + local id = H.getcharstr() + if id == nil then return end + local data = MiniFiles.get_explorer_state().bookmarks[id] + if data == nil then return H.notify('No bookmark with id ' .. vim.inspect(id), 'WARN') end + + local path = data.path + if vim.is_callable(path) then path = path() end + local is_valid_path = type(path) == 'string' and H.fs_get_type(vim.fn.expand(path)) == 'directory' + if not is_valid_path then return H.notify('Bookmark path should be a valid path to directory', 'WARN') end + + local state = MiniFiles.get_explorer_state() + MiniFiles.set_bookmark("'", state.branch[state.depth_focus], { desc = 'Before latest jump' }) + MiniFiles.set_branch({ path }) + end + + local mark_set = function() + local id = H.getcharstr() + if id == nil then return end + local state = MiniFiles.get_explorer_state() + MiniFiles.set_bookmark(id, state.branch[state.depth_focus]) + H.notify('Bookmark ' .. vim.inspect(id) .. ' is set', 'INFO') + end + local buf_map = function(mode, lhs, rhs, desc) -- Use `nowait` to account for non-buffer mappings starting with `lhs` H.map(mode, lhs, rhs, { buffer = buf_id, desc = desc, nowait = true }) @@ -1953,6 +2203,8 @@ H.buffer_make_mappings = function(buf_id, mappings) buf_map('n', mappings.go_in_plus, go_in_plus, 'Go in entry plus') buf_map('n', mappings.go_out, go_out_with_count, 'Go out of directory') buf_map('n', mappings.go_out_plus, go_out_plus, 'Go out of directory plus') + buf_map('n', mappings.mark_goto, mark_goto, 'Go to bookmark') + buf_map('n', mappings.mark_set, mark_set, 'Set bookmark') buf_map('n', mappings.reset, MiniFiles.reset, 'Reset') buf_map('n', mappings.reveal_cwd, MiniFiles.reveal_cwd, 'Reveal cwd') buf_map('n', mappings.show_help, MiniFiles.show_help, 'Show Help') @@ -1964,36 +2216,43 @@ H.buffer_make_mappings = function(buf_id, mappings) --stylua: ignore end end -H.buffer_update = function(buf_id, path, opts) +H.buffer_update = function(buf_id, path, opts, is_preview) if not (H.is_valid_buf(buf_id) and H.fs_is_present_path(path)) then return end -- Perform entry type specific updates local update_fun = H.fs_get_type(path) == 'directory' and H.buffer_update_directory or H.buffer_update_file - local fs_entries = update_fun(buf_id, path, opts) + update_fun(buf_id, path, opts, is_preview) -- Trigger dedicated event H.trigger_event('MiniFilesBufferUpdate', { buf_id = buf_id, win_id = H.opened_buffers[buf_id].win_id }) -- Reset buffer as not modified H.opened_buffers[buf_id].n_modified = -1 - - -- Return array with children entries path ids for future synchronization - return vim.tbl_map(function(x) return x.path_id end, fs_entries) end -H.buffer_update_directory = function(buf_id, path, opts) - local lines, icon_hl, name_hl = {}, {}, {} +H.buffer_update_directory = function(buf_id, path, opts, is_preview) + -- Compute and cache (to use during sync) shown file system entries + local children_path_ids = H.opened_buffers[buf_id].children_path_ids + local fs_entries = children_path_ids == nil and H.fs_read_dir(path, opts.content) + or vim.tbl_map(H.get_fs_entry_from_path_index, children_path_ids) + H.opened_buffers[buf_id].children_path_ids = children_path_ids + or vim.tbl_map(function(x) return x.path_id end, fs_entries) - -- Compute lines - local fs_entries = H.fs_read_dir(path, opts.content) - - -- - Compute format expression resulting into same width path ids + -- Compute format expression resulting into same width path ids local path_width = math.floor(math.log10(#H.path_index)) + 1 local line_format = '/%0' .. path_width .. 'd/%s/%s' - local prefix_fun = opts.content.prefix - for _, entry in ipairs(fs_entries) do - local prefix, hl = prefix_fun(entry) + -- Compute lines + local lines, icon_hl, name_hl = {}, {}, {} + local prefix_fun, n_computed_prefixes = opts.content.prefix, is_preview and vim.o.lines or math.huge + for i, entry in ipairs(fs_entries) do + local prefix, hl + -- Compute prefix only in visible preview (for performance). + -- NOTE: limiting entries in `fs_read_dir()` is not possible because all + -- entries are needed for a proper filter and sort. + if i <= n_computed_prefixes then + prefix, hl = prefix_fun(entry) + end prefix, hl = prefix or '', hl or '' table.insert(lines, string.format(line_format, H.path_index[entry.path], prefix, entry.name)) table.insert(icon_hl, hl) @@ -2019,20 +2278,16 @@ H.buffer_update_directory = function(buf_id, path, opts) local name_opts = { hl_group = name_hl[i], end_row = i, end_col = 0, right_gravity = false } set_hl(i - 1, name_start - 1, name_opts) end - - return fs_entries end -H.buffer_update_file = function(buf_id, path, opts) - -- Determine if file is text. This is not 100% proof, but good enough. +H.buffer_update_file = function(buf_id, path, opts, _) + -- Work only with readable text file. This is not 100% proof, but good enough. -- Source: https://github.com/sharkdp/content_inspector - local fd = vim.loop.fs_open(path, 'r', 1) + local fd, width_preview = vim.loop.fs_open(path, 'r', 1), opts.windows.width_preview + if fd == nil then return H.set_buflines(buf_id, { '-No-access' .. string.rep('-', width_preview) }) end local is_text = vim.loop.fs_read(fd, 1024):find('\0') == nil vim.loop.fs_close(fd) - if not is_text then - H.set_buflines(buf_id, { '-Non-text-file' .. string.rep('-', opts.windows.width_preview) }) - return {} - end + if not is_text then return H.set_buflines(buf_id, { '-Non-text-file' .. string.rep('-', width_preview) }) end -- Compute lines. Limit number of read lines to work better on large files. local has_lines, read_res = pcall(vim.fn.readfile, path, '', vim.o.lines) @@ -2049,8 +2304,6 @@ H.buffer_update_file = function(buf_id, path, opts) local has_ts, _ = pcall(vim.treesitter.start, buf_id, has_lang and lang or ft) if not has_ts then vim.bo[buf_id].syntax = ft end end - - return {} end H.buffer_delete = function(buf_id) @@ -2059,7 +2312,7 @@ H.buffer_delete = function(buf_id) H.opened_buffers[buf_id] = nil end -H.buffer_compute_fs_diff = function(buf_id, ref_path_ids) +H.buffer_compute_fs_diff = function(buf_id) if not H.is_modified_buffer(buf_id) then return {} end local path = H.opened_buffers[buf_id].path @@ -2079,15 +2332,16 @@ H.buffer_compute_fs_diff = function(buf_id, ref_path_ids) -- Ignore blank lines and already synced entries (even several user-copied) if l:find('^%s*$') == nil and path_from ~= path_to then - table.insert(res, { from = path_from, to = path_to }) + table.insert(res, { from = path_from, to = path_to, dir = path }) elseif path_id ~= nil then present_path_ids[path_id] = true end end -- Detect missing file system entries + local ref_path_ids = H.opened_buffers[buf_id].children_path_ids for _, ref_id in ipairs(ref_path_ids) do - if not present_path_ids[ref_id] then table.insert(res, { from = H.path_index[ref_id], to = nil }) end + if not present_path_ids[ref_id] then table.insert(res, { from = H.path_index[ref_id], to = nil, dir = path }) end end return res @@ -2152,6 +2406,7 @@ H.window_open = function(buf_id, config) -- Set permanent window options vim.wo[win_id].concealcursor = 'nvic' vim.wo[win_id].foldenable = false + vim.wo[win_id].foldmethod = 'manual' vim.wo[win_id].wrap = false -- Conceal path id and prefix separators @@ -2235,7 +2490,7 @@ end H.window_set_view = function(win_id, view) -- Set buffer local buf_id = view.buf_id - vim.api.nvim_win_set_buf(win_id, buf_id) + H.win_set_buf(win_id, buf_id) -- - Update buffer register. No need to update previous buffer data, as it -- should already be invalidated. H.opened_buffers[buf_id].win_id = win_id @@ -2331,6 +2586,12 @@ H.add_path_to_index = function(path) return new_id end +H.get_fs_entry_from_path_index = function(path_id) + local path = H.path_index[path_id] + if path == nil then return nil end + return { fs_type = H.fs_get_type(path), name = H.fs_get_basename(path), path = path } +end + H.replace_path_in_index = function(from, to) local from_id, to_id = H.path_index[from], H.path_index[to] H.path_index[from_id], H.path_index[to] = to, from_id @@ -2350,7 +2611,7 @@ end H.fs_normalize_path = function(path) return (path:gsub('/+', '/'):gsub('(.)/$', '%1')) end if H.is_windows then - H.fs_normalize_path = function(path) return (path:gsub('\\', '/'):gsub('/+', '/'):gsub('(.)/$', '%1')) end + H.fs_normalize_path = function(path) return (path:gsub('\\', '/'):gsub('/+', '/'):gsub('(.)[\\/]$', '%1')) end end H.fs_is_present_path = function(path) return vim.loop.fs_stat(path) ~= nil end @@ -2363,8 +2624,7 @@ H.fs_shorten_path = function(path) -- Replace home directory with '~' path = H.fs_normalize_path(path) local home_dir = H.fs_normalize_path(vim.loop.os_homedir() or '~') - local res = path:gsub('^' .. vim.pesc(home_dir), '~') - return res + return (path:gsub('^' .. vim.pesc(home_dir), '~')) end H.fs_get_basename = function(path) return H.fs_normalize_path(path):match('[^/]+$') end @@ -2399,52 +2659,36 @@ end H.fs_actions_to_lines = function(fs_actions) -- Gather actions per source directory + local short = H.fs_shorten_path + local dir + local rel = function(p) return vim.startswith(p, dir .. '/') and p:sub(#dir + 2):gsub('/$', '') or short(p) end + local actions_per_dir = {} + --stylua: ignore + for _, diff in ipairs(fs_actions) do + -- Set grouping directory to also be used to compute relative paths + dir = diff.action == 'create' and diff.dir or H.fs_get_parent(diff.from) - local get_dir_actions = function(path) - local dir_path = H.fs_shorten_path(H.fs_get_parent(path)) - local dir_actions = actions_per_dir[dir_path] or {} - actions_per_dir[dir_path] = dir_actions - return dir_actions + -- Compute line depending on action + local action, l = diff.action, nil + local to_type = (diff.to or ''):sub(-1) == '/' and 'directory' or 'file' + local del_type = diff.to == nil and 'permanently' or 'to trash' + if action == 'create' then l = string.format("CREATE │ %s (%s)", rel(diff.to), to_type) end + if action == 'delete' then l = string.format("DELETE │ %s (%s)", rel(diff.from), del_type) end + if action == 'copy' then l = string.format("COPY │ %s => %s", rel(diff.from), rel(diff.to)) end + if action == 'move' then l = string.format("MOVE │ %s => %s", rel(diff.from), rel(diff.to)) end + if action == 'rename' then l = string.format("RENAME │ %s => %s", rel(diff.from), rel(diff.to)) end + + -- Add to per directory lines + local dir_actions = actions_per_dir[dir] or {} + table.insert(dir_actions, ' ' .. l) + actions_per_dir[dir] = dir_actions end - local get_quoted_basename = function(path) return string.format("'%s'", H.fs_get_basename(path)) end - - for _, diff in ipairs(fs_actions.copy) do - local dir_actions = get_dir_actions(diff.from) - local l = string.format(" COPY: %s to '%s'", get_quoted_basename(diff.from), H.fs_shorten_path(diff.to)) - table.insert(dir_actions, l) - end - - for _, path in ipairs(fs_actions.create) do - local dir_actions = get_dir_actions(path) - local fs_type = path:find('/$') == nil and 'file' or 'directory' - local l = string.format(' CREATE: %s (%s)', get_quoted_basename(path), fs_type) - table.insert(dir_actions, l) - end - - for _, path in ipairs(fs_actions.delete) do - local dir_actions = get_dir_actions(path) - local l = string.format(' DELETE: %s', get_quoted_basename(path)) - table.insert(dir_actions, l) - end - - for _, diff in ipairs(fs_actions.move) do - local dir_actions = get_dir_actions(diff.from) - local l = string.format(" MOVE: %s to '%s'", get_quoted_basename(diff.from), H.fs_shorten_path(diff.to)) - table.insert(dir_actions, l) - end - - for _, diff in ipairs(fs_actions.rename) do - local dir_actions = get_dir_actions(diff.from) - local l = string.format(' RENAME: %s to %s', get_quoted_basename(diff.from), get_quoted_basename(diff.to)) - table.insert(dir_actions, l) - end - - -- Convert to lines + -- Convert to final lines local res = { 'CONFIRM FILE SYSTEM ACTIONS', '' } for path, dir_actions in pairs(actions_per_dir) do - table.insert(res, path .. ':') + table.insert(res, short(path)) vim.list_extend(res, dir_actions) table.insert(res, '') end @@ -2452,41 +2696,27 @@ H.fs_actions_to_lines = function(fs_actions) return res end -H.fs_actions_apply = function(fs_actions, opts) - -- Copy first to allow later proper deleting - for _, diff in ipairs(fs_actions.copy) do - local ok, success = pcall(H.fs_copy, diff.from, diff.to) - local data = { action = 'copy', from = diff.from, to = diff.to } - if ok and success then H.trigger_event('MiniFilesActionCopy', data) end - end +H.fs_actions_apply = function(fs_actions) + for i = 1, #fs_actions do + local diff, action = fs_actions[i], fs_actions[i].action + local ok, success = pcall(H.fs_do[action], diff.from, diff.to) + if ok and success then + -- Trigger event + local to = action == 'create' and diff.to:gsub('/$', '') or diff.to + local data = { action = action, from = diff.from, to = to } + local action_titlecase = action:sub(1, 1):upper() .. action:sub(2) + H.trigger_event('MiniFilesAction' .. action_titlecase, data) - for _, path in ipairs(fs_actions.create) do - local ok, success = pcall(H.fs_create, path) - local data = { action = 'create', to = H.fs_normalize_path(path) } - if ok and success then H.trigger_event('MiniFilesActionCreate', data) end - end - - for _, diff in ipairs(fs_actions.move) do - local ok, success = pcall(H.fs_move, diff.from, diff.to) - local data = { action = 'move', from = diff.from, to = diff.to } - if ok and success then H.trigger_event('MiniFilesActionMove', data) end - end - - for _, diff in ipairs(fs_actions.rename) do - local ok, success = pcall(H.fs_rename, diff.from, diff.to) - local data = { action = 'rename', from = diff.from, to = diff.to } - if ok and success then H.trigger_event('MiniFilesActionRename', data) end - end - - -- Delete last to not lose anything too early (just in case) - for _, path in ipairs(fs_actions.delete) do - local ok, success = pcall(H.fs_delete, path, opts.options.permanent_delete) - local data = { action = 'delete', from = path } - if ok and success then H.trigger_event('MiniFilesActionDelete', data) end + -- Modify later actions to account for file movement + local has_moved = to ~= nil and not (action == 'copy' or action == 'create') + if has_moved then H.adjust_after_move(diff.from, to, fs_actions, i + 1) end + end end end -H.fs_create = function(path) +H.fs_do = {} + +H.fs_do.create = function(_, path) -- Don't override existing path if H.fs_is_present_path(path) then return H.warn_existing_path(path, 'create') end @@ -2494,15 +2724,12 @@ H.fs_create = function(path) vim.fn.mkdir(H.fs_get_parent(path), 'p') -- Create - local fs_type = path:find('/$') == nil and 'file' or 'directory' - if fs_type == 'directory' then - return vim.fn.mkdir(path) == 1 - else - return vim.fn.writefile({}, path) == 0 - end + local fs_type = path:sub(-1) == '/' and 'directory' or 'file' + if fs_type == 'directory' then return vim.fn.mkdir(path) == 1 end + return vim.fn.writefile({}, path) == 0 end -H.fs_copy = function(from, to) +H.fs_do.copy = function(from, to) -- Don't override existing path if H.fs_is_present_path(to) then return H.warn_existing_path(from, 'copy') end @@ -2522,34 +2749,33 @@ H.fs_copy = function(from, to) local success = true for _, entry in ipairs(fs_entries) do - success = success and H.fs_copy(entry.path, H.fs_child_path(to, entry.name)) + success = success and H.fs_do.copy(entry.path, H.fs_child_path(to, entry.name)) end return success end -H.fs_delete = function(path, permanent_delete) - if permanent_delete then return vim.fn.delete(path, 'rf') == 0 end - - -- Move to trash instead of permanent delete - local trash_dir = H.fs_child_path(vim.fn.stdpath('data'), 'mini.files/trash') - vim.fn.mkdir(trash_dir, 'p') - - local trash_path = H.fs_child_path(trash_dir, H.fs_get_basename(path)) - - -- Ensure that same basenames are replaced - pcall(vim.fn.delete, trash_path, 'rf') - - return vim.loop.fs_rename(path, trash_path) +H.fs_do.delete = function(from, to) + -- Act based on whether delete is permanent or not + if to == nil then return vim.fn.delete(from, 'rf') == 0 end + pcall(vim.fn.delete, to, 'rf') + return H.fs_do.move(from, to) end -H.fs_move = function(from, to) +H.fs_do.move = function(from, to) -- Don't override existing path if H.fs_is_present_path(to) then return H.warn_existing_path(from, 'move or rename') end -- Move while allowing to create directory vim.fn.mkdir(H.fs_get_parent(to), 'p') - local success = vim.loop.fs_rename(from, to) + local success, _, err_code = vim.loop.fs_rename(from, to) + + if err_code == 'EXDEV' then + -- Handle cross-device move separately as `loop.fs_rename` does not work + success = H.fs_do.copy(from, to) + if success then success = pcall(vim.fn.delete, from, 'rf') end + if not success then pcall(vim.fn.delete, to, 'rf') end + end if not success then return success end @@ -2565,7 +2791,7 @@ H.fs_move = function(from, to) return success end -H.fs_rename = H.fs_move +H.fs_do.rename = H.fs_do.move H.rename_loaded_buffer = function(buf_id, from, to) if not (vim.api.nvim_buf_is_loaded(buf_id) and vim.bo[buf_id].buftype == '') then return end @@ -2587,6 +2813,17 @@ H.warn_existing_path = function(path, action) return false end +H.adjust_after_move = function(from, to, fs_actions, start_ind) + local from_dir_pattern, to_dir = '^' .. vim.pesc(from .. '/'), to .. '/' + for i = start_ind, #fs_actions do + local diff = fs_actions[i] + -- Adjust completely to use entry at new location + if diff.from ~= nil then diff.from = diff.from == from and to or diff.from:gsub(from_dir_pattern, to_dir) end + -- Adjust only parent directory to correctly compute target + if diff.to ~= nil then diff.to = diff.to:gsub(from_dir_pattern, to_dir) end + end +end + -- Validators ----------------------------------------------------------------- H.validate_opened_buffer = function(x) if x == nil or x == 0 then x = vim.api.nvim_get_current_buf() end @@ -2602,6 +2839,25 @@ H.validate_line = function(buf_id, x) return x end +H.validate_branch = function(x) + if not (H.islist(x) and x[1] ~= nil) then H.error('`branch` should be array with at least one element') end + local res = {} + for i, p in ipairs(x) do + if type(p) ~= 'string' then H.error('`branch` contains not string: ' .. vim.inspect(p)) end + p = H.fs_full_path(p) + if not H.fs_is_present_path(p) then H.error('`branch` contains not present path: ' .. vim.inspect(p)) end + res[i] = p + end + for i = 2, #res do + local parent, child = res[i - 1], res[i] + if (parent .. '/' .. child:match('[^/]+$')) ~= res[i] then + H.error('`branch` contains not a parent-child pair: ' .. vim.inspect(parent) .. ' and ' .. vim.inspect(child)) + end + end + if #res == 1 and H.fs_get_type(res[1]) == 'file' then H.error('`branch` should contain at least one directory') end + return res +end + -- Utilities ------------------------------------------------------------------ H.error = function(msg) error(string.format('(mini.files) %s', msg), 0) end @@ -2613,10 +2869,7 @@ H.map = function(mode, lhs, rhs, opts) vim.keymap.set(mode, lhs, rhs, opts) end -H.trigger_event = function(event_name, data) - if H.block_event_trigger[event_name] then return end - vim.api.nvim_exec_autocmds('User', { pattern = event_name, data = data }) -end +H.trigger_event = function(event_name, data) vim.api.nvim_exec_autocmds('User', { pattern = event_name, data = data }) end H.is_valid_buf = function(buf_id) return type(buf_id) == 'number' and vim.api.nvim_buf_is_valid(buf_id) end @@ -2632,10 +2885,26 @@ end H.set_extmark = function(...) pcall(vim.api.nvim_buf_set_extmark, ...) end +H.win_set_buf = function(win_id, buf_id) + vim.wo[win_id].winfixbuf = false + vim.api.nvim_win_set_buf(win_id, buf_id) + vim.wo[win_id].winfixbuf = true +end +if vim.fn.has('nvim-0.10') == 0 then H.win_set_buf = vim.api.nvim_win_set_buf end + H.get_first_valid_normal_window = function() for _, win_id in ipairs(vim.api.nvim_tabpage_list_wins(0)) do if vim.api.nvim_win_get_config(win_id).relative == '' then return win_id end end end +H.getcharstr = function() + local ok, char = pcall(vim.fn.getcharstr) + if not ok or char == '\27' or char == '' then return end + return char +end + +-- TODO: Remove after compatibility with Neovim=0.9 is dropped +H.islist = vim.fn.has('nvim-0.10') == 1 and vim.islist or vim.tbl_islist + return MiniFiles diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/git.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/git.lua index c4367963..8206615a 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/git.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/git.lua @@ -300,7 +300,8 @@ MiniGit.config = { --- Show Git related data at cursor --- ---- - If there is a commit-like ||, show it in split with `git show`. +--- - If inside |mini.deps| confirmation buffer, show in split relevant commit data. +--- - If there is a commit-like ||, show it in split. --- - If possible, show diff source via |MiniGit.show_diff_source()|. --- - If possible, show range history via |MiniGit.show_range_history()|. --- - Otherwise throw an error. @@ -309,17 +310,22 @@ MiniGit.config = { --- - __git_split_field --- - Fields appropriate for forwarding to other functions. MiniGit.show_at_cursor = function(opts) - local exec = MiniGit.config.job.git_executable - local cwd = H.get_git_cwd() + -- Try showing commit data at cursor + local commit, cwd + if vim.bo.filetype == 'minideps-confirm' then + commit, cwd = H.deps_pos_to_source() + else + local cword = vim.fn.expand('') + local is_commit = string.find(cword, '^%x%x%x%x%x%x%x+$') ~= nil and string.lower(cword) == cword + commit = is_commit and cword or nil + cwd = is_commit and H.get_git_cwd() or nil + end - -- Try showing commit at cursor - local cword = vim.fn.expand('') - local is_commit = string.find(cword, '^%x%x%x%x%x%x%x+$') ~= nil and string.lower(cword) == cword - if is_commit then + if commit ~= nil and cwd ~= nil then local split = H.normalize_split_opt((opts or {}).split or 'auto', 'opts.split') - local args = { 'show', cword } + local args = { 'show', '--stat', '--patch', commit } local lines = H.git_cli_output(args, cwd) - if #lines == 0 then return H.notify('Can not show commit ' .. cword, 'WARN') end + if #lines == 0 then return H.notify('Can not show commit ' .. commit .. ' in repo ' .. cwd, 'WARN') end H.show_in_split(split, lines, 'show', table.concat(args, ' ')) vim.bo.filetype = 'git' return @@ -432,11 +438,12 @@ MiniGit.show_range_history = function(opts) -- Construct `:Git log` command that works both with regular files and -- buffers from `show_diff_source()` - local buf_name = vim.api.nvim_buf_get_name(0) - local cwd = H.get_git_cwd() + local buf_name, cwd = vim.api.nvim_buf_get_name(0), H.get_git_cwd() local commit, rel_path = H.parse_diff_source_buf_name(buf_name) if commit == nil then - commit, rel_path = 'HEAD', buf_name:gsub(vim.pesc(cwd) .. '/', '') + commit = 'HEAD' + local cwd_pattern = '^' .. vim.pesc(cwd:gsub('\\', '/')) .. '/' + rel_path = buf_name:gsub('\\', '/'):gsub(cwd_pattern, '') end -- Ensure no uncommitted changes as they might result into improper `-L` arg @@ -642,10 +649,10 @@ end H.apply_config = function(config) MiniGit.config = config end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniGit', {}) + local gr = vim.api.nvim_create_augroup('MiniGit', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end -- NOTE: Try auto enabling buffer on every `BufEnter` to not have `:edit` @@ -1566,6 +1573,29 @@ end H.parse_diff_source_buf_name = function(buf_name) return string.match(buf_name, '^minigit://%d+/.*show (%x+~?):(.*)$') end +H.deps_pos_to_source = function() + local lines = vim.api.nvim_buf_get_lines(0, 0, vim.fn.line('.'), false) + -- Do nothing if on the title (otherwise it operates on previous plugin info) + if lines[#lines]:find('^[%+%-!]') ~= nil then return end + + -- Locate lines with commit and repo path data + local commit, commit_lnum = nil, #lines + while commit == nil and commit_lnum >= 1 do + local l = lines[commit_lnum] + commit = l:match('^[><] (%x%x%x%x%x%x%x%x*) |') or l:match('^State[^:]*: %s*(%x+)') + commit_lnum = commit_lnum - 1 + end + + local cwd, cwd_lnum = nil, #lines + while cwd == nil and cwd_lnum >= 1 do + cwd, cwd_lnum = lines[cwd_lnum]:match('^Path: %s*(%S+)$'), cwd_lnum - 1 + end + + -- Do nothing if something is not found or path corresponds to next repo + if commit == nil or cwd == nil or commit_lnum <= cwd_lnum then return end + return commit, cwd +end + -- Folding -------------------------------------------------------------------- H.is_hunk_header = function(lnum) return vim.fn.getline(lnum):find('^@@.*@@') ~= nil end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/hipatterns.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/hipatterns.lua index 0ca4298a..5c4e2ae0 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/hipatterns.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/hipatterns.lua @@ -699,13 +699,14 @@ end H.apply_config = function(config) MiniHipatterns.config = config end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniHipatterns', {}) + local gr = vim.api.nvim_create_augroup('MiniHipatterns', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au('BufEnter', '*', H.auto_enable, 'Enable highlighting') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') au('ColorScheme', '*', H.on_colorscheme, 'Reload all enabled pattern highlighters') end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/hues.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/hues.lua index 9a9bfd29..8bfb033d 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/hues.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/hues.lua @@ -49,6 +49,7 @@ --- - 'HiPhish/rainbow-delimiters.nvim' --- - 'hrsh7th/nvim-cmp' --- - 'justinmk/vim-sneak' +--- - 'kevinhwang91/nvim-bqf' --- - 'kevinhwang91/nvim-ufo' --- - 'lewis6991/gitsigns.nvim' --- - 'lukas-reineke/indent-blankline.nvim' @@ -477,14 +478,16 @@ MiniHues.apply_palette = function(palette, plugins) hi('Normal', { fg=p.fg, bg=p.bg }) hi('NormalFloat', { fg=p.fg, bg=p.bg_edge }) hi('NormalNC', { link='Normal' }) - hi('PMenu', { fg=p.fg, bg=p.bg_mid }) - hi('PMenuExtra', { link='PMenu' }) - hi('PMenuExtraSel', { link='PMenuSel' }) - hi('PMenuKind', { link='PMenu' }) - hi('PMenuKindSel', { link='PMenuSel' }) - hi('PMenuSbar', { link='PMenu' }) - hi('PMenuSel', { fg=p.bg, bg=p.fg, blend=0 }) - hi('PMenuThumb', { fg=nil, bg=p.bg_mid2 }) + hi('Pmenu', { fg=p.fg, bg=p.bg_mid }) + hi('PmenuExtra', { link='Pmenu' }) + hi('PmenuExtraSel', { link='PmenuSel' }) + hi('PmenuKind', { link='Pmenu' }) + hi('PmenuKindSel', { link='PmenuSel' }) + hi('PmenuMatch', { fg=p.fg, bg=p.bg_mid, bold=true }) + hi('PmenuMatchSel', { fg=nil, bg=nil, bold=true, blend=0, reverse=true }) + hi('PmenuSbar', { link='Pmenu' }) + hi('PmenuSel', { fg=nil, bg=nil, blend=0, reverse=true }) + hi('PmenuThumb', { fg=nil, bg=p.bg_mid2 }) hi('Question', { fg=p.azure, bg=nil }) hi('QuickFixLine', { fg=nil, bg=nil, bold=true }) hi('Search', { fg=p.bg, bg=p.accent }) @@ -508,7 +511,7 @@ MiniHues.apply_palette = function(palette, plugins) hi('VisualNOS', { fg=nil, bg=p.bg_mid }) hi('WarningMsg', { fg=p.yellow, bg=nil }) hi('Whitespace', { fg=p.bg_mid2, bg=nil }) - hi('WildMenu', { link='PMenuSel' }) + hi('WildMenu', { link='PmenuSel' }) hi('WinBar', { link='StatusLine' }) hi('WinBarNC', { link='StatusLineNC' }) hi('WinSeparator', { fg=p.accent, bg=nil }) @@ -749,6 +752,7 @@ MiniHues.apply_palette = function(palette, plugins) hi('@string.special.symbol', { link='@constant' }) hi('@string.special.path', { link='Directory' }) hi('@string.special.url', { link='@markup.link.url' }) + hi('@string.special.vimdoc', { link='@constant' }) -- @character -- @character.special @@ -807,7 +811,7 @@ MiniHues.apply_palette = function(palette, plugins) hi('@markup.strong', { link='@text.strong' }) hi('@markup.italic', { link='@text.emphasis' }) - hi('@markup.strikethrough', { link='@text.strikethrough' }) + hi('@markup.strikethrough', { link='@text.strike' }) hi('@markup.underline', { link='@text.underline' }) hi('@markup.heading', { link='@text.title' }) @@ -922,6 +926,7 @@ MiniHues.apply_palette = function(palette, plugins) hi('MiniPickBorder', { link='FloatBorder' }) hi('MiniPickBorderBusy', { link='DiagnosticFloatingWarn' }) hi('MiniPickBorderText', { link='FloatTitle' }) + hi('MiniPickCursor', { blend=100, nocombine=true }) hi('MiniPickIconDirectory', { link='Directory' }) hi('MiniPickIconFile', { link='MiniPickNormal' }) hi('MiniPickHeader', { link='DiagnosticFloatingHint' }) @@ -1146,6 +1151,13 @@ MiniHues.apply_palette = function(palette, plugins) hi('SneakLabel', { fg=p.bg, bg=p.orange, bold=true }) end + -- 'kevinhwang91/nvim-bqf' + if has_integration('kevinhwang91/nvim-bqf') then + hi('BqfPreviewFloat', { link='NormalFloat' }) + hi('BqfPreviewTitle', { link='FloatTitle' }) + hi('BqfSign', { fg=p.cyan }) + end + -- 'kevinhwang91/nvim-ufo' -- Everything works correctly out of the box diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/icons.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/icons.lua index c2cc64fc..ad2c05f2 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/icons.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/icons.lua @@ -194,6 +194,9 @@ MiniIcons.setup = function(config) -- Apply config H.apply_config(config) + -- Define behavior + H.create_autocommands() + -- Create default highlighting H.create_default_hl() end @@ -1937,6 +1940,11 @@ H.apply_config = function(config) H.init_cache(config) end +H.create_autocommands = function() + local gr = vim.api.nvim_create_augroup('MiniIcons', {}) + vim.api.nvim_create_autocmd('ColorScheme', { group = gr, callback = H.create_default_hl, desc = 'Ensure colors' }) +end + --stylua: ignore H.create_default_hl = function() local hi = function(name, opts) @@ -2035,7 +2043,7 @@ H.get_impl = { -- Built-in extensions local icon_data = H.extension_icons[name] if type(icon_data) == 'string' then return MiniIcons.get('filetype', icon_data) end - if icon_data ~= nil then return icon_data, icon_data.hl end + if icon_data ~= nil then return icon_data end -- Parts of complex extension (if can be recognized) local dot = string.find(name, '%..') @@ -2058,7 +2066,8 @@ H.get_impl = { -- Built-in file names local icon_data = H.file_icons[basename] if type(icon_data) == 'string' then return MiniIcons.get('filetype', icon_data) end - if icon_data ~= nil then return icon_data end + -- - Style icon based on the basename and not full name + if icon_data ~= nil then return H.style_icon(icon_data.glyph, basename), icon_data.hl end -- Basename extensions. Prefer this before `vim.filetype.match()` for speed -- (as the latter is slow-ish; like 0.1 ms in Neovim<0.11) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/indentscope.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/indentscope.lua index 527cea3c..17ab936a 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/indentscope.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/indentscope.lua @@ -660,24 +660,18 @@ H.apply_config = function(config) end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniIndentscope', {}) + local gr = vim.api.nvim_create_augroup('MiniIndentscope', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end - au( - { 'CursorMoved', 'CursorMovedI', 'ModeChanged' }, - '*', - function() H.auto_draw({ lazy = true }) end, - 'Auto draw indentscope lazily' - ) - au( - { 'TextChanged', 'TextChangedI', 'TextChangedP', 'WinScrolled' }, - '*', - function() H.auto_draw() end, - 'Auto draw indentscope' - ) + local lazy_events = { 'CursorMoved', 'CursorMovedI', 'ModeChanged' } + au(lazy_events, '*', function() H.auto_draw({ lazy = true }) end, 'Auto draw indentscope lazily') + local now_events = { 'TextChanged', 'TextChangedI', 'TextChangedP', 'WinScrolled' } + au(now_events, '*', function() H.auto_draw() end, 'Auto draw indentscope') + + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end --stylua: ignore @@ -947,7 +941,9 @@ H.make_draw_function = function(indicator, opts) virt_text_pos = 'overlay', } - if H.has_wrapped_virt_text and vim.wo.breakindent then extmark_opts.virt_text_repeat_linebreak = true end + if H.has_wrapped_virt_text and vim.wo.breakindent and vim.wo.showbreak == '' then + extmark_opts.virt_text_repeat_linebreak = true + end local current_event_id = opts.event_id diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/jump.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/jump.lua index f8ff4383..a398c41a 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/jump.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/jump.lua @@ -337,14 +337,15 @@ H.apply_config = function(config) end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniJump', {}) + local gr = vim.api.nvim_create_augroup('MiniJump', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au('CursorMoved', '*', H.on_cursormoved, 'On CursorMoved') au({ 'BufLeave', 'InsertEnter' }, '*', MiniJump.stop_jumping, 'Stop jumping') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end H.create_default_hl = function() vim.api.nvim_set_hl(0, 'MiniJump', { default = true, link = 'SpellRare' }) end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/jump2d.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/jump2d.lua index 0f025a29..51106f3a 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/jump2d.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/jump2d.lua @@ -721,10 +721,10 @@ H.apply_config = function(config) end H.create_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniJump2d', {}) + local gr = vim.api.nvim_create_augroup('MiniJump2d', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { pattern = pattern, group = augroup, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { pattern = pattern, group = gr, callback = callback, desc = desc }) end -- Corrections for default `` mapping to not interfere with popular usages @@ -734,8 +734,7 @@ H.create_autocommands = function(config) au('CmdwinEnter', '*', revert_cr, 'Revert ') end - -- Ensure proper colors - au('ColorScheme', '*', H.create_default_hl, 'Ensure proper colors') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end --stylua: ignore diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/map.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/map.lua index 7e565787..c31182e9 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/map.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/map.lua @@ -1034,10 +1034,10 @@ end H.apply_config = function(config) MiniMap.config = config end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniMap', {}) + local gr = vim.api.nvim_create_augroup('MiniMap', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au({ 'BufEnter', 'BufWritePost', 'TextChanged', 'VimResized' }, '*', H.on_content_change, 'On content change') @@ -1045,6 +1045,7 @@ H.create_autocommands = function() au('WinLeave', '*', H.on_winleave, 'On WinLeave') au('WinClosed', '*', H.on_winclosed, 'On WinClosed') au('ModeChanged', '*:n', H.on_content_change, 'On return to Normal mode') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end --stylua: ignore @@ -1395,7 +1396,7 @@ H.create_map_buffer = function() local buf_id = vim.api.nvim_create_buf(false, true) -- Set buffer local options (which don't involve `noautocmd`) - vim.api.nvim_buf_set_option(buf_id, 'filetype', 'minimap') + vim.bo[buf_id].filetype = 'minimap' -- Make buffer local mappings vim.keymap.set('n', '', 'lua MiniMap.toggle_focus(false)', { buffer = buf_id }) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/misc.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/misc.lua index 84bf1867..94389d45 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/misc.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/misc.lua @@ -272,7 +272,7 @@ MiniMisc.find_root = function(buf_id, names, fallback) -- Use absolute path to an existing directory if type(res) ~= 'string' then return end - res = vim.fn.fnamemodify(res, ':p') + res = H.fs_normalize(vim.fn.fnamemodify(res, ':p')) if vim.fn.isdirectory(res) == 0 then return end -- Cache result per directory path @@ -286,19 +286,34 @@ H.root_cache = {} --- Set up terminal background synchronization --- --- What it does: ---- - Checks if terminal emulator supports OSC 11 control sequence. Stops if not. ---- - Creates |UIEnter| and |ColorScheme| autocommands which change terminal ---- background to have same color as |guibg| of |hl-Normal|. ---- - Creates |UILeave| autocommand which sets terminal background back to the ---- color at the time this function was called first time in current session. +--- - Checks if terminal emulator supports OSC 11 control sequence through +--- appropriate `stdout`. Stops if not. +--- - Creates autocommands for |ColorScheme| and |VimResume| events, which +--- change terminal background to have same color as |guibg| of |hl-Normal|. +--- - Creates autocommands for |VimLeavePre| and |VimSuspend| events which set +--- terminal background back to the color at the time this function was +--- called first time in current session. --- - Synchronizes background immediately to allow not depend on loading order. --- --- Primary use case is to remove possible "frame" around current Neovim instance --- which appears if Neovim's |hl-Normal| background color differs from what is --- used by terminal emulator itself. --- ---- Make sure to call it only during interactive session in terminal emulator. +--- Works only on Neovim>=0.10. MiniMisc.setup_termbg_sync = function() + if vim.fn.has('nvim-0.10') == 0 then + -- Handling `'\027]11;?\007'` response was added in Neovim 0.10 + H.notify('`setup_termbg_sync()` requires Neovim>=0.10', 'WARN') + return + end + + -- Proceed only if there is a valid stdout to use + local has_stdout_tty = false + for _, ui in ipairs(vim.api.nvim_list_uis()) do + has_stdout_tty = has_stdout_tty or ui.stdout_tty + end + if not has_stdout_tty then return end + local augroup = vim.api.nvim_create_augroup('MiniMiscTermbgSync', { clear = true }) local f = function(args) local ok, bg_init = pcall(H.parse_osc11, args.data) @@ -311,14 +326,16 @@ MiniMisc.setup_termbg_sync = function() local sync = function() local normal = vim.api.nvim_get_hl_by_name('Normal', true) if normal.background == nil then return end - io.write(string.format('\027]11;#%06x\007', normal.background)) + -- NOTE: use `io.stdout` instead of `io.write` to ensure correct target + -- Otherwise after `io.output(file); file:close()` there is an error + io.stdout:write(string.format('\027]11;#%06x\007', normal.background)) end - vim.api.nvim_create_autocmd({ 'UIEnter', 'ColorScheme' }, { group = augroup, callback = sync }) + vim.api.nvim_create_autocmd({ 'VimResume', 'ColorScheme' }, { group = augroup, callback = sync }) -- Set up reset to the color returned from the very first call H.termbg_init = H.termbg_init or bg_init - local reset = function() io.write('\027]11;' .. H.termbg_init .. '\007') end - vim.api.nvim_create_autocmd({ 'UILeave' }, { group = augroup, callback = reset }) + local reset = function() io.stdout:write('\027]11;' .. H.termbg_init .. '\007') end + vim.api.nvim_create_autocmd({ 'VimLeavePre', 'VimSuspend' }, { group = augroup, callback = reset }) -- Sync immediately sync() @@ -326,7 +343,7 @@ MiniMisc.setup_termbg_sync = function() -- Ask about current background color and process the response local id = vim.api.nvim_create_autocmd('TermResponse', { group = augroup, callback = f, once = true, nested = true }) - io.write('\027]11;?\007') + io.stdout:write('\027]11;?\007') vim.defer_fn(function() local ok = pcall(vim.api.nvim_del_autocmd, id) if ok then H.notify('`setup_termbg_sync()` did not get response from terminal emulator', 'WARN') end @@ -553,8 +570,7 @@ MiniMisc.use_nested_comments = function(buf_id) local leader = vim.trim(comment_parts[1]) local comments = vim.bo[buf_id].comments - local new_comments = string.format('n:%s,%s', leader, comments) - vim.api.nvim_buf_set_option(buf_id, 'comments', new_comments) + vim.bo[buf_id].comments = string.format('n:%s,%s', leader, comments) end --- Zoom in and out of a buffer, making it full screen in a floating window @@ -594,7 +610,9 @@ H.setup_config = function(config) -- General idea: if some table elements are not present in user-supplied -- `config`, take them from default config vim.validate({ config = { config, 'table', true } }) - config = vim.tbl_deep_extend('force', vim.deepcopy(H.default_config), config or {}) + -- NOTE: Don't use `tbl_deep_extend` to prefer full input `make_global` array + -- Needs adjusting if there is a new setting with nested tables + config = vim.tbl_extend('force', vim.deepcopy(H.default_config), config or {}) vim.validate({ make_global = { @@ -639,6 +657,11 @@ H.is_number = function(x) return type(x) == 'number' end H.is_string = function(x) return type(x) == 'string' end +H.fs_normalize = vim.fs.normalize +if vim.fn.has('nvim-0.9') == 0 then + H.fs_normalize = function(...) return vim.fs.normalize(...):gsub('(.)/+$', '%1') end +end + -- TODO: Remove after compatibility with Neovim=0.9 is dropped H.islist = vim.fn.has('nvim-0.10') == 1 and vim.islist or vim.tbl_islist diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/move.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/move.lua index 8249cb3f..87b73d98 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/move.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/move.lua @@ -189,6 +189,12 @@ MiniMove.move_selection = function(direction, opts) local dir_type = (direction == 'up' or direction == 'down') and 'vert' or 'hori' local is_linewise = cur_mode == 'V' + -- Make early return in small buffer + if vim.api.nvim_buf_line_count(0) == 1 then + if is_linewise and dir_type == 'vert' then return end + if not is_linewise and vim.fn.getline(1):len() == 0 then return end + end + -- Cache useful data because it will be reset when executing commands local n_times = opts.n_times or vim.v.count1 local ref_curpos, ref_last_col = vim.fn.getcurpos(), vim.fn.col('$') @@ -222,8 +228,9 @@ MiniMove.move_selection = function(direction, opts) if not cache_virtualedit:find('all') then vim.o.virtualedit = 'onemore' end -- Cut selection while saving caching register - local cache_z_reg = vim.fn.getreg('z') - cmd('"zx') + local cache_z_reg = vim.fn.getreginfo('z') + -- - Don't use `"zx` directly to not affect registers 1-9 + cmd('"zygv"_x') -- Detect edge selection: last line(s) for vertical and last character(s) -- for horizontal. At this point (after cutting selection) cursor is on the @@ -310,6 +317,7 @@ end ---@param opts __move_opts MiniMove.move_line = function(direction, opts) if H.is_disabled() or not vim.o.modifiable then return end + if vim.api.nvim_buf_line_count(0) == 1 and (direction == 'down' or direction == 'up') then return end opts = vim.tbl_deep_extend('force', H.get_config().options, opts or {}) @@ -340,9 +348,10 @@ MiniMove.move_line = function(direction, opts) return end - -- Cut curre lint while saving caching register - local cache_z_reg = vim.fn.getreg('z') - cmd('"zdd') + -- Cut current line while saving caching register + local cache_z_reg = vim.fn.getreginfo('z') + -- - Don't use `"zdd` directly to not affect registers 1-9 + cmd('"zyy"_dd') -- Move cursor local paste_key = direction == 'up' and 'P' or 'p' @@ -457,7 +466,7 @@ H.make_cmd_normal = function(include_undojoin) -- Disable 'mini.bracketed' to avoid unwanted entries to its yank history local cache_minibracketed_disable = vim.b.minibracketed_disable - local cache_unnamed_register = vim.fn.getreg('"') + local cache_unnamed_register = { points_to = vim.fn.getreginfo('"').points_to } -- Don't track possible put commands into yank history vim.b.minibracketed_disable = true diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/notify.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/notify.lua index df73c427..5550e21c 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/notify.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/notify.lua @@ -105,7 +105,7 @@ MiniNotify.setup = function(config) H.apply_config(config) -- Define behavior - H.create_autocommands(config) + H.create_autocommands() -- Create default highlighting H.create_default_hl() @@ -596,14 +596,15 @@ H.apply_config = function(config) end end -H.create_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniNotify', {}) +H.create_autocommands = function() + local gr = vim.api.nvim_create_augroup('MiniNotify', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au({ 'TabEnter', 'VimResized' }, '*', function() MiniNotify.refresh() end, 'Refresh notifications') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end --stylua: ignore @@ -741,9 +742,10 @@ H.window_open = function(buf_id) local win_id = vim.api.nvim_open_win(buf_id, false, config) vim.wo[win_id].foldenable = false - vim.wo[win_id].wrap = true + vim.wo[win_id].foldmethod = 'manual' vim.wo[win_id].winblend = H.get_config().window.winblend vim.wo[win_id].winhighlight = 'NormalFloat:MiniNotifyNormal,FloatBorder:MiniNotifyBorder,FloatTitle:MiniNotifyTitle' + vim.wo[win_id].wrap = true return win_id end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/operators.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/operators.lua index 8638c56c..600f2c29 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/operators.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/operators.lua @@ -182,6 +182,9 @@ MiniOperators.setup = function(config) -- Apply config H.apply_config(config) + -- Define behavior + H.create_autocommands() + -- Create default highlighting H.create_default_hl() end @@ -742,6 +745,11 @@ H.get_config = function(config) return vim.tbl_deep_extend('force', MiniOperators.config, vim.b.minioperators_config or {}, config or {}) end +H.create_autocommands = function() + local gr = vim.api.nvim_create_augroup('MiniOperators', {}) + vim.api.nvim_create_autocmd('ColorScheme', { group = gr, callback = H.create_default_hl, desc = 'Ensure colors' }) +end + H.create_default_hl = function() vim.api.nvim_set_hl(0, 'MiniOperatorsExchangeFrom', { default = true, link = 'IncSearch' }) end @@ -997,7 +1005,7 @@ H.replace_do = function(data) local edge_to_col = vim.fn.col({ to_line, '$' }) - 1 - (vim.o.selection == 'exclusive' and 0 or 1) local is_edge_line = submode == 'V' and to_line == vim.fn.line('$') - local is_edge_col = submode ~= 'V' and to_col == edge_to_col + local is_edge_col = submode ~= 'V' and to_col == edge_to_col and vim.o.virtualedit ~= 'all' local is_edge = is_edge_line or is_edge_col local covers_linewise_all_buffer = is_edge_line and from_line == 1 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/pairs.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/pairs.lua index ef4672e2..5bea3c95 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/pairs.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/pairs.lua @@ -494,10 +494,10 @@ H.apply_config = function(config) end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniPairs', {}) + local gr = vim.api.nvim_create_augroup('MiniPairs', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au('FileType', { 'TelescopePrompt', 'fzf' }, function() vim.b.minipairs_disable = true end, 'Disable locally') diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/pick.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/pick.lua index e08a3668..cd25f954 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/pick.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/pick.lua @@ -117,6 +117,7 @@ --- * `MiniPickBorder` - window border. --- * `MiniPickBorderBusy` - window border while picker is busy processing. --- * `MiniPickBorderText` - non-prompt on border. +--- * `MiniPickCursor` - cursor during active picker (hidden by default). --- * `MiniPickIconDirectory` - default icon for directory. --- * `MiniPickIconFile` - default icon for file. --- * `MiniPickHeader` - headers in info buffer and previews. @@ -692,7 +693,7 @@ MiniPick.setup = function(config) H.apply_config(config) -- Define behavior - H.create_autocommands(config) + H.create_autocommands() -- Create default highlighting H.create_default_hl() @@ -704,7 +705,7 @@ MiniPick.setup = function(config) local paste_orig = vim.paste vim.paste = function(...) if not MiniPick.is_picker_active() then return paste_orig(...) end - vim.notify('(mini.pick) Use `mappings.paste` (`` by default) with "*" or "+" register.', vim.log.levels.HINT) + H.notify('Use `mappings.paste` (`` by default) with "*" or "+" register.', 'HINT') end end @@ -975,20 +976,35 @@ end ---@param inds table Array of `stritems` indexes to match. All of them should point --- at string elements of `stritems`. No check is done for performance reasons. ---@param query table Array of strings. ----@param do_sync boolean|nil Whether to match synchronously. Default: `nil`. +---@param opts table|nil Options. Possible fields: +--- - `(boolean)` - Whether to match synchronously. Default: `false`. +--- - `(boolean)` - Whether to skip sort step. Default: `false`. --- ----@return table|nil Depending on whether computation is synchronous (either `do_sync` ---- is truthy or there is an active picker): +---@return table|nil Depending on whether computation is synchronous (either `opts.sync` +--- is `true` or there is an active picker): --- - If yes, array of `stritems` indexes matching the `query` (from best to worst). --- - If no, `nil` is returned with |MiniPick.set_picker_match_inds()| used later. -MiniPick.default_match = function(stritems, inds, query, do_sync) - local is_sync = do_sync or not MiniPick.is_picker_active() +MiniPick.default_match = function(stritems, inds, query, opts) + -- TODO: Remove after mini.nvim 0.14 release + if opts and type(opts) ~= 'table' then + if not H.notified_match_opts then + local msg = 'Use `{ sync = true }` as fourth argument to `default_match`.' + .. " Current code will not work after the next 'mini.nvim' release." + H.notify(msg, 'WARN') + H.notified_match_opts = true + end + opts = { sync = true } + end + + opts = opts or {} + local is_sync = opts.sync or not MiniPick.is_picker_active() local set_match_inds = is_sync and function(x) return x end or MiniPick.set_picker_match_inds local f = function() if #query == 0 then return set_match_inds(H.seq_along(stritems)) end local match_data, match_type = H.match_filter(inds, stritems, query) if match_data == nil then return end - if match_type == 'nosort' then return set_match_inds(H.seq_along(stritems)) end + if match_type == 'useall' then return set_match_inds(H.seq_along(stritems)) end + if opts.preserve_order then return set_match_inds(H.match_no_sort(match_data)) end local match_inds = H.match_sort(match_data) if match_inds == nil then return end return set_match_inds(match_inds) @@ -1163,8 +1179,7 @@ MiniPick.default_choose_marked = function(items, opts) for _, item in ipairs(items) do local item_data = H.parse_item(item) if item_data.type == 'file' or item_data.type == 'buffer' or item_data.type == 'uri' then - local is_uri, uri_path = pcall(vim.uri_to_fname, item_data.path) - local entry = { bufnr = item_data.buf_id, filename = is_uri and uri_path or item_data.path } + local entry = { bufnr = item_data.buf_id, filename = H.parse_uri(item_data.path) or item_data.path } entry.lnum, entry.col, entry.text = item_data.lnum or 1, item_data.col or 1, item_data.text or '' entry.end_lnum, entry.end_col = item_data.end_lnum, item_data.end_col table.insert(list, entry) @@ -1655,7 +1670,13 @@ MiniPick.set_picker_items_from_cli = function(command, opts) local process, pid, stdout = nil, nil, vim.loop.new_pipe() local spawn_opts = vim.tbl_deep_extend('force', opts.spawn_opts, { args = args, stdio = { nil, stdout, nil } }) if type(spawn_opts.cwd) == 'string' then spawn_opts.cwd = H.full_path(spawn_opts.cwd) end - process, pid = vim.loop.spawn(executable, spawn_opts, function() process:close() end) + process, pid = vim.loop.spawn(executable, spawn_opts, function() + if process:is_active() then process:close() end + end) + + -- Make sure to stop the process if picker is stopped + local kill_process = function() pcall(vim.loop.process_kill, process) end + vim.api.nvim_create_autocmd('User', { pattern = 'MiniPickStop', once = true, callback = kill_process }) local data_feed = {} stdout:read_start(function(err, data) @@ -1809,6 +1830,9 @@ H.querytick = 0 -- General purpose cache H.cache = {} +-- File system information +H.is_windows = vim.loop.os_uname().sysname == 'Windows_NT' + -- Helper functionality ======================================================= -- Settings ------------------------------------------------------------------- H.setup_config = function(config) @@ -1883,14 +1907,15 @@ H.get_config = function(config) return vim.tbl_deep_extend('force', MiniPick.config, vim.b.minipick_config or {}, config or {}) end -H.create_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniPick', {}) +H.create_autocommands = function() + local gr = vim.api.nvim_create_augroup('MiniPick', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au('VimResized', '*', MiniPick.refresh, 'Refresh on resize') + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end --stylua: ignore @@ -1903,6 +1928,7 @@ H.create_default_hl = function() hi('MiniPickBorder', { link = 'FloatBorder' }) hi('MiniPickBorderBusy', { link = 'DiagnosticFloatingWarn' }) hi('MiniPickBorderText', { link = 'FloatTitle' }) + hi('MiniPickCursor', { blend = 100, nocombine = true }) hi('MiniPickIconDirectory', { link = 'Directory' }) hi('MiniPickIconFile', { link = 'MiniPickNormal' }) hi('MiniPickHeader', { link = 'DiagnosticFloatingHint' }) @@ -2126,17 +2152,17 @@ H.picker_new_buf = function() end H.picker_new_win = function(buf_id, win_config) - -- Focus cursor on Command line to not see it - if vim.fn.mode() == 'n' then - H.cache.cmdheight = vim.o.cmdheight - vim.o.cmdheight = 1 - vim.cmd('noautocmd normal! :') - end + -- Hide cursor while picker is active (to not be visible in the window) + -- This mostly follows a hack from 'folke/noice.nvim' + H.cache.guicursor = vim.o.guicursor + vim.o.guicursor = 'a:MiniPickCursor' + -- Create window and focus on it local win_id = vim.api.nvim_open_win(buf_id, true, H.picker_compute_win_config(win_config, true)) -- Set window-local data vim.wo[win_id].foldenable = false + vim.wo[win_id].foldmethod = 'manual' vim.wo[win_id].list = true vim.wo[win_id].listchars = 'extends:…' vim.wo[win_id].scrolloff = 0 @@ -2438,7 +2464,10 @@ end H.picker_stop = function(picker, abort) vim.tbl_map(function(timer) pcall(vim.loop.timer_stop, timer) end, H.timers) - pcall(function() vim.o.cmdheight = H.cache.cmdheight end) + + -- Show cursor (work around `guicursor=''` actually leaving cursor hidden) + if H.cache.guicursor == '' then vim.cmd('set guicursor=a: | redraw') end + pcall(function() vim.o.guicursor = H.cache.guicursor end) if picker == nil then return end @@ -2759,7 +2788,7 @@ H.match_filter = function(inds, stritems, query) query = grouped_parts end - if #query == 0 then return {}, 'nosort', query end + if #query == 0 then return {}, 'useall', query end local is_fuzzy_plain = not (is_exact_plain or is_exact_start or is_exact_end) and #query > 1 if is_fuzzy_forced or is_fuzzy_plain then return H.match_filter_fuzzy(inds, stritems, query), 'fuzzy', query end @@ -2927,6 +2956,10 @@ H.match_sort = function(match_data) return res end +H.match_no_sort = function(match_data) + return vim.tbl_map(function(x) return x[3] end, match_data) +end + -- Default show --------------------------------------------------------------- H.get_icon = function(x, icons) local item_data = H.parse_item(x) @@ -3031,14 +3064,15 @@ H.get_fs_type = function(path) if path == '' then return 'none' end if vim.fn.filereadable(path) == 1 then return 'file' end if vim.fn.isdirectory(path) == 1 then return 'directory' end - if pcall(vim.uri_to_fname, path) then return 'uri' end + if H.parse_uri(path) ~= nil then return 'uri' end return 'none' end -- Default preview ------------------------------------------------------------ H.preview_file = function(buf_id, item_data, opts) - -- Fully preview only text files - if not H.is_file_text(item_data.path) then return H.set_buflines(buf_id, { '-Non-text-file-' }) end + -- Fully preview only accessible text files + local is_text = H.is_file_text(item_data.path) + if not is_text then return H.set_buflines(buf_id, { is_text == nil and '-No-access-' or '-Non-text-file-' }) end -- Compute lines. Limit number of read lines to work better on large files. local has_lines, lines = pcall(vim.fn.readfile, item_data.path, '', (item_data.lnum or 1) + opts.n_context_lines) @@ -3131,9 +3165,7 @@ end H.choose_path = function(win_target, item_data) -- Try to use already created buffer, if present. This avoids not needed -- `:edit` call and avoids some problems with auto-root from 'mini.misc'. - local path, path_buf_id = item_data.path, nil - local is_uri, uri_path = pcall(vim.uri_to_fname, path) - path = is_uri and uri_path or path + local path, path_buf_id = H.parse_uri(item_data.path) or item_data.path, nil for _, buf_id in ipairs(vim.api.nvim_list_bufs()) do local is_target = H.is_valid_buf(buf_id) and vim.bo[buf_id].buflisted and vim.api.nvim_buf_get_name(buf_id) == path if is_target then path_buf_id = buf_id end @@ -3284,6 +3316,8 @@ end -- Utilities ------------------------------------------------------------------ H.error = function(msg) error(string.format('(mini.pick) %s', msg), 0) end +H.notify = function(msg, level_name) vim.notify('(mini.pick) ' .. msg, vim.log.levels[level_name]) end + H.is_valid_buf = function(buf_id) return type(buf_id) == 'number' and vim.api.nvim_buf_is_valid(buf_id) end H.is_valid_win = function(win_id) return type(win_id) == 'number' and vim.api.nvim_win_is_valid(win_id) end @@ -3414,12 +3448,24 @@ end H.is_file_text = function(path) local fd = vim.loop.fs_open(path, 'r', 1) + if fd == nil then return nil end local is_text = vim.loop.fs_read(fd, 1024):find('\0') == nil vim.loop.fs_close(fd) return is_text end H.full_path = function(path) return (vim.fn.fnamemodify(path, ':p'):gsub('(.)/$', '%1')) end +if H.is_windows then + H.full_path = function(path) return (vim.fn.fnamemodify(path, ':p'):gsub('(.)[\\/]$', '%1')) end +end + +H.parse_uri = function(x) + local ok, path = pcall(vim.uri_to_fname, x) + if not ok then return nil end + -- Don't accept Windows paths with volume letter as URI + if H.is_windows and x:find('^%a:') ~= nil and path:find('^%a:') ~= nil then return nil end + return path +end -- TODO: Remove after compatibility with Neovim=0.9 is dropped H.islist = vim.fn.has('nvim-0.10') == 1 and vim.islist or vim.tbl_islist diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/sessions.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/sessions.lua index 5f7338e2..2e3bfd0c 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/sessions.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/sessions.lua @@ -185,7 +185,7 @@ MiniSessions.read = function(session_name, opts) end -- Write current session to allow proper switching between sessions - if vim.v.this_session ~= '' then MiniSessions.write(nil, { force = true, verbose = false }) end + if H.get_this_session() ~= '' then MiniSessions.write(nil, { force = true, verbose = false }) end -- Execute 'pre' hook H.possibly_execute(opts.hooks.pre, data) @@ -248,13 +248,16 @@ MiniSessions.write = function(session_name, opts) H.possibly_execute(opts.hooks.pre, data) -- Make session file - local cmd = ('mksession%s'):format(opts.force and '!' or '') - vim.cmd(('%s %s'):format(cmd, vim.fn.fnameescape(session_path))) + local command = string.format('mksession%s %s', opts.force and '!' or '', vim.fn.fnameescape(session_path)) + vim.cmd(command) data.modify_time = vim.fn.getftime(session_path) -- Update detected sessions MiniSessions.detected[data.name] = data + -- Update current session + vim.v.this_session = session_path + -- Possibly notify if opts.verbose then H.message(('Written session %s'):format(session_path)) end @@ -299,7 +302,7 @@ MiniSessions.delete = function(session_name, opts) if not H.validate_detected(session_name) then return end session_path = MiniSessions.detected[session_name].path - local is_current_session = session_path == vim.v.this_session + local is_current_session = session_path == H.get_this_session() if not opts.force and is_current_session then H.error([[Can't delete current session when `opts.force` is not `true`.]]) end @@ -441,24 +444,22 @@ H.apply_config = function(config) end H.create_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniSessions', {}) + local gr = vim.api.nvim_create_augroup('MiniSessions', {}) if config.autoread then local autoread = function() if not H.is_something_shown() then MiniSessions.read() end end - local opts = { group = augroup, nested = true, once = true, callback = autoread, desc = 'Autoread latest session' } + local opts = { group = gr, nested = true, once = true, callback = autoread, desc = 'Autoread latest session' } vim.api.nvim_create_autocmd('VimEnter', opts) end if config.autowrite then local autowrite = function() - if vim.v.this_session ~= '' then MiniSessions.write(nil, { force = true }) end + if H.get_this_session() ~= '' then MiniSessions.write(nil, { force = true }) end end - vim.api.nvim_create_autocmd( - 'VimLeavePre', - { group = augroup, callback = autowrite, desc = 'Autowrite current session' } - ) + local opts = { group = gr, callback = autowrite, desc = 'Autowrite current session' } + vim.api.nvim_create_autocmd('VimLeavePre', opts) end end @@ -506,14 +507,11 @@ H.detect_sessions_global = function(global_dir) end H.detect_sessions_local = function(local_file) - local f = H.join_path(vim.fn.getcwd(), local_file) - + local f = vim.fn.getcwd() .. '/' .. local_file if not H.is_readable_file(f) then return {} end - local res = {} local s = H.new_session(f, 'local') - res[s.name] = s - return res + return { [s.name] = s } end H.new_session = function(session_path, session_type) @@ -547,20 +545,20 @@ H.get_unsaved_listed_buffers = function() ) end -H.get_current_session_name = function() return vim.fn.fnamemodify(vim.v.this_session, ':t') end +H.get_this_session = function() return H.fs_normalize(vim.v.this_session) end H.name_to_path = function(session_name) if session_name == nil then - if vim.v.this_session == '' then H.error('There is no active session. Supply non-nil session name.') end - return vim.v.this_session + local this_session = H.get_this_session() + if this_session == '' then H.error('There is no active session. Supply non-nil session name.') end + return this_session end session_name = tostring(session_name) if session_name == '' then H.error('Supply non-empty session name.') end local session_dir = (session_name == MiniSessions.config.file) and vim.fn.getcwd() or MiniSessions.config.directory - local path = H.join_path(session_dir, session_name) - return H.full_path(path) + return H.full_path(session_dir .. '/' .. session_name) end -- Utilities ------------------------------------------------------------------ @@ -599,11 +597,12 @@ end H.is_readable_file = function(path) return vim.fn.isdirectory(path) ~= 1 and vim.fn.getfperm(path):sub(1, 1) == 'r' end -H.join_path = function(directory, filename) - return (string.format('%s/%s', directory, filename):gsub('\\', '/'):gsub('/+', '/')) +H.fs_normalize = vim.fs.normalize +if vim.fn.has('nvim-0.9') == 0 then + H.fs_normalize = function(...) return vim.fs.normalize(...):gsub('(.)/+$', '%1') end end -H.full_path = function(path) return vim.fn.resolve(vim.fn.fnamemodify(path, ':p')) end +H.full_path = function(path) return H.fs_normalize(vim.fn.resolve(vim.fn.fnamemodify(path, ':p'))) end H.is_something_shown = function() -- Don't autoread session if Neovim is opened to show something. That is diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/starter.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/starter.lua index cd2c07ed..64939dc2 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/starter.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/starter.lua @@ -385,9 +385,9 @@ MiniStarter.refresh = function(buf_id) if not vim.deep_equal(data.items, old_items) then data.current_item_id = 1 end -- Add content - vim.api.nvim_buf_set_option(buf_id, 'modifiable', true) + vim.bo[buf_id].modifiable = true vim.api.nvim_buf_set_lines(buf_id, 0, -1, false, MiniStarter.content_to_lines(content)) - vim.api.nvim_buf_set_option(buf_id, 'modifiable', false) + vim.bo[buf_id].modifiable = false -- Add highlighting H.content_highlight(buf_id) @@ -1053,7 +1053,7 @@ end H.apply_config = function(config) MiniStarter.config = config end H.create_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniStarter', {}) + local gr = vim.api.nvim_create_augroup('MiniStarter', {}) if config.autoopen then local on_vimenter = function() @@ -1065,11 +1065,11 @@ H.create_autocommands = function(config) vim.cmd('noautocmd lua MiniStarter.open()') end - vim.api.nvim_create_autocmd( - 'VimEnter', - { group = augroup, nested = true, once = true, callback = on_vimenter, desc = 'Open on VimEnter' } - ) + local au_opts = { group = gr, nested = true, once = true, callback = on_vimenter, desc = 'Open on VimEnter' } + vim.api.nvim_create_autocmd('VimEnter', au_opts) end + + vim.api.nvim_create_autocmd('ColorScheme', { group = gr, callback = H.create_default_hl, desc = 'Ensure colors' }) end --stylua: ignore diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/statusline.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/statusline.lua index 85107008..1556aab0 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/statusline.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/statusline.lua @@ -168,9 +168,7 @@ MiniStatusline.config = { -- Whether to use icons by default use_icons = true, - -- Whether to set Vim's settings for statusline (make it always shown with - -- 'laststatus' set to 2). - -- To use global statusline, set this to `false` and 'laststatus' to 3. + -- Whether to set Vim's settings for statusline (make it always shown) set_vim_settings = true, } --minidoc_afterlines_end @@ -510,7 +508,7 @@ H.apply_config = function(config) MiniStatusline.config = config -- Set settings to ensure statusline is displayed properly - if config.set_vim_settings then vim.o.laststatus = 2 end + if config.set_vim_settings and (vim.o.laststatus == 0 or vim.o.laststatus == 1) then vim.o.laststatus = 2 end -- Ensure proper 'statusline' values (to not rely on autocommands trigger) H.ensure_content() @@ -521,10 +519,10 @@ H.apply_config = function(config) end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniStatusline', {}) + local gr = vim.api.nvim_create_augroup('MiniStatusline', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end au({ 'WinEnter', 'BufWinEnter' }, '*', H.ensure_content, 'Ensure statusline content') @@ -535,6 +533,8 @@ H.create_autocommands = function() vim.cmd('redrawstatus') end) au({ 'LspAttach', 'LspDetach' }, '*', track_lsp, 'Track LSP clients') + + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end --stylua: ignore diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/surround.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/surround.lua index a006148d..a0a08db2 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/surround.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/surround.lua @@ -487,6 +487,9 @@ MiniSurround.setup = function(config) -- Apply config H.apply_config(config) + -- Define behavior + H.create_autocommands() + -- Create default highlighting H.create_default_hl() end @@ -1221,6 +1224,11 @@ H.apply_config = function(config) --stylua: ignore end end +H.create_autocommands = function() + local gr = vim.api.nvim_create_augroup('MiniSurround', {}) + vim.api.nvim_create_autocmd('ColorScheme', { group = gr, callback = H.create_default_hl, desc = 'Ensure colors' }) +end + H.create_default_hl = function() vim.api.nvim_set_hl(0, 'MiniSurround', { default = true, link = 'IncSearch' }) end H.is_disabled = function() return vim.g.minisurround_disable == true or vim.b.minisurround_disable == true end @@ -1309,20 +1317,20 @@ end H.make_surrounding_table = function() -- Extend builtins with data from `config` - local surroundings = vim.tbl_deep_extend('force', H.builtin_surroundings, H.get_config().custom_surroundings or {}) - - -- Add possibly missing information from default surrounding info - for char, info in pairs(surroundings) do + local surroundings = vim.deepcopy(H.builtin_surroundings) + for char, spec in pairs(H.get_config().custom_surroundings or {}) do + local cur_spec = surroundings[char] or {} local default = H.get_default_surrounding_info(char) - surroundings[char] = vim.tbl_deep_extend('force', default, info) + -- NOTE: Don't use `tbl_deep_extend` to prefer full `input` arrays + cur_spec.input = spec.input or cur_spec.input or default.input + cur_spec.output = spec.output or cur_spec.output or default.output + surroundings[char] = cur_spec end -- Use default surrounding info for not supplied single character identifier - --stylua: ignore start return setmetatable(surroundings, { __index = function(_, key) return H.get_default_surrounding_info(key) end, }) - --stylua: ignore end end H.get_default_surrounding_info = function(char) @@ -1373,7 +1381,7 @@ end -- Work with finding surrounding ---------------------------------------------- ---@param surr_spec table Composed pattern. Last item(s) - extraction template. ----@param opts table Options. +---@param opts table|nil Options. ---@private H.find_surrounding = function(surr_spec, opts) if surr_spec == nil then return end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/tabline.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/tabline.lua index d9c6228c..5835e8a3 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/tabline.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/tabline.lua @@ -89,6 +89,12 @@ MiniTabline.setup = function(config) -- Apply config H.apply_config(config) + -- Define behavior + H.create_autocommands() + + -- Create default highlighting + H.create_default_hl() + -- Function to make tabs clickable vim.api.nvim_exec( [[function! MiniTablineSwitchBuffer(buf_id, clicks, button, mod) @@ -96,9 +102,6 @@ MiniTabline.setup = function(config) endfunction]], false ) - - -- Create default highlighting - H.create_default_hl() end --- Module config @@ -219,6 +222,11 @@ H.apply_config = function(config) vim.o.tabline = '%!v:lua.MiniTabline.make_tabline_string()' end +H.create_autocommands = function() + local gr = vim.api.nvim_create_augroup('MiniTabline', {}) + vim.api.nvim_create_autocmd('ColorScheme', { group = gr, callback = H.create_default_hl, desc = 'Ensure colors' }) +end + --stylua: ignore H.create_default_hl = function() local set_default_hl = function(name, data) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/test.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/test.lua index cd9b1c15..a1851de5 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/test.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/test.lua @@ -32,6 +32,8 @@ --- --- - Customizable project specific testing script. --- +--- - Works on Unix (Linux, MacOS, etc.) and Windows. +--- --- What it doesn't support: --- - Parallel execution. Due to idea of limiting implementation complexity. --- @@ -1089,6 +1091,12 @@ MiniTest.new_child_neovim = function() -- Make unique name for `--listen` pipe local job = { address = vim.fn.tempname() } + if vim.fn.has('win32') == 1 then + -- Use special local pipe prefix on Windows with (hopefully) unique name + -- Source: https://learn.microsoft.com/en-us/windows/win32/ipc/pipe-names + job.address = [[\\.\pipe\mininvim]] .. vim.fn.fnamemodify(job.address, ':t') + end + --stylua: ignore local full_args = { opts.nvim_executable, '--clean', '-n', '--listen', job.address, @@ -1625,11 +1633,8 @@ end H.apply_config = function(config) MiniTest.config = config end H.create_autocommands = function() - local augroup = vim.api.nvim_create_augroup('MiniTest', {}) - vim.api.nvim_create_autocmd( - 'ColorScheme', - { group = augroup, callback = H.create_default_hl, desc = 'Ensure proper colors' } - ) + local gr = vim.api.nvim_create_augroup('MiniTest', {}) + vim.api.nvim_create_autocmd('ColorScheme', { group = gr, callback = H.create_default_hl, desc = 'Ensure colors' }) end H.create_default_hl = function() diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/trailspace.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/trailspace.lua index d5d32f4f..5bf05a1b 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/trailspace.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/trailspace.lua @@ -147,10 +147,10 @@ end H.apply_config = function(config) MiniTrailspace.config = config end H.create_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniTrailspace', {}) + local gr = vim.api.nvim_create_augroup('MiniTrailspace', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end -- NOTE: Respecting both `WinEnter` and `BufEnter` seems to be useful to @@ -165,6 +165,8 @@ H.create_autocommands = function(config) -- disappears if buffer is reentered. au('OptionSet', 'buftype', H.track_normal_buffer, 'Track normal buffer') end + + au('ColorScheme', '*', H.create_default_hl, 'Ensure colors') end H.create_default_hl = function() vim.api.nvim_set_hl(0, 'MiniTrailspace', { default = true, link = 'Error' }) end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/visits.lua b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/visits.lua index 9851f983..a33e2d18 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/visits.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/lua/mini/visits.lua @@ -1191,6 +1191,9 @@ H.cache = { session_start_time = os.time(), } +-- File system information +H.is_windows = vim.loop.os_uname().sysname == 'Windows_NT' + -- Helper functionality ======================================================= -- Settings ------------------------------------------------------------------- H.setup_config = function(config) @@ -1224,10 +1227,10 @@ end H.apply_config = function(config) MiniVisits.config = config end H.create_autocommands = function(config) - local augroup = vim.api.nvim_create_augroup('MiniVisits', {}) + local gr = vim.api.nvim_create_augroup('MiniVisits', {}) local au = function(event, pattern, callback, desc) - vim.api.nvim_create_autocmd(event, { group = augroup, pattern = pattern, callback = callback, desc = desc }) + vim.api.nvim_create_autocmd(event, { group = gr, pattern = pattern, callback = callback, desc = desc }) end if config.track.event ~= '' then au(config.track.event, '*', H.autoregister_visit, 'Auto register visit') end @@ -1500,9 +1503,9 @@ H.error = function(msg) error(string.format('(mini.visits) %s', msg), 0) end H.is_valid_buf = function(buf_id) return type(buf_id) == 'number' and vim.api.nvim_buf_is_valid(buf_id) end H.buf_get_path = function(buf_id) - -- Get Path only for valid normal buffers + -- Get path only for valid normal buffers if not H.is_valid_buf(buf_id) or vim.bo[buf_id].buftype ~= '' then return nil end - local res = vim.api.nvim_buf_get_name(buf_id) + local res = H.full_path(vim.api.nvim_buf_get_name(buf_id)) if res == '' then return end return res end @@ -1549,12 +1552,20 @@ H.edit_path = function(path) end end -H.full_path = function(path) return (vim.fn.fnamemodify(path, ':p'):gsub('\\', '/'):gsub('/+', '/'):gsub('(.)/$', '%1')) end +H.full_path = function(path) return (vim.fn.fnamemodify(path, ':p'):gsub('/+', '/'):gsub('(.)/$', '%1')) end +if H.is_windows then + H.full_path = function(path) + return (vim.fn.fnamemodify(path, ':p'):gsub('\\', '/'):gsub('/+', '/'):gsub('(.)/$', '%1')) + end +end H.short_path = function(path, cwd) cwd = cwd or vim.fn.getcwd() - if not vim.startswith(path, cwd) then return vim.fn.fnamemodify(path, ':~') end - local res = path:sub(cwd:len() + 1):gsub('^/+', ''):gsub('/+$', '') + -- Ensure `cwd` is treated as directory path (to not match similar prefix) + cwd = cwd:sub(-1) == '/' and cwd or (cwd .. '/') + if vim.startswith(path, cwd) then return path:sub(cwd:len() + 1) end + local res = vim.fn.fnamemodify(path, ':~') + if H.is_windows then res = res:gsub('\\', '/') end return res end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-base16.md b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-base16.md index 9f7c8f87..7e66564e 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-base16.md +++ b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-base16.md @@ -56,6 +56,7 @@ Supported highlight groups: - [HiPhish/rainbow-delimiters.nvim](https://github.com/HiPhish/rainbow-delimiters.nvim) - [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp) - [justinmk/vim-sneak](https://github.com/justinmk/vim-sneak) + - [kevinhwang91/nvim-bqf](https://github.com/kevinhwang91/nvim-bqf) - [kevinhwang91/nvim-ufo](https://github.com/kevinhwang91/nvim-ufo) - [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) - [lukas-reineke/indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-completion.md b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-completion.md index b196d08b..a80df17f 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-completion.md +++ b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-completion.md @@ -35,6 +35,13 @@ https://user-images.githubusercontent.com/24854248/173044355-90bfc230-70c4-4932- - Automatic display in floating window of completion item info (via 'completionItem/resolve' request) and signature help (with highlighting of active parameter if LSP server provides such information). - Automatic actions are done after some configurable amount of delay. This reduces computational load and allows fast typing (completion and signature help) and item selection (item info) - User can force two-stage completion via or fallback completion. +- Highlighting of LSP kind (like "Function", "Keyword", etc.). Requires enabled ['mini.icons'](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-icons.md) (uses its "lsp" category) and Neovim>=0.11. + +## Dependencies + +For full experience needs (still works without any of suggestions): + +- Enabled ['mini.icons'](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-icons.md) module to highlight LSP kind (requires Neovim>=0.11). Otherwise `MiniCompletion.default_process_items()` does not add highlighting. Also take a look at `MiniIcons.tweak_lsp_kind()`. ## Installation @@ -163,12 +170,10 @@ Here are code snippets for some common installation methods (use only one): -- on every `BufEnter` event. auto_setup = true, - -- `process_items` should be a function which takes LSP - -- 'textDocument/completion' response items and word to complete. Its - -- output should be a table of the same nature as input items. The most - -- common use-cases are custom filtering and sorting. You can use - -- default `process_items` as `MiniCompletion.default_process_items()`. - process_items = --, + -- A function which takes LSP 'textDocument/completion' response items + -- and word to complete. Output should be a table of the same nature as + -- input items. Common use case is custom filter/sort. + process_items = --, }, -- Fallback action. It will always be run in Insert mode. To use Neovim's diff --git a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-files.md b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-files.md index c687e144..fdd2beaa 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-files.md +++ b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-files.md @@ -38,6 +38,7 @@ https://github.com/echasnovski/mini.nvim/assets/24854248/530483a5-fe9a-4e18-9813 - Filter/prefix/sort of file system entries. - Mappings used for common explorer actions. - UI options: whether to show preview of file/directory under cursor, etc. + - Bookmarks for quicker navigation. See `*MiniFiles-examples*` tag in help file for some common configuration examples. @@ -67,7 +68,8 @@ For full experience needs (still works without any of suggestions): - Press `j`/`k` to navigate down/up. - Press `l` to expand entry under cursor: show directory or open file in the most recent window. - Press `h` to go to parent directory. - - Type `g?` for more information about other available mappings. + - Type `m` to set directory path of focused window as bookmark ``. Jump to it with `'`. Go back to before the latest jump with `''`. + - Type `g?` for more information about other available mappings and bookmarks. - Move as in any other buffer (`$`, `G`, `f`/`t`, etc.). For bigger overview, see `*MiniFiles-navigation*` tag in help file. @@ -210,6 +212,8 @@ Here are code snippets for some common installation methods (use only one): go_in_plus = 'L', go_out = 'h', go_out_plus = 'H', + mark_goto = "'", + mark_set = 'm', reset = '', reveal_cwd = '@', show_help = 'g?', diff --git a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-hues.md b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-hues.md index aa3322e6..35227dff 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-hues.md +++ b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-hues.md @@ -103,6 +103,7 @@ Supported highlight groups: - [HiPhish/rainbow-delimiters.nvim](https://github.com/HiPhish/rainbow-delimiters.nvim) - [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp) - [justinmk/vim-sneak](https://github.com/justinmk/vim-sneak) + - [kevinhwang91/nvim-bqf](https://github.com/kevinhwang91/nvim-bqf) - [kevinhwang91/nvim-ufo](https://github.com/kevinhwang91/nvim-ufo) - [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) - [lukas-reineke/indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-statusline.md b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-statusline.md index 1867d78f..74a85420 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-statusline.md +++ b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-statusline.md @@ -157,9 +157,7 @@ Here are code snippets for some common installation methods (use only one): -- Whether to use icons by default use_icons = true, - -- Whether to set Vim's settings for statusline (make it always shown with - -- 'laststatus' set to 2). - -- To use global statusline, set this to `false` and 'laststatus' to 3. + -- Whether to set Vim's settings for statusline (make it always shown) set_vim_settings = true, } ``` diff --git a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-test.md b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-test.md index 2430b5e8..3c77b776 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-test.md +++ b/config/neovim/store/lazy-plugins/mini.nvim/readmes/mini-test.md @@ -40,6 +40,7 @@ https://user-images.githubusercontent.com/24854248/175773105-f33cd3bb-6f62-4a61- - `MiniTest.gen_reporter.buffer()` for interactive usage. - `MiniTest.gen_reporter.stdout()` for headless Neovim. - Customizable project specific testing script. +- Works on Unix (Linux, MacOS, etc.) and Windows. ## Installation diff --git a/config/neovim/store/lazy-plugins/mini.nvim/scripts/basic-setup_init.lua b/config/neovim/store/lazy-plugins/mini.nvim/scripts/basic-setup_init.lua deleted file mode 100644 index b806ac49..00000000 --- a/config/neovim/store/lazy-plugins/mini.nvim/scripts/basic-setup_init.lua +++ /dev/null @@ -1,67 +0,0 @@ --- Test possibility of checking out and initializing 'mini.nvim' --- Possible problems: --- - Long file names (particularly from reference screenshots). --- - Duplicating file names in case-insensitive OS (particularly from reference --- screenshots of parametrized test cases). - --- Add project root as full path to runtime path (in order to be able to --- `require()`) modules from this module -vim.cmd([[let &rtp.=','.getcwd()]]) - ---stylua: ignore -local test_actions = { - ['ai'] = function() require('mini.ai').setup() end, - ['align'] = function() require('mini.align').setup() end, - ['animate'] = function() require('mini.animate').setup() end, - ['base16'] = function() - local palette = require('mini.base16').mini_palette('#000000', '#ffffff', 50) - require('mini.base16').setup({ palette = palette }) - end, - ['basics'] = function() require('mini.basics').setup() end, - ['bracketed'] = function() require('mini.bracketed').setup() end, - ['bufremove'] = function() require('mini.bufremove').setup() end, - ['clue'] = function() require('mini.clue').setup() end, - ['colors'] = function() require('mini.colors').setup() end, - ['comment'] = function() require('mini.comment').setup() end, - ['completion'] = function() require('mini.completion').setup() end, - ['cursorword'] = function() require('mini.cursorword').setup() end, - ['deps'] = function() require('mini.deps').setup() end, - ['diff'] = function() require('mini.diff').setup() end, - ['doc'] = function() require('mini.doc').setup() end, - ['extra'] = function() require('mini.extra').setup() end, - ['files'] = function() require('mini.files').setup() end, - ['fuzzy'] = function() require('mini.fuzzy').setup() end, - ['git'] = function() require('mini.git').setup() end, - ['hipatterns'] = function() require('mini.hipatterns').setup() end, - ['hues'] = function() require('mini.hues').setup({ background = '#000000', foreground = '#ffffff' }) end, - ['icons'] = function() require('mini.icons').setup() end, - ['indentscope'] = function() require('mini.indentscope').setup() end, - ['jump'] = function() require('mini.jump').setup() end, - ['jump2d'] = function() require('mini.jump2d').setup() end, - ['map'] = function() require('mini.map').setup() end, - ['misc'] = function() require('mini.misc').setup() end, - ['move'] = function() require('mini.move').setup() end, - ['notify'] = function() require('mini.notify').setup() end, - ['operators'] = function() require('mini.operators').setup() end, - ['pairs'] = function() require('mini.pairs').setup() end, - ['pick'] = function() require('mini.pick').setup() end, - ['sessions'] = function() require('mini.sessions').setup({ directory = '' }) end, - ['splitjoin'] = function() require('mini.splitjoin').setup() end, - ['starter'] = function() require('mini.starter').setup() end, - ['statusline'] = function() require('mini.statusline').setup() end, - ['surround'] = function() require('mini.surround').setup() end, - ['tabline'] = function() require('mini.tabline').setup() end, - ['test'] = function() require('mini.test').setup() end, - ['trailspace'] = function() require('mini.trailspace').setup() end, - ['visits'] = function() require('mini.visits').setup() end, -} - -for module, test_fun in pairs(test_actions) do - local ok, _ = pcall(test_fun) - if not ok then - io.stdout:write('There is a problem with following module: mini.' .. module .. '\n') - vim.cmd('cquit') - end -end - -vim.cmd('qall!') diff --git a/config/neovim/store/lazy-plugins/mini.nvim/scripts/lintcommit-ci.sh b/config/neovim/store/lazy-plugins/mini.nvim/scripts/lintcommit-ci.sh index ee0bb153..f3674418 100755 --- a/config/neovim/store/lazy-plugins/mini.nvim/scripts/lintcommit-ci.sh +++ b/config/neovim/store/lazy-plugins/mini.nvim/scripts/lintcommit-ci.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash msg_file_dir='lintcommit-msg-files/' mkdir -p $msg_file_dir diff --git a/config/neovim/store/lazy-plugins/mini.nvim/scripts/minimal_init.lua b/config/neovim/store/lazy-plugins/mini.nvim/scripts/minimal_init.lua index 1110b29a..30577f41 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/scripts/minimal_init.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/scripts/minimal_init.lua @@ -5,3 +5,9 @@ vim.cmd([[let &rtp.=','.getcwd()]]) -- Ensure persistent color scheme (matters after new default in Neovim 0.10) vim.o.background = 'dark' require('mini.hues').setup({ background = '#11262d', foreground = '#c0c8cc' }) + +-- - Make screenshot tests more robust across Neovim versions +if vim.fn.has('nvim-0.11') == 1 then + vim.api.nvim_set_hl(0, 'PmenuMatch', { link = 'Pmenu' }) + vim.api.nvim_set_hl(0, 'PmenuMatchSel', { link = 'PmenuSel' }) +end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-completion/mock-months-lsp.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-completion/mock-months-lsp.lua index d83f5ae5..d65d0ffb 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-completion/mock-months-lsp.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-completion/mock-months-lsp.lua @@ -2,7 +2,7 @@ _G.Months = {} --stylua: ignore start Months.items = { - { name = 'January', kind = 1}, + { name = 'January', kind = 1 }, { name = 'February', kind = 1 }, { name = 'March', kind = 2 }, { name = 'April', kind = 2 }, diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-extra/mocks/lsp.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-extra/mocks/lsp.lua index bc964277..8b2f37b6 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-extra/mocks/lsp.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-extra/mocks/lsp.lua @@ -32,13 +32,14 @@ end vim.lsp.buf.document_symbol = function(opts) table.insert(_G.lsp_buf_calls, 'document_symbol') + local symbol_kind = vim.lsp.protocol.SymbolKind local data = { context = make_context('textDocument/documentSymbol'), items = { - { col = 7, filename = filename, kind = 'Number', lnum = 1, text = '[Number] a' }, - { col = 7, filename = filename, kind = 'Object', lnum = 2, text = '[Object] t' }, - { col = 3, filename = filename, kind = 'Variable', lnum = 3, text = '[Variable] x' }, - { col = 3, filename = filename, kind = 'Variable', lnum = 4, text = '[Variable] y' }, + { col = 7, filename = filename, kind = symbol_kind[16], lnum = 1, text = '[' .. symbol_kind[16] .. '] a' }, + { col = 7, filename = filename, kind = symbol_kind[19], lnum = 2, text = '[' .. symbol_kind[19] .. '] t' }, + { col = 3, filename = filename, kind = symbol_kind[13], lnum = 3, text = '[' .. symbol_kind[13] .. '] x' }, + { col = 3, filename = filename, kind = symbol_kind[13], lnum = 4, text = '[' .. symbol_kind[13] .. '] y' }, }, title = 'Symbols in a.lua', } @@ -82,13 +83,14 @@ end vim.lsp.buf.workspace_symbol = function(query, opts) table.insert(_G.lsp_buf_calls, 'workspace_symbol') _G.workspace_symbol_query = query + local symbol_kind = vim.lsp.protocol.SymbolKind local data = { context = make_context('textDocument/workspaceSymbol'), items = { - { col = 7, filename = filename, kind = 'Number', lnum = 1, text = '[Number] a' }, - { col = 7, filename = filename, kind = 'Object', lnum = 2, text = '[Object] t' }, - { col = 3, filename = filename, kind = 'Variable', lnum = 3, text = '[Variable] x' }, - { col = 3, filename = filename, kind = 'Variable', lnum = 4, text = '[Variable] y' }, + { col = 7, filename = filename, kind = symbol_kind[16], lnum = 1, text = '[' .. symbol_kind[16] .. '] a' }, + { col = 7, filename = filename, kind = symbol_kind[19], lnum = 2, text = '[' .. symbol_kind[19] .. '] t' }, + { col = 3, filename = filename, kind = symbol_kind[13], lnum = 3, text = '[' .. symbol_kind[13] .. '] x' }, + { col = 3, filename = filename, kind = symbol_kind[13], lnum = 4, text = '[' .. symbol_kind[13] .. '] y' }, }, title = "Symbols matching ''", } diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-extra/mocks/spawn.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-extra/mocks/spawn.lua index dfd41b41..64bf4d22 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-extra/mocks/spawn.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-extra/mocks/spawn.lua @@ -1,10 +1,15 @@ _G.process_log = {} -local n_pid, n_stream = 0, 0 +local n_pid = 0 local new_process = function(pid) return { + _is_active_indicator = true, pid = pid, - close = function(_) table.insert(_G.process_log, 'Process ' .. pid .. ' was closed.') end, + is_active = function(process) return process._is_active_indicator end, + close = function(process) + process._is_active_indicator = false + table.insert(_G.process_log, 'Process ' .. pid .. ' was closed.') + end, } end @@ -52,4 +57,7 @@ vim.loop.spawn = function(path, options, on_exit) return new_process(pid), pid end -vim.loop.process_kill = function(process) table.insert(_G.process_log, 'Process ' .. process.pid .. ' was killed.') end +vim.loop.process_kill = function(process) + process._is_active_indicator = false + table.insert(_G.process_log, 'Process ' .. process.pid .. ' was killed.') +end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-files/real/top-secret b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-files/real/top-secret new file mode 100644 index 00000000..e69de29b diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-git/deps-confirm b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-git/deps-confirm new file mode 100644 index 00000000..9590e024 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-git/deps-confirm @@ -0,0 +1,38 @@ +This is a confirmation report before an update. + +Other very useful info + +!!! plugin_a !!! + +Some error + ++++ plugin_b +++ +Path: /home/user/.local/share/nvim/site/pack/deps/opt/plugin_b +Source: https://github.com/cool-plugins/plugin_b +State before: aa339f6ab611da07183a7fe44daa482605392502 +State after: 093b29f2b409278e2ed69a90462fee54714b5a84 (master) + +Pending updates from `master`: +> 093b29f2 | 2024-09-06 06:42:29 +0000 | Neo McVim + feat: very important feature + +> bfe74a48 | 2024-09-05 13:25:50 +0000 | Neo McVim + fix: very important fix + +< 3826d0c4 | 2024-09-04 09:08:06 +0200 | Neo McVim + chore: not very important chore + ++++ plugin_c +++ +Path: /home/user/.local/share/nvim/site/pack/deps/opt/plugin_c +Source: https://github.com/cool-plugins/plugin_c +State before: 3a3c6244553f13fdd92d312c82722b57ce6c4bec +State after: fe3deb7f67ce0cc4ebfe2ea6c1c7ae1c7a939d73 (main) + +Pending updates from `main`: +> fe3deb7 | 2024-09-04 03:40:17 -0500 | Caleb White + fix: even more important fix + +--- plugin_d --- +Path: /home/user/.local/share/nvim/site/pack/deps/opt/plugin_d +Source: https://github.com/cool-plugins/plugin_d +State: d231729b13da28fd1625c3d85f2315886ddeb05d (HEAD) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-pick/mocks/spawn.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-pick/mocks/spawn.lua index 6086b166..2bb917fe 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-pick/mocks/spawn.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/dir-pick/mocks/spawn.lua @@ -3,8 +3,13 @@ _G.process_log = {} local n_pid, n_stdout = 0, 0 local new_process = function(pid) return { + _is_active_indicator = true, pid = pid, - close = function(_) table.insert(_G.process_log, 'Process ' .. pid .. ' was closed.') end, + is_active = function(process) return process._is_active_indicator end, + close = function(process) + process._is_active_indicator = false + table.insert(_G.process_log, 'Process ' .. pid .. ' was closed.') + end, } end @@ -47,4 +52,7 @@ vim.loop.spawn = function(path, options, on_exit) return new_process(pid), pid end -vim.loop.process_kill = function(process) table.insert(_G.process_log, 'Process ' .. process.pid .. ' was killed.') end +vim.loop.process_kill = function(process) + process._is_active_indicator = false + table.insert(_G.process_log, 'Process ' .. process.pid .. ' was killed.') +end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/helpers.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/helpers.lua index f34a395e..13885b65 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/helpers.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/helpers.lua @@ -40,7 +40,6 @@ Helpers.new_child_neovim = function() local child = MiniTest.new_child_neovim() local prevent_hanging = function(method) - -- stylua: ignore if not child.is_blocked() then return end local msg = string.format('Can not use `child.%s` because child process is blocked.', method) @@ -157,6 +156,9 @@ Helpers.new_child_neovim = function() MiniTest.expect.reference_screenshot(child.get_screenshot(screenshot_opts), path, opts) end + -- Poke child's event loop to make it up to date + child.poke_eventloop = function() child.api.nvim_eval('1') end + return child end @@ -170,7 +172,41 @@ end -- Detect CI Helpers.is_ci = function() return os.getenv('CI') ~= nil end Helpers.skip_in_ci = function(msg) - if Helpers.is_ci() then MiniTest.skip(msg) end + if Helpers.is_ci() then MiniTest.skip(msg or 'Does not test properly in CI') end +end + +-- Detect OS +Helpers.is_windows = function() return vim.fn.has('win32') == 1 end +Helpers.skip_on_windows = function(msg) + if Helpers.is_windows() then MiniTest.skip(msg or 'Does not test properly on Windows') end +end + +Helpers.is_macos = function() return vim.fn.has('mac') == 1 end +Helpers.skip_on_macos = function(msg) + if Helpers.is_macos() then MiniTest.skip(msg or 'Does not test properly on MacOS') end +end + +-- Standardized way of dealing with time +Helpers.is_slow = function() return Helpers.is_ci() and (Helpers.is_windows() or Helpers.is_macos()) end +Helpers.skip_if_slow = function(msg) + if Helpers.is_slow() then MiniTest.skip(msg or 'Does not test properly in slow context') end +end + +Helpers.get_time_const = function(delay) + local coef = 1 + if Helpers.is_ci() then + if Helpers.is_windows() then coef = 5 end + if Helpers.is_macos() then coef = 15 end + end + return coef * delay +end + +Helpers.sleep = function(ms, child, skip_slow) + if skip_slow then + Helpers.skip_if_slow('Skip because state checks after sleep are hard to make robust in slow context') + end + vim.loop.sleep(math.max(ms, 1)) + if child ~= nil then child.poke_eventloop() end end return Helpers diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_completion.lua---Manual-completion---respects-`kind_hlgroup`-as-item-field b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_completion.lua---Manual-completion---respects-`kind_hlgroup`-as-item-field new file mode 100644 index 00000000..6531ef33 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_completion.lua---Manual-completion---respects-`kind_hlgroup`-as-item-field @@ -0,0 +1,23 @@ +--|---------|---------|---------|---------| +01|J +02|January Text +03|June Function +04|July Function +05|~ +06|~ +07|~ +08|~ +09|[No Name] [+] 1,2 All +10|-- INSERT -- + +--|---------|---------|---------|---------| +01|0000000000000000000000000000000000000000 +02|1111111122222222233333333333333333333333 +03|1111111144444444433333333333333333333333 +04|1111111111111111133333333333333333333333 +05|3333333333333333333333333333333333333333 +06|3333333333333333333333333333333333333333 +07|3333333333333333333333333333333333333333 +08|3333333333333333333333333333333333333333 +09|5555555555555555555555555555555555555555 +10|6666666666667777777777777777777777777777 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---clean()---works b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---clean()---works index 9025c205..96b93fb5 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---clean()---works +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---clean()---works @@ -1,33 +1,33 @@ --|---------|---------|---------|---------|---------|---------|---------|---------| -01| [No Name] m//confirm-clean X -02|This is a confirmation report before a clean. -03| -04|Lines `- ` show plugins to be deleted from disk. -05|Remove line to not delete that plugin. -06| -07|To finish clean, write this buffer (for example, with `:write` command). -08|To cancel clean, close this window (for example, with `:close` command). -09| -10|- plugin_not_in_session_1 -11|- plugin_not_in_session_2 +01|This is a confirmation report before a clean. +02| +03|Lines `- ` show plugins to be deleted from disk. +04|Remove line to not delete that plugin. +05| +06|To finish clean, write this buffer (for example, with `:write` command). +07|To cancel clean, close this window (for example, with `:close` command). +08| +09|- plugin_not_in_session_1 +10|- plugin_not_in_session_2 +11|~ 12|~ 13|~ 14|~ 15| --|---------|---------|---------|---------|---------|---------|---------|---------| -01|00000000000111111111111111111000000000000000000000000000000000000000000000000000 -02|22222222222222222222222222222222222222222222233333333333333333333333333333333333 -03|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -04|22222222222222222222222222222222222222222222222222222222333333333333333333333333 -05|22222222222222222222222222222222222222333333333333333333333333333333333333333333 -06|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -07|22222222222222222222222222222222222222222222222222222222222222222222222233333333 -08|22222222222222222222222222222222222222222222222222222222222222222222222233333333 -09|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -10|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -11|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -12|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -13|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -14|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -15|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +01|00000000000000000000000000000000000000000000011111111111111111111111111111111111 +02|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|00000000000000000000000000000000000000000000000000000000111111111111111111111111 +04|00000000000000000000000000000000000000111111111111111111111111111111111111111111 +05|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +06|00000000000000000000000000000000000000000000000000000000000000000000000011111111 +07|00000000000000000000000000000000000000000000000000000000000000000000000011111111 +08|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +09|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +10|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +11|22222222222222222222222222222222222222222222222222222222222222222222222222222222 +12|22222222222222222222222222222222222222222222222222222222222222222222222222222222 +13|22222222222222222222222222222222222222222222222222222222222222222222222222222222 +14|22222222222222222222222222222222222222222222222222222222222222222222222222222222 +15|33333333333333333333333333333333333333333333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---clean()---works-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---clean()---works-002 index e2f4ae83..19897e49 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---clean()---works-002 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---clean()---works-002 @@ -1,33 +1,33 @@ --|---------|---------|---------|---------|---------|---------|---------|---------| -01| [No Name] m//confirm-clean X -02|This is a confirmation report before a clean. -03| -04|Lines `- ` show plugins to be deleted from disk. -05|Remove line to not delete that plugin. -06| -07|To finish clean, write this buffer (for example, with `:write` command). -08|To cancel clean, close this window (for example, with `:close` command). -09| -10|- plugin_not_in_session_1 (MOCKDIR/pack/deps/opt/plugin_not_in_session_1) -11|- plugin_not_in_session_2 +01|This is a confirmation report before a clean. +02| +03|Lines `- ` show plugins to be deleted from disk. +04|Remove line to not delete that plugin. +05| +06|To finish clean, write this buffer (for example, with `:write` command). +07|To cancel clean, close this window (for example, with `:close` command). +08| +09|- plugin_not_in_session_1 (MOCKDIR/pack/deps/opt/plugin_not_in_session_1) +10|- plugin_not_in_session_2 +11|~ 12|~ 13|~ 14|~ 15| --|---------|---------|---------|---------|---------|---------|---------|---------| -01|00000000000111111111111111111000000000000000000000000000000000000000000000000000 -02|22222222222222222222222222222222222222222222233333333333333333333333333333333333 -03|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -04|22222222222222222222222222222222222222222222222222222222333333333333333333333333 -05|22222222222222222222222222222222222222333333333333333333333333333333333333333333 -06|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -07|22222222222222222222222222222222222222222222222222222222222222222222222233333333 -08|22222222222222222222222222222222222222222222222222222222222222222222222233333333 -09|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -10|33333333333333333333333334444444444444444444444444444444444444444444444443333333 +01|00000000000000000000000000000000000000000000011111111111111111111111111111111111 +02|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|00000000000000000000000000000000000000000000000000000000111111111111111111111111 +04|00000000000000000000000000000000000000111111111111111111111111111111111111111111 +05|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +06|00000000000000000000000000000000000000000000000000000000000000000000000011111111 +07|00000000000000000000000000000000000000000000000000000000000000000000000011111111 +08|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +09|11111111111111111111111112222222222222222222222222222222222222222222222221111111 +10|11111111111111111111111111111111111111111111111111111111111111111111111111111111 11|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -12|55555555555555555555555555555555555555555555555555555555555555555555555555555555 -13|55555555555555555555555555555555555555555555555555555555555555555555555555555555 -14|55555555555555555555555555555555555555555555555555555555555555555555555555555555 -15|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +12|33333333333333333333333333333333333333333333333333333333333333333333333333333333 +13|33333333333333333333333333333333333333333333333333333333333333333333333333333333 +14|33333333333333333333333333333333333333333333333333333333333333333333333333333333 +15|44444444444444444444444444444444444444444444444444444444444444444444444444444444 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-fold-in-confirm-buffer b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-fold-in-confirm-buffer index ac76c876..5c2e0bb7 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-fold-in-confirm-buffer +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-fold-in-confirm-buffer @@ -1,29 +1,29 @@ --|---------|---------|---------|---------|---------|---------|---------|---------| -01| [No Name] m//confirm-update X -02|This is a confirmation report before an update. -03| -04|Line `+++ +++` means plugin will be updated. -05|See update details below it. -06|Changes starting with ">"/"<" will be added/removed. -07|Remove the line to not update that plugin. -08| -09|Line `--- ---` means plugin has nothing to update. -10| -11|Line `!!! !!!` means plugin had an error and won't be updated. -12|See error details below it. -13| -14|Use regular fold keys (`zM`, `zR`, etc.) to manage shorter view. -15|To finish update, write this buffer (for example, with `:write` command). -16|To cancel update, close this window (for example, with `:close` command). -17| -18|!!! plugin_3 !!! -19| >> ··········································································· -20| -21|+++ plugin_2 +++ -22| >> Path: MOCKDIR/pack/deps/opt/plugin_2······························· -23| -24|--- plugin_1 --- -25| >> Path: MOCKDIR/pack/deps/opt/plugin_1····································· +01|This is a confirmation report before an update. +02| +03|Line `+++ +++` means plugin will be updated. +04|See update details below it. +05|Changes starting with ">"/"<" will be added/removed. +06|Remove the line to not update that plugin. +07| +08|Line `--- ---` means plugin has nothing to update. +09| +10|Line `!!! !!!` means plugin had an error and won't be updated. +11|See error details below it. +12| +13|Use regular fold keys (`zM`, `zR`, etc.) to manage shorter view. +14|To finish update, write this buffer (for example, with `:write` command). +15|To cancel update, close this window (for example, with `:close` command). +16| +17|!!! plugin_3 !!! +18| >> ··········································································· +19| +20|+++ plugin_2 +++ +21| >> Path: MOCKDIR/pack/deps/opt/plugin_2······························· +22| +23|--- plugin_1 --- +24| >> Path: MOCKDIR/pack/deps/opt/plugin_1····································· +25|~ 26|~ 27|~ 28|~ @@ -31,33 +31,33 @@ 30| --|---------|---------|---------|---------|---------|---------|---------|---------| -01|00000000000111111111111111111100000000000000000000000000000000000000000000000000 -02|22222222222222222222222222222222222222222222222333333333333333333333333333333333 -03|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -04|22222222222222222222222222222222222222222222222222222222223333333333333333333333 -05|22222222222222222222222222223333333333333333333333333333333333333333333333333333 -06|22222222222222222222222222222222222222222222222222223333333333333333333333333333 -07|22222222222222222222222222222222222222222233333333333333333333333333333333333333 -08|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -09|22222222222222222222222222222222222222222222222222222222222222223333333333333333 -10|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -11|22222222222222222222222222222222222222222222222222222222222222222222222222223333 -12|22222222222222222222222222233333333333333333333333333333333333333333333333333333 -13|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -14|22222222222222222222222222222222222222222222222222222222222222223333333333333333 -15|22222222222222222222222222222222222222222222222222222222222222222222222223333333 -16|22222222222222222222222222222222222222222222222222222222222222222222222223333333 -17|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -18|44444444444444443333333333333333333333333333333333333333333333333333333333333333 -19|55555555555555555555555555555555555555555555555555555555555555555555555555555555 -20|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -21|66666666666666663333333333333333333333333333333333333333333333333333333333333333 -22|55555555555555555555555555555555555555555555555555555555555555555555555555555555 -23|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -24|77777777777777773333333333333333333333333333333333333333333333333333333333333333 -25|55555555555555555555555555555555555555555555555555555555555555555555555555555555 -26|88888888888888888888888888888888888888888888888888888888888888888888888888888888 -27|88888888888888888888888888888888888888888888888888888888888888888888888888888888 -28|88888888888888888888888888888888888888888888888888888888888888888888888888888888 -29|88888888888888888888888888888888888888888888888888888888888888888888888888888888 -30|99999999999999999999999999999999999999999999999999999999999999999999999999999999 +01|00000000000000000000000000000000000000000000000111111111111111111111111111111111 +02|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|00000000000000000000000000000000000000000000000000000000001111111111111111111111 +04|00000000000000000000000000001111111111111111111111111111111111111111111111111111 +05|00000000000000000000000000000000000000000000000000001111111111111111111111111111 +06|00000000000000000000000000000000000000000011111111111111111111111111111111111111 +07|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +08|00000000000000000000000000000000000000000000000000000000000000001111111111111111 +09|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +10|00000000000000000000000000000000000000000000000000000000000000000000000000001111 +11|00000000000000000000000000011111111111111111111111111111111111111111111111111111 +12|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +13|00000000000000000000000000000000000000000000000000000000000000001111111111111111 +14|00000000000000000000000000000000000000000000000000000000000000000000000001111111 +15|00000000000000000000000000000000000000000000000000000000000000000000000001111111 +16|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +17|22222222222222221111111111111111111111111111111111111111111111111111111111111111 +18|33333333333333333333333333333333333333333333333333333333333333333333333333333333 +19|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +20|44444444444444441111111111111111111111111111111111111111111111111111111111111111 +21|33333333333333333333333333333333333333333333333333333333333333333333333333333333 +22|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +23|55555555555555551111111111111111111111111111111111111111111111111111111111111111 +24|33333333333333333333333333333333333333333333333333333333333333333333333333333333 +25|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +26|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +27|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +28|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +29|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +30|77777777777777777777777777777777777777777777777777777777777777777777777777777777 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-highlight-breaking-changes b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-highlight-breaking-changes index e9d286f8..19917d16 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-highlight-breaking-changes +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-highlight-breaking-changes @@ -1,69 +1,69 @@ --|---------|---------|---------|---------|---------|---------|---------|---------| -01| [No Name] m//confirm-update X -02|This is a confirmation report before an update. -03| -04|Line `+++ +++` means plugin will be updated. -05|See update details below it. -06|Changes starting with ">"/"<" will be added/removed. -07|Remove the line to not update that plugin. -08| -09|Line `--- ---` means plugin has nothing to update. -10| -11|Line `!!! !!!` means plugin had an error and won't be updated. -12|See error details below it. -13| -14|Use regular fold keys (`zM`, `zR`, etc.) to manage shorter view. -15|To finish update, write this buffer (for example, with `:write` command). -16|To cancel update, close this window (for example, with `:close` command). -17| -18|+++ plugin_1 +++ -19|Path: MOCKDIR/pack/deps/opt/plugin_1 -20|Source: https://github.com/user/plugin_1 -21|State before: sha1head -22|State after: wow1head (main) -23| -24|Pending updates from `main`: -25|< sha2head | 2024-01-02 01:01:01 +0200 | Neo McVim -26| feat!: a breaking feature -27|> new2head | 2024-01-02 02:02:02 +0200 | Neo McVim -28| fix(deps)!: a breaking fix -29|> wow2head | 2024-01-02 03:03:03 +0200 | Neo McVim -30| fix: not a fix!: breaking change +01|This is a confirmation report before an update. +02| +03|Line `+++ +++` means plugin will be updated. +04|See update details below it. +05|Changes starting with ">"/"<" will be added/removed. +06|Remove the line to not update that plugin. +07| +08|Line `--- ---` means plugin has nothing to update. +09| +10|Line `!!! !!!` means plugin had an error and won't be updated. +11|See error details below it. +12| +13|Use regular fold keys (`zM`, `zR`, etc.) to manage shorter view. +14|To finish update, write this buffer (for example, with `:write` command). +15|To cancel update, close this window (for example, with `:close` command). +16| +17|+++ plugin_1 +++ +18|Path: MOCKDIR/pack/deps/opt/plugin_1 +19|Source: https://github.com/user/plugin_1 +20|State before: sha1head +21|State after: wow1head (main) +22| +23|Pending updates from `main`: +24|< sha2head | 2024-01-02 01:01:01 +0200 | Neo McVim +25| feat!: a breaking feature +26|> new2head | 2024-01-02 02:02:02 +0200 | Neo McVim +27| fix(deps)!: a breaking fix +28|> wow2head | 2024-01-02 03:03:03 +0200 | Neo McVim +29| fix: not a fix!: breaking change +30|~ 31|~ 32|~ 33| --|---------|---------|---------|---------|---------|---------|---------|---------| -01|00000000000111111111111111111100000000000000000000000000000000000000000000000000 -02|22222222222222222222222222222222222222222222222333333333333333333333333333333333 -03|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -04|22222222222222222222222222222222222222222222222222222222223333333333333333333333 -05|22222222222222222222222222223333333333333333333333333333333333333333333333333333 -06|22222222222222222222222222222222222222222222222222223333333333333333333333333333 -07|22222222222222222222222222222222222222222233333333333333333333333333333333333333 -08|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -09|22222222222222222222222222222222222222222222222222222222222222223333333333333333 -10|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -11|22222222222222222222222222222222222222222222222222222222222222222222222222223333 -12|22222222222222222222222222233333333333333333333333333333333333333333333333333333 -13|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -14|22222222222222222222222222222222222222222222222222222222222222223333333333333333 -15|22222222222222222222222222222222222222222222222222222222222222222222222223333333 -16|22222222222222222222222222222222222222222222222222222222222222222222222223333333 -17|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -18|44444444444444443333333333333333333333333333333333333333333333333333333333333333 -19|33333333333333555555555555555555555555555555333333333333333333333333333333333333 -20|33333333333333555555555555555555555555555555553333333333333333333333333333333333 -21|33333333333333555555553333333333333333333333333333333333333333333333333333333333 -22|33333333333333555555553222222333333333333333333333333333333333333333333333333333 -23|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -24|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -25|66666666666666666666666666666666666666666666666666333333333333333333333333333333 -26|77777777777777777777777777733333333333333333333333333333333333333333333333333333 -27|88888888888888888888888888888888888888888888888888333333333333333333333333333333 -28|77777777777777777777777777773333333333333333333333333333333333333333333333333333 -29|88888888888888888888888888888888888888888888888888333333333333333333333333333333 -30|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -31|99999999999999999999999999999999999999999999999999999999999999999999999999999999 -32|99999999999999999999999999999999999999999999999999999999999999999999999999999999 -33|:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +01|00000000000000000000000000000000000000000000000111111111111111111111111111111111 +02|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|00000000000000000000000000000000000000000000000000000000001111111111111111111111 +04|00000000000000000000000000001111111111111111111111111111111111111111111111111111 +05|00000000000000000000000000000000000000000000000000001111111111111111111111111111 +06|00000000000000000000000000000000000000000011111111111111111111111111111111111111 +07|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +08|00000000000000000000000000000000000000000000000000000000000000001111111111111111 +09|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +10|00000000000000000000000000000000000000000000000000000000000000000000000000001111 +11|00000000000000000000000000011111111111111111111111111111111111111111111111111111 +12|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +13|00000000000000000000000000000000000000000000000000000000000000001111111111111111 +14|00000000000000000000000000000000000000000000000000000000000000000000000001111111 +15|00000000000000000000000000000000000000000000000000000000000000000000000001111111 +16|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +17|22222222222222221111111111111111111111111111111111111111111111111111111111111111 +18|11111111111111333333333333333333333333333333111111111111111111111111111111111111 +19|11111111111111333333333333333333333333333333331111111111111111111111111111111111 +20|11111111111111333333331111111111111111111111111111111111111111111111111111111111 +21|11111111111111333333331000000111111111111111111111111111111111111111111111111111 +22|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +23|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +24|44444444444444444444444444444444444444444444444444111111111111111111111111111111 +25|55555555555555555555555555511111111111111111111111111111111111111111111111111111 +26|66666666666666666666666666666666666666666666666666111111111111111111111111111111 +27|55555555555555555555555555551111111111111111111111111111111111111111111111111111 +28|66666666666666666666666666666666666666666666666666111111111111111111111111111111 +29|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +30|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +31|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +32|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +33|88888888888888888888888888888888888888888888888888888888888888888888888888888888 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-work-with-non-default-branches b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-work-with-non-default-branches index db5a9a03..9fe779d1 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-work-with-non-default-branches +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---can-work-with-non-default-branches @@ -1,67 +1,67 @@ --|---------|---------|---------|---------|---------|---------|---------|---------| -01| [No Name] m//confirm-update X -02|This is a confirmation report before an update. -03| -04|Line `+++ +++` means plugin will be updated. -05|See update details below it. -06|Changes starting with ">"/"<" will be added/removed. -07|Remove the line to not update that plugin. -08| -09|Line `--- ---` means plugin has nothing to update. -10| -11|Line `!!! !!!` means plugin had an error and won't be updated. -12|See error details below it. -13| -14|Use regular fold keys (`zM`, `zR`, etc.) to manage shorter view. -15|To finish update, write this buffer (for example, with `:write` command). -16|To cancel update, close this window (for example, with `:close` command). -17| -18|+++ plugin_1 +++ -19|Path: MOCKDIR/pack/deps/opt/plugin_1 -20|Source: https://github.com/user/plugin_1 -21|State before: sha1head -22|State after: new1head (hello) -23| -24|Pending updates from `hello`: -25|> new1head | 2024-01-02 01:01:01 +0200 | Neo McVim -26| Added commit in checkout. -27| -28|Monitor updates from `world`: -29|> new2head | 2024-01-02 02:02:02 +0200 | Neo McVim -30| Added commit in monitor. +01|This is a confirmation report before an update. +02| +03|Line `+++ +++` means plugin will be updated. +04|See update details below it. +05|Changes starting with ">"/"<" will be added/removed. +06|Remove the line to not update that plugin. +07| +08|Line `--- ---` means plugin has nothing to update. +09| +10|Line `!!! !!!` means plugin had an error and won't be updated. +11|See error details below it. +12| +13|Use regular fold keys (`zM`, `zR`, etc.) to manage shorter view. +14|To finish update, write this buffer (for example, with `:write` command). +15|To cancel update, close this window (for example, with `:close` command). +16| +17|+++ plugin_1 +++ +18|Path: MOCKDIR/pack/deps/opt/plugin_1 +19|Source: https://github.com/user/plugin_1 +20|State before: sha1head +21|State after: new1head (hello) +22| +23|Pending updates from `hello`: +24|> new1head | 2024-01-02 01:01:01 +0200 | Neo McVim +25| Added commit in checkout. +26| +27|Monitor updates from `world`: +28|> new2head | 2024-01-02 02:02:02 +0200 | Neo McVim +29| Added commit in monitor. +30|~ 31|~ 32| --|---------|---------|---------|---------|---------|---------|---------|---------| -01|00000000000111111111111111111100000000000000000000000000000000000000000000000000 -02|22222222222222222222222222222222222222222222222333333333333333333333333333333333 -03|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -04|22222222222222222222222222222222222222222222222222222222223333333333333333333333 -05|22222222222222222222222222223333333333333333333333333333333333333333333333333333 -06|22222222222222222222222222222222222222222222222222223333333333333333333333333333 -07|22222222222222222222222222222222222222222233333333333333333333333333333333333333 -08|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -09|22222222222222222222222222222222222222222222222222222222222222223333333333333333 -10|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -11|22222222222222222222222222222222222222222222222222222222222222222222222222223333 -12|22222222222222222222222222233333333333333333333333333333333333333333333333333333 -13|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -14|22222222222222222222222222222222222222222222222222222222222222223333333333333333 -15|22222222222222222222222222222222222222222222222222222222222222222222222223333333 -16|22222222222222222222222222222222222222222222222222222222222222222222222223333333 -17|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -18|44444444444444443333333333333333333333333333333333333333333333333333333333333333 -19|33333333333333555555555555555555555555555555333333333333333333333333333333333333 -20|33333333333333555555555555555555555555555555553333333333333333333333333333333333 -21|33333333333333555555553333333333333333333333333333333333333333333333333333333333 -22|33333333333333555555553222222233333333333333333333333333333333333333333333333333 -23|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -24|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -25|66666666666666666666666666666666666666666666666666333333333333333333333333333333 -26|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -27|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -28|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -29|66666666666666666666666666666666666666666666666666333333333333333333333333333333 -30|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -31|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -32|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +01|00000000000000000000000000000000000000000000000111111111111111111111111111111111 +02|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|00000000000000000000000000000000000000000000000000000000001111111111111111111111 +04|00000000000000000000000000001111111111111111111111111111111111111111111111111111 +05|00000000000000000000000000000000000000000000000000001111111111111111111111111111 +06|00000000000000000000000000000000000000000011111111111111111111111111111111111111 +07|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +08|00000000000000000000000000000000000000000000000000000000000000001111111111111111 +09|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +10|00000000000000000000000000000000000000000000000000000000000000000000000000001111 +11|00000000000000000000000000011111111111111111111111111111111111111111111111111111 +12|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +13|00000000000000000000000000000000000000000000000000000000000000001111111111111111 +14|00000000000000000000000000000000000000000000000000000000000000000000000001111111 +15|00000000000000000000000000000000000000000000000000000000000000000000000001111111 +16|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +17|22222222222222221111111111111111111111111111111111111111111111111111111111111111 +18|11111111111111333333333333333333333333333333111111111111111111111111111111111111 +19|11111111111111333333333333333333333333333333331111111111111111111111111111111111 +20|11111111111111333333331111111111111111111111111111111111111111111111111111111111 +21|11111111111111333333331000000011111111111111111111111111111111111111111111111111 +22|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +23|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +24|44444444444444444444444444444444444444444444444444111111111111111111111111111111 +25|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +26|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +27|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +28|44444444444444444444444444444444444444444444444444111111111111111111111111111111 +29|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +30|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +31|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +32|66666666666666666666666666666666666666666666666666666666666666666666666666666666 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---shows-empty-monitor-log b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---shows-empty-monitor-log index 791a78f7..43e539ec 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---shows-empty-monitor-log +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---shows-empty-monitor-log @@ -1,57 +1,57 @@ --|---------|---------|---------|---------|---------|---------|---------|---------| -01| [No Name] m//confirm-update X -02|This is a confirmation report before an update. -03| -04|Line `+++ +++` means plugin will be updated. -05|See update details below it. -06|Changes starting with ">"/"<" will be added/removed. -07|Remove the line to not update that plugin. -08| -09|Line `--- ---` means plugin has nothing to update. -10| -11|Line `!!! !!!` means plugin had an error and won't be updated. -12|See error details below it. -13| -14|Use regular fold keys (`zM`, `zR`, etc.) to manage shorter view. -15|To finish update, write this buffer (for example, with `:write` command). -16|To cancel update, close this window (for example, with `:close` command). -17| -18|--- plugin_1 --- -19|Path: MOCKDIR/pack/deps/opt/plugin_1 -20|Source: https://github.com/user/plugin_1 -21|State: sha1head (hello) -22| -23|Monitor updates from `world`: -24| +01|This is a confirmation report before an update. +02| +03|Line `+++ +++` means plugin will be updated. +04|See update details below it. +05|Changes starting with ">"/"<" will be added/removed. +06|Remove the line to not update that plugin. +07| +08|Line `--- ---` means plugin has nothing to update. +09| +10|Line `!!! !!!` means plugin had an error and won't be updated. +11|See error details below it. +12| +13|Use regular fold keys (`zM`, `zR`, etc.) to manage shorter view. +14|To finish update, write this buffer (for example, with `:write` command). +15|To cancel update, close this window (for example, with `:close` command). +16| +17|--- plugin_1 --- +18|Path: MOCKDIR/pack/deps/opt/plugin_1 +19|Source: https://github.com/user/plugin_1 +20|State: sha1head (hello) +21| +22|Monitor updates from `world`: +23| +24|~ 25|~ 26|~ 27| --|---------|---------|---------|---------|---------|---------|---------|---------| -01|00000000000111111111111111111100000000000000000000000000000000000000000000000000 -02|22222222222222222222222222222222222222222222222333333333333333333333333333333333 -03|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -04|22222222222222222222222222222222222222222222222222222222223333333333333333333333 -05|22222222222222222222222222223333333333333333333333333333333333333333333333333333 -06|22222222222222222222222222222222222222222222222222223333333333333333333333333333 -07|22222222222222222222222222222222222222222233333333333333333333333333333333333333 -08|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -09|22222222222222222222222222222222222222222222222222222222222222223333333333333333 -10|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -11|22222222222222222222222222222222222222222222222222222222222222222222222222223333 -12|22222222222222222222222222233333333333333333333333333333333333333333333333333333 -13|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -14|22222222222222222222222222222222222222222222222222222222222222223333333333333333 -15|22222222222222222222222222222222222222222222222222222222222222222222222223333333 -16|22222222222222222222222222222222222222222222222222222222222222222222222223333333 -17|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -18|44444444444444443333333333333333333333333333333333333333333333333333333333333333 -19|33333333555555555555555555555555555555333333333333333333333333333333333333333333 -20|33333333555555555555555555555555555555553333333333333333333333333333333333333333 -21|33333333555555553222222233333333333333333333333333333333333333333333333333333333 -22|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -23|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -24|66666666633333333333333333333333333333333333333333333333333333333333333333333333 -25|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -26|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -27|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +01|00000000000000000000000000000000000000000000000111111111111111111111111111111111 +02|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|00000000000000000000000000000000000000000000000000000000001111111111111111111111 +04|00000000000000000000000000001111111111111111111111111111111111111111111111111111 +05|00000000000000000000000000000000000000000000000000001111111111111111111111111111 +06|00000000000000000000000000000000000000000011111111111111111111111111111111111111 +07|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +08|00000000000000000000000000000000000000000000000000000000000000001111111111111111 +09|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +10|00000000000000000000000000000000000000000000000000000000000000000000000000001111 +11|00000000000000000000000000011111111111111111111111111111111111111111111111111111 +12|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +13|00000000000000000000000000000000000000000000000000000000000000001111111111111111 +14|00000000000000000000000000000000000000000000000000000000000000000000000001111111 +15|00000000000000000000000000000000000000000000000000000000000000000000000001111111 +16|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +17|22222222222222221111111111111111111111111111111111111111111111111111111111111111 +18|11111111333333333333333333333333333333111111111111111111111111111111111111111111 +19|11111111333333333333333333333333333333331111111111111111111111111111111111111111 +20|11111111333333331000000011111111111111111111111111111111111111111111111111111111 +21|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +22|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +23|44444444411111111111111111111111111111111111111111111111111111111111111111111111 +24|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +25|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +26|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +27|66666666666666666666666666666666666666666666666666666666666666666666666666666666 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---works b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---works index 92707c9f..6cc80a43 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---works +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_deps.lua---update()---works @@ -1,83 +1,83 @@ --|---------|---------|---------|---------|---------|---------|---------|---------| -01| [No Name] m//confirm-update X -02|This is a confirmation report before an update. -03| -04|Line `+++ +++` means plugin will be updated. -05|See update details below it. -06|Changes starting with ">"/"<" will be added/removed. -07|Remove the line to not update that plugin. -08| -09|Line `--- ---` means plugin has nothing to update. -10| -11|Line `!!! !!!` means plugin had an error and won't be updated. -12|See error details below it. -13| -14|Use regular fold keys (`zM`, `zR`, etc.) to manage shorter view. -15|To finish update, write this buffer (for example, with `:write` command). -16|To cancel update, close this window (for example, with `:close` command). -17| -18|!!! plugin_3 !!! -19| -20|ERROR CODE 1 -21|Error computing origin -22| -23|+++ plugin_2 +++ -24|Path: MOCKDIR/pack/deps/opt/plugin_2 -25|Source: https://new_source/plugin_2 -26|State before: sha2head -27|State after: new2head (master) -28| -29|Pending updates from `master`: -30|< sha2head | 2024-01-02 01:01:01 +0200 | Neo McVim -31| Removed commit in plugin_2. -32|> new2head | 2024-01-02 02:02:02 +0200 | Neo McVim -33| Added commit in plugin_2. -34| -35|--- plugin_1 --- -36|Path: MOCKDIR/pack/deps/opt/plugin_1 -37|Source: https://github.com/user/plugin_1 -38|State: sha1head (main) +01|This is a confirmation report before an update. +02| +03|Line `+++ +++` means plugin will be updated. +04|See update details below it. +05|Changes starting with ">"/"<" will be added/removed. +06|Remove the line to not update that plugin. +07| +08|Line `--- ---` means plugin has nothing to update. +09| +10|Line `!!! !!!` means plugin had an error and won't be updated. +11|See error details below it. +12| +13|Use regular fold keys (`zM`, `zR`, etc.) to manage shorter view. +14|To finish update, write this buffer (for example, with `:write` command). +15|To cancel update, close this window (for example, with `:close` command). +16| +17|!!! plugin_3 !!! +18| +19|ERROR CODE 1 +20|Error computing origin +21| +22|+++ plugin_2 +++ +23|Path: MOCKDIR/pack/deps/opt/plugin_2 +24|Source: https://new_source/plugin_2 +25|State before: sha2head +26|State after: new2head (master) +27| +28|Pending updates from `master`: +29|< sha2head | 2024-01-02 01:01:01 +0200 | Neo McVim +30| Removed commit in plugin_2. +31|> new2head | 2024-01-02 02:02:02 +0200 | Neo McVim +32| Added commit in plugin_2. +33| +34|--- plugin_1 --- +35|Path: MOCKDIR/pack/deps/opt/plugin_1 +36|Source: https://github.com/user/plugin_1 +37|State: sha1head (main) +38|~ 39|~ 40| --|---------|---------|---------|---------|---------|---------|---------|---------| -01|00000000000111111111111111111100000000000000000000000000000000000000000000000000 -02|22222222222222222222222222222222222222222222222333333333333333333333333333333333 -03|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -04|22222222222222222222222222222222222222222222222222222222223333333333333333333333 -05|22222222222222222222222222223333333333333333333333333333333333333333333333333333 -06|22222222222222222222222222222222222222222222222222223333333333333333333333333333 -07|22222222222222222222222222222222222222222233333333333333333333333333333333333333 -08|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -09|22222222222222222222222222222222222222222222222222222222222222223333333333333333 -10|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -11|22222222222222222222222222222222222222222222222222222222222222222222222222223333 -12|22222222222222222222222222233333333333333333333333333333333333333333333333333333 -13|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -14|22222222222222222222222222222222222222222222222222222222222222223333333333333333 -15|22222222222222222222222222222222222222222222222222222222222222222222222223333333 -16|22222222222222222222222222222222222222222222222222222222222222222222222223333333 -17|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -18|44444444444444443333333333333333333333333333333333333333333333333333333333333333 -19|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -20|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -21|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -22|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -23|55555555555555553333333333333333333333333333333333333333333333333333333333333333 -24|33333333333333666666666666666666666666666666333333333333333333333333333333333333 -25|33333333333333666666666666666666666666666333333333333333333333333333333333333333 -26|33333333333333666666663333333333333333333333333333333333333333333333333333333333 -27|33333333333333666666663222222223333333333333333333333333333333333333333333333333 -28|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -29|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -30|77777777777777777777777777777777777777777777777777333333333333333333333333333333 -31|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -32|88888888888888888888888888888888888888888888888888333333333333333333333333333333 -33|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -34|33333333333333333333333333333333333333333333333333333333333333333333333333333333 -35|99999999999999993333333333333333333333333333333333333333333333333333333333333333 -36|33333333666666666666666666666666666666333333333333333333333333333333333333333333 -37|33333333666666666666666666666666666666663333333333333333333333333333333333333333 -38|33333333666666663222222333333333333333333333333333333333333333333333333333333333 -39|:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -40|;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +01|00000000000000000000000000000000000000000000000111111111111111111111111111111111 +02|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|00000000000000000000000000000000000000000000000000000000001111111111111111111111 +04|00000000000000000000000000001111111111111111111111111111111111111111111111111111 +05|00000000000000000000000000000000000000000000000000001111111111111111111111111111 +06|00000000000000000000000000000000000000000011111111111111111111111111111111111111 +07|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +08|00000000000000000000000000000000000000000000000000000000000000001111111111111111 +09|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +10|00000000000000000000000000000000000000000000000000000000000000000000000000001111 +11|00000000000000000000000000011111111111111111111111111111111111111111111111111111 +12|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +13|00000000000000000000000000000000000000000000000000000000000000001111111111111111 +14|00000000000000000000000000000000000000000000000000000000000000000000000001111111 +15|00000000000000000000000000000000000000000000000000000000000000000000000001111111 +16|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +17|22222222222222221111111111111111111111111111111111111111111111111111111111111111 +18|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +19|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +20|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +21|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +22|33333333333333331111111111111111111111111111111111111111111111111111111111111111 +23|11111111111111444444444444444444444444444444111111111111111111111111111111111111 +24|11111111111111444444444444444444444444444111111111111111111111111111111111111111 +25|11111111111111444444441111111111111111111111111111111111111111111111111111111111 +26|11111111111111444444441000000001111111111111111111111111111111111111111111111111 +27|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +28|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +29|55555555555555555555555555555555555555555555555555111111111111111111111111111111 +30|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +31|66666666666666666666666666666666666666666666666666111111111111111111111111111111 +32|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +33|11111111111111111111111111111111111111111111111111111111111111111111111111111111 +34|77777777777777771111111111111111111111111111111111111111111111111111111111111111 +35|11111111444444444444444444444444444444111111111111111111111111111111111111111111 +36|11111111444444444444444444444444444444441111111111111111111111111111111111111111 +37|11111111444444441000000111111111111111111111111111111111111111111111111111111111 +38|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +39|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +40|99999999999999999999999999999999999999999999999999999999999999999999999999999999 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()` b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()` new file mode 100644 index 00000000..f2371da8 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()` @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|local a = 1 +02|local t = { +03| x = math.max(a, 2), +04| y = math.min(a, 2), +05|┌> ▏────────────────────────────────────────────────────┐ +06|│[ Number] a │ +07|│[ Object] t │ +08|│[ Variable] x │ +09|│[ Variable] y │ +10|│ │ +11|│ │ +12|│ │ +13|│ │ +14|└ LSP (document_symbol) ───────────────────────── 1|4|4 ┘ +15| + +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|000001111121111111111111111111111111111111111111111111111111111111111111111111111111111111 +02|000001111131111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +04|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +05|788877777777777777777777777777777777777777777777777777777111111111111111111111111111111111 +06|7999999999999:::::::::::::::::::::::::::::::::::::::::::7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +07|7<<<<<<<<<<<<===========================================7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +08|7>>>>>>>>>>>>>>=========================================7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +09|7>>>>>>>>>>>>>>=========================================7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +10|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +11|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +12|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +13|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +14|7@@@@@@@@@@@@@@@@@@@@@@@7777777777777777777777777@@@@@@@7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +15|111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()`-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()`-002 new file mode 100644 index 00000000..a22cb348 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()`-002 @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|local a = 1 +02|local t = { +03| x = math.max(a, 2), +04| y = math.min(a, 2), +05|┌> ▏────────────────────────────────────────────────────┐ +06|│[Number ] a │ +07|│[Object ] t │ +08|│[Variable ] x │ +09|│[Variable ] y │ +10|│ │ +11|│ │ +12|│ │ +13|│ │ +14|└ LSP (document_symbol) ───────────────────────── 1|4|4 ┘ +15| + +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|000001111121111111111111111111111111111111111111111111111111111111111111111111111111111111 +02|000001111131111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +04|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +05|788877777777777777777777777777777777777777777777777777777111111111111111111111111111111111 +06|7999999999999:::::::::::::::::::::::::::::::::::::::::::7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +07|7<<<<<<<<<<<<===========================================7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +08|7>>>>>>>>>>>>>>=========================================7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +09|7>>>>>>>>>>>>>>=========================================7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +10|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +11|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +12|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +13|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +14|7@@@@@@@@@@@@@@@@@@@@@@@7777777777777777777777777@@@@@@@7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +15|111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()`-003 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()`-003 new file mode 100644 index 00000000..a25db07f --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`document_symbol`-after-`MiniIcons.tweak_lsp_kind()`-003 @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|local a = 1 +02|local t = { +03| x = math.max(a, 2), +04| y = math.min(a, 2), +05|┌> ▏────────────────────────────────────────────────────┐ +06|│[] a │ +07|│[] t │ +08|│[] x │ +09|│[] y │ +10|│ │ +11|│ │ +12|│ │ +13|│ │ +14|└ LSP (document_symbol) ───────────────────────── 1|4|4 ┘ +15| + +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|000001111121111111111111111111111111111111111111111111111111111111111111111111111111111111 +02|000001111131111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +04|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +05|788877777777777777777777777777777777777777777777777777777111111111111111111111111111111111 +06|799999::::::::::::::::::::::::::::::::::::::::::::::::::7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +07|7<<<<<==================================================7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +08|7>>>>>==================================================7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +09|7>>>>>==================================================7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +10|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +11|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +12|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +13|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +14|7@@@@@@@@@@@@@@@@@@@@@@@7777777777777777777777777@@@@@@@7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +15|111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()` b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()` new file mode 100644 index 00000000..32e889c2 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()` @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|local a = 1 +02|local t = { +03| x = math.max(a, 2), +04| y = math.min(a, 2), +05|┌> ▏────────────────────────────────────────────────────┐ +06|│tests/dir-extra/real-files/a.lua│1│7│ [ Number] a │ +07|│tests/dir-extra/real-files/a.lua│2│7│ [ Object] t │ +08|│tests/dir-extra/real-files/a.lua│3│3│ [ Variable] x │ +09|│tests/dir-extra/real-files/a.lua│4│3│ [ Variable] y │ +10|│ │ +11|│ │ +12|│ │ +13|│ │ +14|└ LSP (workspace_symbol) ──────────────────────── 1|4|4 ┘ +15| + +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|000001111121111111111111111111111111111111111111111111111111111111111111111111111111111111 +02|000001111131111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +04|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +05|788877777777777777777777777777777777777777777777777777777111111111111111111111111111111111 +06|799999999999999999999999999999999999999999999999999:::::7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +07|7<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<=====7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +08|7>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>===7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +09|7>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>===7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +10|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +11|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +12|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +13|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +14|7@@@@@@@@@@@@@@@@@@@@@@@@777777777777777777777777@@@@@@@7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +15|111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()`-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()`-002 new file mode 100644 index 00000000..41b3020f --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()`-002 @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|local a = 1 +02|local t = { +03| x = math.max(a, 2), +04| y = math.min(a, 2), +05|┌> ▏────────────────────────────────────────────────────┐ +06|│tests/dir-extra/real-files/a.lua│1│7│ [Number ] a │ +07|│tests/dir-extra/real-files/a.lua│2│7│ [Object ] t │ +08|│tests/dir-extra/real-files/a.lua│3│3│ [Variable ] x │ +09|│tests/dir-extra/real-files/a.lua│4│3│ [Variable ] y │ +10|│ │ +11|│ │ +12|│ │ +13|│ │ +14|└ LSP (workspace_symbol) ──────────────────────── 1|4|4 ┘ +15| + +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|000001111121111111111111111111111111111111111111111111111111111111111111111111111111111111 +02|000001111131111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +04|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +05|788877777777777777777777777777777777777777777777777777777111111111111111111111111111111111 +06|799999999999999999999999999999999999999999999999999:::::7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +07|7<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<=====7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +08|7>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>===7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +09|7>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>===7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +10|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +11|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +12|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +13|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +14|7@@@@@@@@@@@@@@@@@@@@@@@@777777777777777777777777@@@@@@@7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +15|111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()`-003 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()`-003 new file mode 100644 index 00000000..595b1897 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_extra.lua---pickers---lsp()---works-for-`workspace_symbol`-after-`MiniIcons.tweak_lsp_kind()`-003 @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|local a = 1 +02|local t = { +03| x = math.max(a, 2), +04| y = math.min(a, 2), +05|┌> ▏────────────────────────────────────────────────────┐ +06|│tests/dir-extra/real-files/a.lua│1│7│ [] a │ +07|│tests/dir-extra/real-files/a.lua│2│7│ [] t │ +08|│tests/dir-extra/real-files/a.lua│3│3│ [] x │ +09|│tests/dir-extra/real-files/a.lua│4│3│ [] y │ +10|│ │ +11|│ │ +12|│ │ +13|│ │ +14|└ LSP (workspace_symbol) ──────────────────────── 1|4|4 ┘ +15| + +--|---------|---------|---------|---------|---------|---------|---------|---------|---------| +01|000001111121111111111111111111111111111111111111111111111111111111111111111111111111111111 +02|000001111131111111111111111111111111111111111111111111111111111111111111111111111111111111 +03|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +04|114111333356665151255111111111111111111111111111111111111111111111111111111111111111111111 +05|788877777777777777777777777777777777777777777777777777777111111111111111111111111111111111 +06|79999999999999999999999999999999999999999999::::::::::::7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +07|7<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<============7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +08|7>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>============7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +09|7>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>============7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +10|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +11|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +12|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +13|7???????????????????????????????????????????????????????7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +14|7@@@@@@@@@@@@@@@@@@@@@@@@777777777777777777777777@@@@@@@7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +15|111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts new file mode 100644 index 00000000..04b0386d --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|┌ …es/commo┐┌ .a-dir ────────────────────────────────┐┌ aa-file ───────────┐ +02|│ .a-dir ││ aa-file ││ │ +03|│ a-dir ││ ab-file ││ │ +04|│ b-dir ││ ││ │ +05|│ .a-file ││ ││ │ +06|│ a-file ││ ││ │ +07|└──────────┘└────────────────────────────────────────┘└────────────────────┘ +08|~ +09|~ +10|~ +11|~ +12|~ +13|~ +14|~ +15| 1,9-7 All + +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|01222222222001333333100000000000000000000000000000000001222222210000000000004444 +02|05555555566006666666666666666666666666666666666666666006666666666666666666607777 +03|08888888111001111111111111111111111111111111111111111009999999999999999999907777 +04|08888888111009999999999999999999999999999999999999999009999999999999999999907777 +05|01111111111009999999999999999999999999999999999999999009999999999999999999907777 +06|01111111111009999999999999999999999999999999999999999009999999999999999999907777 +07|00000000000000000000000000000000000000000000000000000000000000000000000000007777 +08|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +09|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +10|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +11|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +12|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +13|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +14|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +15|44444444444444444444444444444444444444444444444444444444444444444444444444444444 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-002 new file mode 100644 index 00000000..7c9b8cbf --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-002 @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|┌ …es/commo┐┌ .a-dir ────────────────────────────────┐ +02|│ .a-dir ││ aa-file │ +03|│ a-dir ││abc │ +04|│ b-dir ││ ab-file │ +05|│ .a-file ││ │ +06|│ a-file ││ │ +07|└──────────┘└────────────────────────────────────────┘ +08|~ +09|~ +10|~ +11|~ +12|~ +13|~ +14|~ +15|-- INSERT -- 2,4 All + +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|01222222222031444444133333333333333333333333333333333355555555555555555555555555 +02|06666666677031111111111111111111111111111111111111111388888888888888888888888888 +03|09999999111037777777777777777777777777777777777777777388888888888888888888888888 +04|09999999111031111111111111111111111111111111111111111388888888888888888888888888 +05|0111111111103::::::::::::::::::::::::::::::::::::::::388888888888888888888888888 +06|0111111111103::::::::::::::::::::::::::::::::::::::::388888888888888888888888888 +07|00000000000033333333333333333333333333333333333333333388888888888888888888888888 +08|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +09|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +10|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +11|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +12|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +13|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +14|88888888888888888888888888888888888888888888888888888888888888888888888888888888 +15|;;;;;;;;;;;;55555555555555555555555555555555555555555555555555555555555555555555 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-003 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-003 new file mode 100644 index 00000000..1f2a8c85 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-003 @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|┌ MOCK_ROOT/tests/dir-files/common ──────┐ +02|│ .a-dir │ +03|│def │ +04|│ a-dir │ +05|│ b-dir │ +06|│ .a-file │ +07|└────────────────────────────────────────┘ +08|~ +09|~ +10|~ +11|~ +12|~ +13|~ +14|~ +15|-- INSERT -- 2,4 Top + +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|01222222222222222222222222222222221000000033333333333333333333333333333333333333 +02|04444444411111111111111111111111111111111055555555555555555555555555555555555555 +03|06666666666666666666666666666666666666666055555555555555555555555555555555555555 +04|04444444111111111111111111111111111111111055555555555555555555555555555555555555 +05|04444444111111111111111111111111111111111055555555555555555555555555555555555555 +06|01111111111111111111111111111111111111111055555555555555555555555555555555555555 +07|00000000000000000000000000000000000000000055555555555555555555555555555555555555 +08|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +09|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +10|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +11|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +12|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +13|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +14|55555555555555555555555555555555555555555555555555555555555555555555555555555555 +15|77777777777733333333333333333333333333333333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-rename-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-004 similarity index 55% rename from config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-rename-002 rename to config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-004 index 16ee1d49..e691ed66 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-rename-002 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-004 @@ -1,11 +1,11 @@ --|---------|---------|---------|---------|---------|---------|---------|---------| -01|┌MOCK_ROOT/tests/dir-files/temp────────────────────┐ -02|│ file-1 │ -03|│ file-2 │ -04|└──────────────────────────────────────────────────┘ -05|~ -06|~ -07|~ +01|┌ MOCK_ROOT/tests/dir-files/common ──────┐ +02|│def │ +03|│ a-dir │ +04|│ b-dir │ +05|│ .a-file │ +06|│a │ +07|└────────────────────────────────────────┘ 08|~ 09|~ 10|~ @@ -13,16 +13,16 @@ 12|~ 13|~ 14|~ -15| 2,9-7 All +15|-- INSERT -- 6,2 25% --|---------|---------|---------|---------|---------|---------|---------|---------| -01|01111111111111111111111111111110000000000000000000002222222222222222222222222222 -02|03333333333333333333333333333333333333333333333333304444444444444444444444444444 -03|05555555555555555555555555555555555555555555555555504444444444444444444444444444 -04|00000000000000000000000000000000000000000000000000004444444444444444444444444444 -05|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -06|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -07|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +01|01222222222222222222222222222222221000000033333333333333333333333333333333333333 +02|01111111111111111111111111111111111111111044444444444444444444444444444444444444 +03|05555555111111111111111111111111111111111044444444444444444444444444444444444444 +04|05555555111111111111111111111111111111111044444444444444444444444444444444444444 +05|01111111111111111111111111111111111111111044444444444444444444444444444444444444 +06|06666666666666666666666666666666666666666044444444444444444444444444444444444444 +07|00000000000000000000000000000000000000000044444444444444444444444444444444444444 08|44444444444444444444444444444444444444444444444444444444444444444444444444444444 09|44444444444444444444444444444444444444444444444444444444444444444444444444444444 10|44444444444444444444444444444444444444444444444444444444444444444444444444444444 @@ -30,4 +30,4 @@ 12|44444444444444444444444444444444444444444444444444444444444444444444444444444444 13|44444444444444444444444444444444444444444444444444444444444444444444444444444444 14|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -15|22222222222222222222222222222222222222222222222222222222222222222222222222222222 +15|77777777777733333333333333333333333333333333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-005 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-005 new file mode 100644 index 00000000..1568711a --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Events---`MiniFilesWindowUpdate`-can-customize-internally-set-window-config-parts-005 @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|┌ MOCK_ROOT/tests/dir-files/common ──────┐ +02|│def │ +03|│ a-dir │ +04|│ b-dir │ +05|│ .a-file │ +06|│a-file │ +07| a-file ─────────────────────────┘ +08| a-dir +09|~ +10|~ +11|~ +12|~ +13|~ +14|~ +15|-- Keyword completion (^N^P) match 1 of 2 + +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|01222222222222222222222222222222221000000033333333333333333333333333333333333333 +02|01111111111111111111111111111111111111111044444444444444444444444444444444444444 +03|05555555111111111111111111111111111111111044444444444444444444444444444444444444 +04|05555555111111111111111111111111111111111044444444444444444444444444444444444444 +05|01111111111111111111111111111111111111111044444444444444444444444444444444444444 +06|06666666666666666666666666666666666666666044444444444444444444444444444444444444 +07|77777777777777770000000000000000000000000044444444444444444444444444444444444444 +08|66666666666666664444444444444444444444444444444444444444444444444444444444444444 +09|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +10|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +11|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +12|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +13|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +14|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +15|88888888888888888888888888888999999999999333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-move b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-move deleted file mode 100644 index 053c75b2..00000000 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-move +++ /dev/null @@ -1,33 +0,0 @@ ---|---------|---------|---------|---------|---------|---------|---------|---------| -01|┌…dir-files/temp┐┌dir───────────────────────────────────────────────┐ -02|│ dir ││ file-1 │ -03|└───────────────┘│ file │ -04|~ └──────────────────────────────────────────────────┘ -05|~ -06|~ -07|~ -08|~ -09|~ -10|~ -11|~ -12|~ -13|~ -14|~ -15| 1,14-12 All - ---|---------|---------|---------|---------|---------|---------|---------|---------| -01|01111111111111110022200000000000000000000000000000000000000000000000033333333333 -02|04444455555555550055555555555555555555555555555555555555555555555555066666666666 -03|00000000000000000077777777777777777777777777777777777777777777777777066666666666 -04|66666666666666666000000000000000000000000000000000000000000000000000066666666666 -05|66666666666666666666666666666666666666666666666666666666666666666666666666666666 -06|66666666666666666666666666666666666666666666666666666666666666666666666666666666 -07|66666666666666666666666666666666666666666666666666666666666666666666666666666666 -08|66666666666666666666666666666666666666666666666666666666666666666666666666666666 -09|66666666666666666666666666666666666666666666666666666666666666666666666666666666 -10|66666666666666666666666666666666666666666666666666666666666666666666666666666666 -11|66666666666666666666666666666666666666666666666666666666666666666666666666666666 -12|66666666666666666666666666666666666666666666666666666666666666666666666666666666 -13|66666666666666666666666666666666666666666666666666666666666666666666666666666666 -14|66666666666666666666666666666666666666666666666666666666666666666666666666666666 -15|33333333333333333333333333333333333333333333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-move-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-move-002 deleted file mode 100644 index 22e9766c..00000000 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-move-002 +++ /dev/null @@ -1,33 +0,0 @@ ---|---------|---------|---------|---------|---------|---------|---------|---------| -01|┌…dir-files/temp┐┌dir───────────────────────────────────────────────┐ -02|│ dir ││ file │ -03|└───────────────┘│ file-1 │ -04|~ └──────────────────────────────────────────────────┘ -05|~ -06|~ -07|~ -08|~ -09|~ -10|~ -11|~ -12|~ -13|~ -14|~ -15| 2,9-7 All - ---|---------|---------|---------|---------|---------|---------|---------|---------| -01|01111111111111110022200000000000000000000000000000000000000000000000033333333333 -02|04444455555555550066666666666666666666666666666666666666666666666666077777777777 -03|00000000000000000055555555555555555555555555555555555555555555555555077777777777 -04|77777777777777777000000000000000000000000000000000000000000000000000077777777777 -05|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -06|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -07|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -08|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -09|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -10|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -11|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -12|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -13|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -14|77777777777777777777777777777777777777777777777777777777777777777777777777777777 -15|33333333333333333333333333333333333333333333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-rename b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-rename deleted file mode 100644 index 95996ed8..00000000 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---handles-simultaneous-copy-and-rename +++ /dev/null @@ -1,33 +0,0 @@ ---|---------|---------|---------|---------|---------|---------|---------|---------| -01|┌MOCK_ROOT/tests/dir-files/temp────────────────────┐ -02|│ file-1 │ -03|│ file-2 │ -04|└──────────────────────────────────────────────────┘ -05|~ -06|~ -07|~ -08|~ -09|~ -10|~ -11|~ -12|~ -13|~ -14|~ -15| 2,14-12 All - ---|---------|---------|---------|---------|---------|---------|---------|---------| -01|01111111111111111111111111111110000000000000000000002222222222222222222222222222 -02|03333333333333333333333333333333333333333333333333304444444444444444444444444444 -03|05555555555555555555555555555555555555555555555555504444444444444444444444444444 -04|00000000000000000000000000000000000000000000000000004444444444444444444444444444 -05|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -06|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -07|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -08|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -09|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -10|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -11|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -12|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -13|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -14|44444444444444444444444444444444444444444444444444444444444444444444444444444444 -15|22222222222222222222222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---move-works-again-after-undo-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---move-works-again-after-undo-002 index 47de2044..b4442e53 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---move-works-again-after-undo-002 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---File-manipulation---move-works-again-after-undo-002 @@ -13,7 +13,7 @@ 12|~ 13|~ 14|~ -15|1 more line; before #1 0 seconds ago 2,9-7 All +15| 2,9-7 All --|---------|---------|---------|---------|---------|---------|---------|---------| 01|01111111111111111111111111111110000000000000000000002222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works index 388eb587..811eebc0 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works @@ -8,17 +8,19 @@ 07|││Go in entry plus │ L │ │ 08|││Go out of directory │ h │ │ 09|└│Go out of directory plus │ H │─────────────────┘ -10|~│Reset │ │ -11|~│Reveal cwd │ @ │ -12|~│Show Help │ g? │ -13|~│Synchronize │ = │ -14|~│Trim branch left │ < │ -15|~│Trim branch right │ > │ -16|~│ │ -17|~│(Press `q` to close) │ -18|~└───────────────────────────────┘ -19|~ -20| 1,1 All +10|~│Go to bookmark │ ' │ +11|~│Reset │ │ +12|~│Reveal cwd │ @ │ +13|~│Set bookmark │ m │ +14|~│Show Help │ g? │ +15|~│Synchronize │ = │ +16|~│Trim branch left │ < │ +17|~│Trim branch right │ > │ +18|~│ │ +19|~│(Press `q` to close) │ +20|~└───────────────────────────────┘ +21|~ +22| 1,1 All --|---------|---------|---------|---------|---------|---------| 01|011111111111111111111111111111111000000000000000000022222222 @@ -38,6 +40,8 @@ 15|506666666666666666666666666666666055555555555555555555555555 16|506666666666666666666666666666666055555555555555555555555555 17|506666666666666666666666666666666055555555555555555555555555 -18|500000000000000000000000000000000055555555555555555555555555 -19|555555555555555555555555555555555555555555555555555555555555 -20|222222222222222222222222222222222222222222222222222222222222 +18|506666666666666666666666666666666055555555555555555555555555 +19|506666666666666666666666666666666055555555555555555555555555 +20|500000000000000000000000000000000055555555555555555555555555 +21|555555555555555555555555555555555555555555555555555555555555 +22|222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works-002 index 44750faf..b8712975 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works-002 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works-002 @@ -8,17 +8,19 @@ 07|││Go in entry plus │ L │ │ 08|││Go out of directory │ h │ │ 09|└│Go out of directory plus │ H │─────────────────┘ -10|~│Reset │ │ -11|~│Reveal cwd │ @ │ -12|~│Show Help │ Q │ -13|~│Synchronize │ = │ -14|~│Trim branch left │ < │ -15|~│Trim branch right │ > │ -16|~│ │ -17|~│(Press `q` to close) │ -18|~└───────────────────────────────┘ -19|~ -20| 1,1 All +10|~│Go to bookmark │ ' │ +11|~│Reset │ │ +12|~│Reveal cwd │ @ │ +13|~│Set bookmark │ m │ +14|~│Show Help │ Q │ +15|~│Synchronize │ = │ +16|~│Trim branch left │ < │ +17|~│Trim branch right │ > │ +18|~│ │ +19|~│(Press `q` to close) │ +20|~└───────────────────────────────┘ +21|~ +22| 1,1 All --|---------|---------|---------|---------|---------|---------| 01|011111111111111111111111111111111000000000000000000022222222 @@ -38,6 +40,8 @@ 15|506666666666666666666666666666666055555555555555555555555555 16|506666666666666666666666666666666055555555555555555555555555 17|506666666666666666666666666666666055555555555555555555555555 -18|500000000000000000000000000000000055555555555555555555555555 -19|555555555555555555555555555555555555555555555555555555555555 -20|222222222222222222222222222222222222222222222222222222222222 +18|506666666666666666666666666666666055555555555555555555555555 +19|506666666666666666666666666666666055555555555555555555555555 +20|500000000000000000000000000000000055555555555555555555555555 +21|555555555555555555555555555555555555555555555555555555555555 +22|222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works-003 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works-003 index 5740a335..9cd52a7e 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works-003 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Mappings---`show_help`-works-003 @@ -18,7 +18,9 @@ 17|~ 18|~ 19|~ -20| g? 1,9-7 All +20|~ +21|~ +22| g? 1,9-7 All --|---------|---------|---------|---------|---------|---------| 01|011111111111111111111111111111111000000000000000000022222222 @@ -40,4 +42,6 @@ 17|555555555555555555555555555555555555555555555555555555555555 18|555555555555555555555555555555555555555555555555555555555555 19|555555555555555555555555555555555555555555555555555555555555 -20|222222222222222222222222222222222222222222222222222222222222 +20|555555555555555555555555555555555555555555555555555555555555 +21|555555555555555555555555555555555555555555555555555555555555 +22|222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files index 559dfa6d..e8aacb1f 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files @@ -5,8 +5,8 @@ 04|│ c.gif ││ x = math.max(1, 2), │ 05|│ LICENSE ││ y = math.min(1, 2), │ 06|│ Makefile ││} │ -07|└─────────────────────────┘└─────────────────────────┘ -08|~ +07|│ top-secret │└─────────────────────────┘ +08|└─────────────────────────┘ 09|~ 10|~ 11|~ @@ -22,8 +22,8 @@ 04|088888888888888888888888880088:8889999;<<<;=;8=;;8888077777777777777777777777777 05|088888888888888888888888880088:8889999;<<<;=;8=;;8888077777777777777777777777777 06|08888888888888888888888888009888888888888888888888888077777777777777777777777777 -07|00000000000000000000000000000000000000000000000000000077777777777777777777777777 -08|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +07|08888888888888888888888888000000000000000000000000000077777777777777777777777777 +08|00000000000000000000000000077777777777777777777777777777777777777777777777777777 09|77777777777777777777777777777777777777777777777777777777777777777777777777777777 10|77777777777777777777777777777777777777777777777777777777777777777777777777777777 11|77777777777777777777777777777777777777777777777777777777777777777777777777777777 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-002 index 3fae3efe..4e7d0908 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-002 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-002 @@ -5,8 +5,8 @@ 04|│ c.gif ││Line 3 │ 05|│ LICENSE ││Line 4 │ 06|│ Makefile ││Line 5 │ -07|└─────────────────────────┘│Line 6 │ -08|~ │Line 7 │ +07|│ top-secret ││Line 6 │ +08|└─────────────────────────┘│Line 7 │ 09|~ │Line 8 │ 10|~ │Line 9 │ 11|~ │Line 10 │ @@ -22,8 +22,8 @@ 04|04444444444444444444444444004444444444444444444444444066666666666666666666666666 05|04444444444444444444444444004444444444444444444444444066666666666666666666666666 06|04444444444444444444444444004444444444444444444444444066666666666666666666666666 -07|00000000000000000000000000004444444444444444444444444066666666666666666666666666 -08|66666666666666666666666666604444444444444444444444444066666666666666666666666666 +07|04444444444444444444444444004444444444444444444444444066666666666666666666666666 +08|00000000000000000000000000004444444444444444444444444066666666666666666666666666 09|66666666666666666666666666604444444444444444444444444066666666666666666666666666 10|66666666666666666666666666604444444444444444444444444066666666666666666666666666 11|66666666666666666666666666604444444444444444444444444066666666666666666666666666 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-003 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-003 index e035bd48..5b3683a0 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-003 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-003 @@ -5,8 +5,8 @@ 04|│ c.gif │ 05|│ LICENSE │ 06|│ Makefile │ -07|└─────────────────────────┘ -08|~ +07|│ top-secret │ +08|└─────────────────────────┘ 09|~ 10|~ 11|~ @@ -22,8 +22,8 @@ 04|05555555555555555555555555066666666666666666666666666666666666666666666666666666 05|04444444444444444444444444066666666666666666666666666666666666666666666666666666 06|04444444444444444444444444066666666666666666666666666666666666666666666666666666 -07|00000000000000000000000000066666666666666666666666666666666666666666666666666666 -08|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +07|04444444444444444444444444066666666666666666666666666666666666666666666666666666 +08|00000000000000000000000000066666666666666666666666666666666666666666666666666666 09|66666666666666666666666666666666666666666666666666666666666666666666666666666666 10|66666666666666666666666666666666666666666666666666666666666666666666666666666666 11|66666666666666666666666666666666666666666666666666666666666666666666666666666666 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-004 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-004 index b25be3d3..36858854 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-004 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-004 @@ -5,8 +5,8 @@ 04|│ c.gif │ 05|│ LICENSE │ 06|│ Makefile │ -07|└─────────────────────────┘ -08|~ +07|│ top-secret │ +08|└─────────────────────────┘ 09|~ 10|~ 11|~ @@ -22,8 +22,8 @@ 04|04444444444444444444444444066666666666666666666666666666666666666666666666666666 05|05555555555555555555555555066666666666666666666666666666666666666666666666666666 06|04444444444444444444444444066666666666666666666666666666666666666666666666666666 -07|00000000000000000000000000066666666666666666666666666666666666666666666666666666 -08|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +07|04444444444444444444444444066666666666666666666666666666666666666666666666666666 +08|00000000000000000000000000066666666666666666666666666666666666666666666666666666 09|66666666666666666666666666666666666666666666666666666666666666666666666666666666 10|66666666666666666666666666666666666666666666666666666666666666666666666666666666 11|66666666666666666666666666666666666666666666666666666666666666666666666666666666 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-005 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-005 index a67c2b4f..381be518 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-005 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-005 @@ -5,8 +5,8 @@ 04|│ c.gif ││all: test │ 05|│ LICENSE │└─────────────────────────┘ 06|│ Makefile │ -07|└─────────────────────────┘ -08|~ +07|│ top-secret │ +08|└─────────────────────────┘ 09|~ 10|~ 11|~ @@ -22,8 +22,8 @@ 04|04444444444444444444444444008888444444444444444444444077777777777777777777777777 05|04444444444444444444444444000000000000000000000000000077777777777777777777777777 06|06666666666666666666666666077777777777777777777777777777777777777777777777777777 -07|00000000000000000000000000077777777777777777777777777777777777777777777777777777 -08|77777777777777777777777777777777777777777777777777777777777777777777777777777777 +07|04444444444444444444444444077777777777777777777777777777777777777777777777777777 +08|00000000000000000000000000077777777777777777777777777777777777777777777777777777 09|77777777777777777777777777777777777777777777777777777777777777777777777777777777 10|77777777777777777777777777777777777777777777777777777777777777777777777777777777 11|77777777777777777777777777777777777777777777777777777777777777777777777777777777 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-006 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-006 new file mode 100644 index 00000000..0adaebf0 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---Preview---works-for-files-006 @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|┌MOCK_ROOT/tests/dir-files┐┌top-secret───────────────┐ +02|│ a.lua ││-No-access---------------│ +03|│ b.txt │└─────────────────────────┘ +04|│ c.gif │ +05|│ LICENSE │ +06|│ Makefile │ +07|│ top-secret │ +08|└─────────────────────────┘ +09|~ +10|~ +11|~ +12|~ +13|~ +14|~ +15| 6,9-7 All + +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|01111111111111111111111111002222222222000000000000000033333333333333333333333333 +02|04444444444444444444444444005555555555555555555555555066666666666666666666666666 +03|04444444444444444444444444000000000000000000000000000066666666666666666666666666 +04|04444444444444444444444444066666666666666666666666666666666666666666666666666666 +05|04444444444444444444444444066666666666666666666666666666666666666666666666666666 +06|04444444444444444444444444066666666666666666666666666666666666666666666666666666 +07|05555555555555555555555555066666666666666666666666666666666666666666666666666666 +08|00000000000000000000000000066666666666666666666666666666666666666666666666666666 +09|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +10|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +11|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +12|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +13|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +14|66666666666666666666666666666666666666666666666666666666666666666666666666666666 +15|33333333333333333333333333333333333333333333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---go_in()---warns-about-paths-not-present-on-disk b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---go_in()---warns-about-paths-not-present-on-disk new file mode 100644 index 00000000..5bc8073a --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---go_in()---warns-about-paths-not-present-on-disk @@ -0,0 +1,33 @@ +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|┌MOCK_ROOT/tests/dir-files/common──────────────────┐ +02|│new-file │ +03|│ .a-dir │ +04|│ a-dir │ +05|│ b-dir │ +06|│ .a-file │ +07|│ a-file │ +08|│ A-file-2 │ +09|│ b-file │ +10|└──────────────────────────────────────────────────┘ +11|~ +12|~ +13|~ +14|~ +15| 2,10-8 All + +--|---------|---------|---------|---------|---------|---------|---------|---------| +01|01111111111111111111111111111111100000000000000000002222222222222222222222222222 +02|03333333333333333333333333333333333333333333333333304444444444444444444444444444 +03|05555555566666666666666666666666666666666666666666604444444444444444444444444444 +04|07777777333333333333333333333333333333333333333333304444444444444444444444444444 +05|07777777333333333333333333333333333333333333333333304444444444444444444444444444 +06|03333333333333333333333333333333333333333333333333304444444444444444444444444444 +07|03333333333333333333333333333333333333333333333333304444444444444444444444444444 +08|03333333333333333333333333333333333333333333333333304444444444444444444444444444 +09|03333333333333333333333333333333333333333333333333304444444444444444444444444444 +10|00000000000000000000000000000000000000000000000000004444444444444444444444444444 +11|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +12|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +13|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +14|44444444444444444444444444444444444444444444444444444444444444444444444444444444 +15|22222222222222222222222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider index f7e94729..c2262958 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider @@ -5,8 +5,8 @@ 04|│󰉋 nested ││󰵸 c.gif │ 05|│󰉋 real ││ LICENSE │ 06|│󰢱 init-default-explorer.lua ││󱁤 Makefile │ -07|│󰢱 mock-win-functions.lua │└───────────────┘ -08|└──────────────────────────────────────────────────┘ +07|│󰢱 mock-win-functions.lua ││󰈔 top-secret │ +08|└──────────────────────────────────────────────────┘└───────────────┘ 09|~ 10|~ 11|~ @@ -22,8 +22,8 @@ 04|04444444455555555555555555555555555555555555555555500445555555555555088888888888 05|06666667777777777777777777777777777777777777777777700::5555555555555088888888888 06|04455555555555555555555555555555555555555555555555500;;5555555555555088888888888 -07|04455555555555555555555555555555555555555555555555500000000000000000088888888888 -08|00000000000000000000000000000000000000000000000000008888888888888888888888888888 +07|04455555555555555555555555555555555555555555555555500;;5555555555555088888888888 +08|00000000000000000000000000000000000000000000000000000000000000000000088888888888 09|88888888888888888888888888888888888888888888888888888888888888888888888888888888 10|88888888888888888888888888888888888888888888888888888888888888888888888888888888 11|88888888888888888888888888888888888888888888888888888888888888888888888888888888 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider-002 index f7e94729..c2262958 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider-002 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider-002 @@ -5,8 +5,8 @@ 04|│󰉋 nested ││󰵸 c.gif │ 05|│󰉋 real ││ LICENSE │ 06|│󰢱 init-default-explorer.lua ││󱁤 Makefile │ -07|│󰢱 mock-win-functions.lua │└───────────────┘ -08|└──────────────────────────────────────────────────┘ +07|│󰢱 mock-win-functions.lua ││󰈔 top-secret │ +08|└──────────────────────────────────────────────────┘└───────────────┘ 09|~ 10|~ 11|~ @@ -22,8 +22,8 @@ 04|04444444455555555555555555555555555555555555555555500445555555555555088888888888 05|06666667777777777777777777777777777777777777777777700::5555555555555088888888888 06|04455555555555555555555555555555555555555555555555500;;5555555555555088888888888 -07|04455555555555555555555555555555555555555555555555500000000000000000088888888888 -08|00000000000000000000000000000000000000000000000000008888888888888888888888888888 +07|04455555555555555555555555555555555555555555555555500;;5555555555555088888888888 +08|00000000000000000000000000000000000000000000000000000000000000000000088888888888 09|88888888888888888888888888888888888888888888888888888888888888888888888888888888 10|88888888888888888888888888888888888888888888888888888888888888888888888888888888 11|88888888888888888888888888888888888888888888888888888888888888888888888888888888 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider-003 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider-003 index f7e9e3f9..75e638ad 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider-003 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---open()---uses-icon-provider-003 @@ -5,8 +5,8 @@ 04|│ nested ││ c.gif │ 05|│ real ││ LICENSE │ 06|│ init-default-explorer.lua ││ Makefile │ -07|│ mock-win-functions.lua │└───────────────┘ -08|└──────────────────────────────────────────────────┘ +07|│ mock-win-functions.lua ││ top-secret │ +08|└──────────────────────────────────────────────────┘└───────────────┘ 09|~ 10|~ 11|~ @@ -22,8 +22,8 @@ 04|04444444455555555555555555555555555555555555555555500555555555555555077777777777 05|08888886666666666666666666666666666666666666666666600555555555555555077777777777 06|05555555555555555555555555555555555555555555555555500555555555555555077777777777 -07|05555555555555555555555555555555555555555555555555500000000000000000077777777777 -08|00000000000000000000000000000000000000000000000000007777777777777777777777777777 +07|05555555555555555555555555555555555555555555555555500555555555555555077777777777 +08|00000000000000000000000000000000000000000000000000000000000000000000077777777777 09|77777777777777777777777777777777777777777777777777777777777777777777777777777777 10|77777777777777777777777777777777777777777777777777777777777777777777777777777777 11|77777777777777777777777777777777777777777777777777777777777777777777777777777777 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works new file mode 100644 index 00000000..21122e98 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works @@ -0,0 +1,27 @@ +--|---------|---------|---------| +01|┌…ts/dir-files/common┐ +02|│ .a-dir │ +03|│ a-dir │ +04|│ b-dir │ +05|│ .a-file │ +06|│ a-file │ +07|│ A-file-2 │ +08|│ b-file │ +09|└────────────────────┘ +10|~ +11|~ +12| 1,10-8 All + +--|---------|---------|---------| +01|011111111111111111111022222222 +02|033333333444444444444055555555 +03|066666667777777777777055555555 +04|066666667777777777777055555555 +05|077777777777777777777055555555 +06|077777777777777777777055555555 +07|077777777777777777777055555555 +08|077777777777777777777055555555 +09|000000000000000000000055555555 +10|555555555555555555555555555555 +11|555555555555555555555555555555 +12|222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-002 new file mode 100644 index 00000000..042560b8 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-002 @@ -0,0 +1,27 @@ +--|---------|---------|---------| +01|┌…-files/common/a-dir┐ +02|│ aa-dir │ +03|│ aa-file │ +04|│ ab-file │ +05|└────────────────────┘ +06|~ +07|~ +08|~ +09|~ +10|~ +11|~ +12| 1,10-8 All + +--|---------|---------|---------| +01|011111111111111111111022222222 +02|033333333444444444444055555555 +03|066666666666666666666055555555 +04|066666666666666666666055555555 +05|000000000000000000000055555555 +06|555555555555555555555555555555 +07|555555555555555555555555555555 +08|555555555555555555555555555555 +09|555555555555555555555555555555 +10|555555555555555555555555555555 +11|555555555555555555555555555555 +12|222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-003 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-003 new file mode 100644 index 00000000..5f9c845d --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-003 @@ -0,0 +1,27 @@ +--|---------|---------|---------|---------| +01|┌…es/common┐┌a-dir───────────────┐ +02|│ .a-dir ││ aa-dir │ +03|│ a-dir ││ aa-file │ +04|│ b-dir ││ ab-file │ +05|│ .a-file │└────────────────────┘ +06|│ a-file │ +07|│ A-file-2│ +08|│ b-file │ +09|└──────────┘ +10|~ +11|~ +12| 1,10-8 All + +--|---------|---------|---------|---------| +01|0111111111100222220000000000000000333333 +02|0444444445500666666667777777777770888888 +03|0666666677700555555555555555555550888888 +04|0444444455500555555555555555555550888888 +05|0555555555500000000000000000000000888888 +06|0555555555508888888888888888888888888888 +07|0555555555508888888888888888888888888888 +08|0555555555508888888888888888888888888888 +09|0000000000008888888888888888888888888888 +10|8888888888888888888888888888888888888888 +11|8888888888888888888888888888888888888888 +12|3333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-file-path-in-branch b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-file-path-in-branch new file mode 100644 index 00000000..24280acf --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-file-path-in-branch @@ -0,0 +1,27 @@ +--|---------|---------|---------|---------| +01|┌…ests/dir-files/real┐┌LICENSE───┐ +02|│ a.lua ││ │ +03|│ b.txt │└──────────┘ +04|│ c.gif │ +05|│ LICENSE │ +06|│ Makefile │ +07|│ top-secret │ +08|└────────────────────┘ +09|~ +10|~ +11|~ +12| 4,10-8 All + +--|---------|---------|---------|---------| +01|0111111111111111111110022222220000333333 +02|0444444444444444444440055555555550666666 +03|0444444444444444444440000000000000666666 +04|0444444444444444444440666666666666666666 +05|0555555555555555555550666666666666666666 +06|0444444444444444444440666666666666666666 +07|0444444444444444444440666666666666666666 +08|0000000000000000000000666666666666666666 +09|6666666666666666666666666666666666666666 +10|6666666666666666666666666666666666666666 +11|6666666666666666666666666666666666666666 +12|3333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-file-path-in-branch-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-file-path-in-branch-002 new file mode 100644 index 00000000..55bfdf07 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-file-path-in-branch-002 @@ -0,0 +1,27 @@ +--|---------|---------|---------|---------| +01|┌…ests/dir-files/real┐┌LICENSE────────┐ +02|│ a.lua ││ │ +03|│ b.txt │└───────────────┘ +04|│ c.gif │ +05|│ LICENSE │ +06|│ Makefile │ +07|│ top-secret │ +08|└────────────────────┘ +09|~ +10|~ +11|~ +12| 4,10-8 All + +--|---------|---------|---------|---------| +01|0111111111111111111110022222220000000003 +02|0444444444444444444440055555555555555506 +03|0444444444444444444440000000000000000006 +04|0444444444444444444440666666666666666666 +05|0555555555555555555550666666666666666666 +06|0444444444444444444440666666666666666666 +07|0444444444444444444440666666666666666666 +08|0000000000000000000000666666666666666666 +09|6666666666666666666666666666666666666666 +10|6666666666666666666666666666666666666666 +11|6666666666666666666666666666666666666666 +12|3333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-preview b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-preview new file mode 100644 index 00000000..051ef4f9 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---set_branch()---works-with-preview @@ -0,0 +1,27 @@ +--|---------|---------|---------|---------| +01|┌…ts/dir-files/common┐┌.a-dir─────────┐ +02|│ .a-dir ││ aa-file │ +03|│ a-dir ││ ab-file │ +04|│ b-dir │└───────────────┘ +05|│ .a-file │ +06|│ a-file │ +07|│ A-file-2 │ +08|│ b-file │ +09|└────────────────────┘ +10|~ +11|~ +12| 1,10-8 All + +--|---------|---------|---------|---------| +01|0111111111111111111110022222200000000003 +02|0444444445555555555550055555555555555506 +03|0777777788888888888880088888888888888806 +04|0777777788888888888880000000000000000006 +05|0888888888888888888880666666666666666666 +06|0888888888888888888880666666666666666666 +07|0888888888888888888880666666666666666666 +08|0888888888888888888880666666666666666666 +09|0000000000000000000000666666666666666666 +10|6666666666666666666666666666666666666666 +11|6666666666666666666666666666666666666666 +12|3333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---adjusts-window-width b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---adjusts-window-width index a87cd99e..2cc1f4b5 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---adjusts-window-width +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---adjusts-window-width @@ -8,17 +8,19 @@ 07|││Go in entry plus │ L │ │ 08|││Go out of directory │ h │ │ 09|└│Go out of directory plus │ H │────────────────┘ -10|~│Reset │ │ -11|~│Reveal cwd │ @ │ -12|~│Show Help │ g? │ -13|~│Synchronize │ = │ -14|~│Trim branch left │ < │ -15|~│Trim branch right │ > │ -16|~│ │ -17|~│(Press `q` to close) │ -18|~└────────────────────────────────┘ -19|~ -20| 1,1 All +10|~│Go to bookmark │ ' │ +11|~│Reset │ │ +12|~│Reveal cwd │ @ │ +13|~│Set bookmark │ m │ +14|~│Show Help │ g? │ +15|~│Synchronize │ = │ +16|~│Trim branch left │ < │ +17|~│Trim branch right │ > │ +18|~│ │ +19|~│(Press `q` to close) │ +20|~└────────────────────────────────┘ +21|~ +22| 1,1 All --|---------|---------|---------|---------|---------|---------| 01|011111111111111111111111111111111000000000000000000022222222 @@ -38,6 +40,8 @@ 15|506666666666666666666666666666666605555555555555555555555555 16|506666666666666666666666666666666605555555555555555555555555 17|506666666666666666666666666666666605555555555555555555555555 -18|500000000000000000000000000000000005555555555555555555555555 -19|555555555555555555555555555555555555555555555555555555555555 -20|222222222222222222222222222222222222222222222222222222222222 +18|506666666666666666666666666666666605555555555555555555555555 +19|506666666666666666666666666666666605555555555555555555555555 +20|500000000000000000000000000000000005555555555555555555555555 +21|555555555555555555555555555555555555555555555555555555555555 +22|222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-bookmarks b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-bookmarks new file mode 100644 index 00000000..6781bde1 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-bookmarks @@ -0,0 +1,63 @@ +--|---------|---------|---------|---------|---------|---------| +01|┌MOCK_ROOT/tests/dir-files/common──────────────────┐ +02|│┌'mini.files' help───────────────────┐ │ +03|││Buffer mappings: │ │ +04|││ │ │ +05|││Close │ q │ │ +06|││Go in entry │ l │ │ +07|││Go in entry plus │ L │ │ +08|││Go out of directory │ h │ │ +09|└│Go out of directory plus │ H │────────────┘ +10|~│Go to bookmark │ ' │ +11|~│Reset │ │ +12|~│Reveal cwd │ @ │ +13|~│Set bookmark │ m │ +14|~│Show Help │ g? │ +15|~│Synchronize │ = │ +16|~│Trim branch left │ < │ +17|~│Trim branch right │ > │ +18|~│ │ +19|~│Bookmarks: │ +20|~│ │ +21|~│a │ tests/dir-files │ +22|~│b │ Desc │ +23|~│c │ ~/ │ +24|~│d │ Cwd │ +25|~│e │ Should use these to adjust width│ +26|~│~ │ ~ │ +27|~│ │ +28|~│(Press `q` to close) │ +29|~└────────────────────────────────────┘ +30| 1,1 All + +--|---------|---------|---------|---------|---------|---------| +01|011111111111111111111111111111111000000000000000000022222222 +02|003333333333333333300000000000000000000444444444444055555555 +03|004444444444444444444444444444444444440666666666666055555555 +04|006666666666666666666666666666666666660666666666666055555555 +05|006666666666666666666666666666666666660666666666666055555555 +06|006666666666666666666666666666666666660666666666666055555555 +07|006666666666666666666666666666666666660666666666666055555555 +08|006666666666666666666666666666666666660666666666666055555555 +09|006666666666666666666666666666666666660000000000000055555555 +10|506666666666666666666666666666666666660555555555555555555555 +11|506666666666666666666666666666666666660555555555555555555555 +12|506666666666666666666666666666666666660555555555555555555555 +13|506666666666666666666666666666666666660555555555555555555555 +14|506666666666666666666666666666666666660555555555555555555555 +15|506666666666666666666666666666666666660555555555555555555555 +16|506666666666666666666666666666666666660555555555555555555555 +17|506666666666666666666666666666666666660555555555555555555555 +18|506666666666666666666666666666666666660555555555555555555555 +19|506666666666666666666666666666666666660555555555555555555555 +20|506666666666666666666666666666666666660555555555555555555555 +21|506666666666666666666666666666666666660555555555555555555555 +22|506666666666666666666666666666666666660555555555555555555555 +23|506666666666666666666666666666666666660555555555555555555555 +24|506666666666666666666666666666666666660555555555555555555555 +25|506666666666666666666666666666666666660555555555555555555555 +26|506666666666666666666666666666666666660555555555555555555555 +27|506666666666666666666666666666666666660555555555555555555555 +28|506666666666666666666666666666666666660555555555555555555555 +29|500000000000000000000000000000000000000555555555555555555555 +30|222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-mappings-without-description b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-mappings-without-description index 388eb587..811eebc0 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-mappings-without-description +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-mappings-without-description @@ -8,17 +8,19 @@ 07|││Go in entry plus │ L │ │ 08|││Go out of directory │ h │ │ 09|└│Go out of directory plus │ H │─────────────────┘ -10|~│Reset │ │ -11|~│Reveal cwd │ @ │ -12|~│Show Help │ g? │ -13|~│Synchronize │ = │ -14|~│Trim branch left │ < │ -15|~│Trim branch right │ > │ -16|~│ │ -17|~│(Press `q` to close) │ -18|~└───────────────────────────────┘ -19|~ -20| 1,1 All +10|~│Go to bookmark │ ' │ +11|~│Reset │ │ +12|~│Reveal cwd │ @ │ +13|~│Set bookmark │ m │ +14|~│Show Help │ g? │ +15|~│Synchronize │ = │ +16|~│Trim branch left │ < │ +17|~│Trim branch right │ > │ +18|~│ │ +19|~│(Press `q` to close) │ +20|~└───────────────────────────────┘ +21|~ +22| 1,1 All --|---------|---------|---------|---------|---------|---------| 01|011111111111111111111111111111111000000000000000000022222222 @@ -38,6 +40,8 @@ 15|506666666666666666666666666666666055555555555555555555555555 16|506666666666666666666666666666666055555555555555555555555555 17|506666666666666666666666666666666055555555555555555555555555 -18|500000000000000000000000000000000055555555555555555555555555 -19|555555555555555555555555555555555555555555555555555555555555 -20|222222222222222222222222222222222222222222222222222222222222 +18|506666666666666666666666666666666055555555555555555555555555 +19|506666666666666666666666666666666055555555555555555555555555 +20|500000000000000000000000000000000055555555555555555555555555 +21|555555555555555555555555555555555555555555555555555555555555 +22|222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-non-default-mappings b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-non-default-mappings index 6fe98adf..aab2d335 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-non-default-mappings +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---handles-non-default-mappings @@ -7,18 +7,20 @@ 06|││Go in entry plus │ l │ │ 07|││Go out of directory │ h │ │ 08|││Go out of directory plus │ H │ │ -09|└│Reset │ │─────────────────┘ -10|~│Reveal cwd │ @ │ -11|~│Show Help │ g? │ -12|~│Synchronize │ = │ -13|~│Trim branch left │ < │ -14|~│Trim branch right │ > │ -15|~│ │ -16|~│(Press `q` to close) │ -17|~└───────────────────────────────┘ -18|~ -19|~ -20| 1,1 All +09|└│Go to bookmark │ ' │─────────────────┘ +10|~│Reset │ │ +11|~│Reveal cwd │ @ │ +12|~│Set bookmark │ m │ +13|~│Show Help │ g? │ +14|~│Synchronize │ = │ +15|~│Trim branch left │ < │ +16|~│Trim branch right │ > │ +17|~│ │ +18|~│(Press `q` to close) │ +19|~└───────────────────────────────┘ +20|~ +21|~ +22| 1,1 All --|---------|---------|---------|---------|---------|---------| 01|011111111111111111111111111111111000000000000000000022222222 @@ -37,7 +39,9 @@ 14|506666666666666666666666666666666055555555555555555555555555 15|506666666666666666666666666666666055555555555555555555555555 16|506666666666666666666666666666666055555555555555555555555555 -17|500000000000000000000000000000000055555555555555555555555555 -18|555555555555555555555555555555555555555555555555555555555555 -19|555555555555555555555555555555555555555555555555555555555555 -20|222222222222222222222222222222222222222222222222222222222222 +17|506666666666666666666666666666666055555555555555555555555555 +18|506666666666666666666666666666666055555555555555555555555555 +19|500000000000000000000000000000000055555555555555555555555555 +20|555555555555555555555555555555555555555555555555555555555555 +21|555555555555555555555555555555555555555555555555555555555555 +22|222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---opens-relatively-current-window b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---opens-relatively-current-window index f540233e..1196e4bd 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---opens-relatively-current-window +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---opens-relatively-current-window @@ -8,17 +8,19 @@ 07|│ A-file-2 │ │Go in entry plus │ L │ 08|│ b-file │ │Go out of directory │ h │ 09|└───────────────┘ │Go out of directory plus │ H │ -10|~ │Reset │ │ -11|~ │Reveal cwd │ @ │ -12|~ │Show Help │ g? │ -13|~ │Synchronize │ = │ -14|~ │Trim branch left │ < │ -15|~ │Trim branch right │ > │ -16|~ │ │ -17|~ │(Press `q` to close) │ -18|~ └───────────────────────────────┘ -19|~ -20| 1,1 All +10|~ │Go to bookmark │ ' │ +11|~ │Reset │ │ +12|~ │Reveal cwd │ @ │ +13|~ │Set bookmark │ m │ +14|~ │Show Help │ g? │ +15|~ │Synchronize │ = │ +16|~ │Trim branch left │ < │ +17|~ │Trim branch right │ > │ +18|~ │ │ +19|~ │(Press `q` to close) │ +20|~ └───────────────────────────────┘ +21|~ +22| 1,1 All --|---------|---------|---------|---------|---------|---------| 01|011111111111111100222222000000000000000000000000033333333333 @@ -38,6 +40,8 @@ 15|666666666666666666088888888888888888888888888888880666666666 16|666666666666666666088888888888888888888888888888880666666666 17|666666666666666666088888888888888888888888888888880666666666 -18|666666666666666666000000000000000000000000000000000666666666 -19|666666666666666666666666666666666666666666666666666666666666 -20|333333333333333333333333333333333333333333333333333333333333 +18|666666666666666666088888888888888888888888888888880666666666 +19|666666666666666666088888888888888888888888888888880666666666 +20|666666666666666666000000000000000000000000000000000666666666 +21|666666666666666666666666666666666666666666666666666666666666 +22|333333333333333333333333333333333333333333333333333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---works b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---works index 14005f25..b8e71860 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---works +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---works @@ -8,17 +8,19 @@ 07|││Go in entry plus │ L │ │ 08|││Go out of directory │ h │ │ 09|└│Go out of directory plus │ H │─────────────────┘ -10|~│Reset │ │ -11|~│Reveal cwd │ @ │ -12|~│Show Help │ g? │ -13|~│Synchronize │ = │ -14|~│Trim branch left │ < │ -15|~│Trim branch right │ > │ -16|~│ │ -17|~│(Press `q` to close) │ -18|~└───────────────────────────────┘ -19|~ -20| 1,1 All +10|~│Go to bookmark │ ' │ +11|~│Reset │ │ +12|~│Reveal cwd │ @ │ +13|~│Set bookmark │ m │ +14|~│Show Help │ g? │ +15|~│Synchronize │ = │ +16|~│Trim branch left │ < │ +17|~│Trim branch right │ > │ +18|~│ │ +19|~│(Press `q` to close) │ +20|~└───────────────────────────────┘ +21|~ +22| 1,1 All --|---------|---------|---------|---------|---------|---------| 01|011111111111111111111111111111111000000000000000000022222222 @@ -38,6 +40,8 @@ 15|504444444444444444444444444444444055555555555555555555555555 16|504444444444444444444444444444444055555555555555555555555555 17|504444444444444444444444444444444055555555555555555555555555 -18|500000000000000000000000000000000055555555555555555555555555 -19|555555555555555555555555555555555555555555555555555555555555 -20|222222222222222222222222222222222222222222222222222222222222 +18|504444444444444444444444444444444055555555555555555555555555 +19|504444444444444444444444444444444055555555555555555555555555 +20|500000000000000000000000000000000055555555555555555555555555 +21|555555555555555555555555555555555555555555555555555555555555 +22|222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---works-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---works-002 index 50e1c567..e10dfa25 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---works-002 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_files.lua---show_help()---works-002 @@ -18,7 +18,9 @@ 17|~ 18|~ 19|~ -20| 3,9-7 All +20|~ +21|~ +22| 3,9-7 All --|---------|---------|---------|---------|---------|---------| 01|011111111111111111111111111111111000000000000000000022222222 @@ -40,4 +42,6 @@ 17|555555555555555555555555555555555555555555555555555555555555 18|555555555555555555555555555555555555555555555555555555555555 19|555555555555555555555555555555555555555555555555555555555555 -20|222222222222222222222222222222222222222222222222222222222222 +20|555555555555555555555555555555555555555555555555555555555555 +21|555555555555555555555555555555555555555555555555555555555555 +22|222222222222222222222222222222222222222222222222222222222222 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-explicit-paths b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-explicit-paths index ba2b76d2..732c504d 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-explicit-paths +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-explicit-paths @@ -2,9 +2,9 @@ 01| 02|~ 03|~ -04|~ -05|~ git-repo/ -06|~ mocks/ +04|~ git-repo/ +05|~ mocks/ +06|~ deps-confirm 07|~ diff-output 08|~ file 09|~ file1 @@ -19,8 +19,8 @@ 01|0000000000000000000000000000000000000000 02|1111111111111111111111111111111111111111 03|1111111111111111111111111111111111111111 -04|1111111111111111111111111111111111111111 -05|1111111111122222222222222221111111111111 +04|1111111111122222222222222221111111111111 +05|1111111111133333333333333331111111111111 06|1111111111133333333333333331111111111111 07|1111111111133333333333333331111111111111 08|1111111111133333333333333331111111111111 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-not-supported-command-003 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-not-supported-command-003 index 758f29a4..ac5edbd7 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-not-supported-command-003 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-not-supported-command-003 @@ -4,16 +4,16 @@ 03|~ 04|~ 05|~ -06|~ -07|~ git-repo/ -08|~ mocks/ -09|~ diff-output -10|~ file -11|~ file1 -12|~ File2 -13|~ file3 -14|~ help-output -15|~ log-output +06|~ git-repo/ +07|~ mocks/ +08|~ deps-confirm +09|~ diff-output +10|~ file +11|~ file1 +12|~ File2 +13|~ file3 +14|~ help-output +15|~ log-output 16|:Git doesnotexist -- git-repo/ 17| @@ -23,15 +23,15 @@ 03|11111111111111111111111111111111 04|11111111111111111111111111111111 05|11111111111111111111111111111111 -06|11111111111111111111111111111111 -07|11111111111111111111222222222222 -08|11111111111111111111333333333333 -09|11111111111111111111333333333333 -10|11111111111111111111333333333333 -11|11111111111111111111333333333333 -12|11111111111111111111333333333333 -13|11111111111111111111333333333333 -14|11111111111111111111333333333333 -15|11111111111111111111333333333333 +06|11111111111111111112222222222222 +07|11111111111111111113333333333333 +08|11111111111111111113333333333333 +09|11111111111111111113333333333333 +10|11111111111111111113333333333333 +11|11111111111111111113333333333333 +12|11111111111111111113333333333333 +13|11111111111111111113333333333333 +14|11111111111111111113333333333333 +15|11111111111111111113333333333333 16|44444444444444444444444444444444 17|44444444444444444444444444444444 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets index 777e94e5..73ede14b 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets @@ -2,16 +2,16 @@ 01| 02|~ 03|~ -04|~ -05|~ git-repo/ -06|~ mocks/ -07|~ diff-output -08|~ file -09|~ file1 -10|~ File2 -11|~ file3 -12|~ help-output -13|~ log-output +04|~ git-repo/ +05|~ mocks/ +06|~ deps-confirm +07|~ diff-output +08|~ file +09|~ file1 +10|~ File2 +11|~ file3 +12|~ help-output +13|~ log-output 14|:Git add git-repo/ 15| @@ -19,15 +19,15 @@ 01|00000000000000000000 02|11111111111111111111 03|11111111111111111111 -04|11111111111111111111 -05|11111111222222222222 -06|11111111333333333333 -07|11111111333333333333 -08|11111111333333333333 -09|11111111333333333333 -10|11111111333333333333 -11|11111111333333333333 -12|11111111333333333333 -13|11111111333333333333 +04|11111112222222222222 +05|11111113333333333333 +06|11111113333333333333 +07|11111113333333333333 +08|11111113333333333333 +09|11111113333333333333 +10|11111113333333333333 +11|11111113333333333333 +12|11111113333333333333 +13|11111113333333333333 14|44444444444444444444 15|44444444444444444444 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-002 index 08bd2d50..263a18dc 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-002 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-002 @@ -2,9 +2,9 @@ 01| 02|~ 03|~ -04|~ -05|~ git-repo/ -06|~ mocks/ +04|~ git-repo/ +05|~ mocks/ +06|~ deps-confirm 07|~ diff-output 08|~ file 09|~ file1 @@ -19,8 +19,8 @@ 01|00000000000000000000 02|11111111111111111111 03|11111111111111111111 -04|11111111111111111111 -05|11111112222222222222 +04|11111112222222222222 +05|11111113333333333333 06|11111113333333333333 07|11111113333333333333 08|11111113333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-003 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-003 index 1cd34217..09681f08 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-003 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-003 @@ -2,16 +2,16 @@ 01| 02|~ 03|~ -04|~ -05|~ git-repo/ -06|~ mocks/ -07|~ diff-output -08|~ file -09|~ file1 -10|~ File2 -11|~ file3 -12|~ help-output -13|~ log-output +04|~ git-repo/ +05|~ mocks/ +06|~ deps-confirm +07|~ diff-output +08|~ file +09|~ file1 +10|~ File2 +11|~ file3 +12|~ help-output +13|~ log-output 14|:Git restore git-rep 15|o/ @@ -19,15 +19,15 @@ 01|00000000000000000000 02|11111111111111111111 03|11111111111111111111 -04|11111111111111111111 -05|11111111222222222222 -06|11111111333333333333 -07|11111111333333333333 -08|11111111333333333333 -09|11111111333333333333 -10|11111111333333333333 -11|11111111333333333333 -12|11111111333333333333 -13|11111111333333333333 +04|11111112222222222222 +05|11111113333333333333 +06|11111113333333333333 +07|11111113333333333333 +08|11111113333333333333 +09|11111113333333333333 +10|11111113333333333333 +11|11111113333333333333 +12|11111113333333333333 +13|11111113333333333333 14|44444444444444444444 15|44444444444444444444 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-004 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-004 index ee3ec72c..cc47018b 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-004 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-004 @@ -2,9 +2,9 @@ 01| 02|~ 03|~ -04|~ -05|~ git-repo/ -06|~ mocks/ +04|~ git-repo/ +05|~ mocks/ +06|~ deps-confirm 07|~ diff-output 08|~ file 09|~ file1 @@ -19,8 +19,8 @@ 01|00000000000000000000 02|11111111111111111111 03|11111111111111111111 -04|11111111111111111111 -05|11111112222222222222 +04|11111112222222222222 +05|11111113333333333333 06|11111113333333333333 07|11111113333333333333 08|11111113333333333333 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-005 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-005 index 0d980bdd..c5391cff 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-005 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-005 @@ -2,16 +2,16 @@ 01| 02|~ 03|~ -04|~ -05|~ git-repo/ -06|~ mocks/ -07|~ diff-output -08|~ file -09|~ file1 -10|~ File2 -11|~ file3 -12|~ help-output -13|~ log-output +04|~ git-repo/ +05|~ mocks/ +06|~ deps-confirm +07|~ diff-output +08|~ file +09|~ file1 +10|~ File2 +11|~ file3 +12|~ help-output +13|~ log-output 14|:Git diff git-repo/ 15| @@ -19,15 +19,15 @@ 01|00000000000000000000 02|11111111111111111111 03|11111111111111111111 -04|11111111111111111111 -05|11111111222222222222 -06|11111111333333333333 -07|11111111333333333333 -08|11111111333333333333 -09|11111111333333333333 -10|11111111333333333333 -11|11111111333333333333 -12|11111111333333333333 -13|11111111333333333333 +04|11111112222222222222 +05|11111113333333333333 +06|11111113333333333333 +07|11111113333333333333 +08|11111113333333333333 +09|11111113333333333333 +10|11111113333333333333 +11|11111113333333333333 +12|11111113333333333333 +13|11111113333333333333 14|44444444444444444444 15|44444444444444444444 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-006 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-006 index bf3015b3..0a83ec04 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-006 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-006 @@ -2,16 +2,16 @@ 01| 02|~ 03|~ -04|~ -05|~ git-repo/ -06|~ mocks/ -07|~ diff-output -08|~ file -09|~ file1 -10|~ File2 -11|~ file3 -12|~ help-output -13|~ log-output +04|~ git-repo/ +05|~ mocks/ +06|~ deps-confirm +07|~ diff-output +08|~ file +09|~ file1 +10|~ File2 +11|~ file3 +12|~ help-output +13|~ log-output 14|:Git grep git-repo/ 15| @@ -19,15 +19,15 @@ 01|00000000000000000000 02|11111111111111111111 03|11111111111111111111 -04|11111111111111111111 -05|11111111222222222222 -06|11111111333333333333 -07|11111111333333333333 -08|11111111333333333333 -09|11111111333333333333 -10|11111111333333333333 -11|11111111333333333333 -12|11111111333333333333 -13|11111111333333333333 +04|11111112222222222222 +05|11111113333333333333 +06|11111113333333333333 +07|11111113333333333333 +08|11111113333333333333 +09|11111113333333333333 +10|11111113333333333333 +11|11111113333333333333 +12|11111113333333333333 +13|11111113333333333333 14|44444444444444444444 15|44444444444444444444 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-010 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-010 index 47864805..d3417aad 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-010 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_git.lua----Git---completion---works-with-subcommand-targets-010 @@ -2,16 +2,16 @@ 01| 02|~ 03|~ -04|~ -05|~ git-repo/ -06|~ mocks/ -07|~ diff-output -08|~ file -09|~ file1 -10|~ File2 -11|~ file3 -12|~ help-output -13|~ log-output +04|~ git-repo/ +05|~ mocks/ +06|~ deps-confirm +07|~ diff-output +08|~ file +09|~ file1 +10|~ File2 +11|~ file3 +12|~ help-output +13|~ log-output 14|:Git commit git-repo 15|/ @@ -19,15 +19,15 @@ 01|00000000000000000000 02|11111111111111111111 03|11111111111111111111 -04|11111111111111111111 -05|11111111222222222222 -06|11111111333333333333 -07|11111111333333333333 -08|11111111333333333333 -09|11111111333333333333 -10|11111111333333333333 -11|11111111333333333333 -12|11111111333333333333 -13|11111111333333333333 +04|11111112222222222222 +05|11111113333333333333 +06|11111113333333333333 +07|11111113333333333333 +08|11111113333333333333 +09|11111113333333333333 +10|11111113333333333333 +11|11111113333333333333 +12|11111113333333333333 +13|11111113333333333333 14|44444444444444444444 15|44444444444444444444 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_indentscope.lua---draw()---shows-symbols-on-wrapped-lines-without-overlapping-003 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_indentscope.lua---draw()---shows-symbols-on-wrapped-lines-without-overlapping-003 new file mode 100644 index 00000000..b9c19853 --- /dev/null +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_indentscope.lua---draw()---shows-symbols-on-wrapped-lines-without-overlapping-003 @@ -0,0 +1,23 @@ +--|---------|----- +01|aa +02|╎ aa +03|╎ a a a a a a a +04|x a a a a a a a +05|x a +06|╎ aa +07|aa +08|~ +09| abc▏──────────────────┐ -06|│ │ +05|┌pick/real-files/Makefile┐ +06|│-No-access- │ 07|│ │ 08|│ │ 09|│ │ @@ -12,7 +12,7 @@ 11|│ │ 12|│ │ 13|│ │ -14|└ ─────────────┘ +14|└ ────── 1|1|1 ┘ 15| --|---------|---------|---------|---------| @@ -20,7 +20,7 @@ 02|1111111111111111111111111111111111111111 03|1111111111111111111111111111111111111111 04|1111111111111111111111111111111111111111 -05|2333333222222222222222222211111111111111 +05|2333333333333333333333333211111111111111 06|2444444444444444444444444211111111111111 07|2555555555555555555555555211111111111111 08|2555555555555555555555555211111111111111 @@ -29,5 +29,5 @@ 11|2555555555555555555555555211111111111111 12|2555555555555555555555555211111111111111 13|2555555555555555555555555211111111111111 -14|2666666666662222222222222211111111111111 +14|2333333333332222223333333211111111111111 15|0000000000000000000000000000000000000000 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_pick.lua---default_preview()---works-without-active-picker b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_pick.lua---default_preview()---works-without-active-picker index 1e568951..af362db4 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_pick.lua---default_preview()---works-without-active-picker +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_pick.lua---default_preview()---works-without-active-picker @@ -13,7 +13,7 @@ 12|Line 12 13|Line 13 14|Line 14 -15| 0,0-1 All +15| --|---------|---------|---------|---------| 01|0000000000000000000000000000000000000000 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_pick.lua---default_preview()---works-without-active-picker-002 b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_pick.lua---default_preview()---works-without-active-picker-002 index 3f18f999..da2368fd 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_pick.lua---default_preview()---works-without-active-picker-002 +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/screenshots/tests-test_pick.lua---default_preview()---works-without-active-picker-002 @@ -13,7 +13,7 @@ 12|~ 13|~ 14|~ -15| 0,0-1 All +15| --|---------|---------|---------|---------| 01|0000000000000000000000000000000000000000 diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_ai.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_ai.lua index 3efc0c88..401e7dd9 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_ai.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_ai.lua @@ -14,8 +14,7 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end local get_latest_message = function() return child.cmd_capture('1messages') end @@ -52,6 +51,10 @@ local mock_treesitter_builtin = function() child.cmd('source tests/dir-ai/mock-l local mock_treesitter_plugin = function() child.cmd('set rtp+=tests/dir-ai') end +-- Time constants +local helper_message_delay = 1000 +local small_time = helpers.get_time_const(10) + -- Output test set local T = new_set({ hooks = { @@ -148,6 +151,7 @@ local validate_find = function(lines, cursor, args, expected) new_expected = { from = { line = expected[1][1], col = expected[1][2] }, to = { line = expected[2][1], col = expected[2][2] }, + vis_mode = expected.vis_mode, } end @@ -386,6 +390,20 @@ T['find_textobject()']['handles function as textobject spec']['returns array of child.lua([[MiniAi.config.n_lines = 10]]) child.lua([[MiniAi.config.search_method = 'cover']]) validate_find(lines, { 1, 4 }, { 'a', 'r' }, nil) + + -- Should account for region `vis_mode` + child.lua([[_G.line_regions = function(_, _, _) + return { + { from = { line = 1, col = 1 }, to = { line = 2, col = 1 }, vis_mode = 'V' }, + { from = { line = 3, col = 1 }, to = { line = 4, col = 1 }, vis_mode = 'V' }, + } + end]]) + child.lua([[MiniAi.config.custom_textobjects = { m = _G.line_regions }]]) + + local ref_region_1 = { { 1, 1 }, { 2, 1 }, vis_mode = 'V' } + validate_find({ 'aaa', 'bbb', 'ccc', 'ddd' }, { 1, 0 }, { 'a', 'm' }, ref_region_1) + local ref_region_2 = { { 3, 1 }, { 4, 1 }, vis_mode = 'V' } + validate_find({ 'aaa', 'bbb', 'ccc', 'ddd' }, { 3, 0 }, { 'a', 'm' }, ref_region_2) end T['find_textobject()']['handles function as specification item'] = function() @@ -1689,9 +1707,9 @@ T['Textobject']['prompts helper message after one idle second'] = new_set({ para -- Both mappings are applied only after `timeoutlen` milliseconds, because -- there are `an`/`in`/`al`/`il` mappings. - -- Wait 1000 seconds after that. - child.o.timeoutlen = 50 - local total_wait_time = 1000 + child.o.timeoutlen + -- Wait fixed time after that. + child.o.timeoutlen = 2 * small_time + local total_wait_time = helper_message_delay + child.o.timeoutlen + small_time set_lines({ '(aaa)' }) set_cursor(1, 1) @@ -1766,8 +1784,8 @@ T['Textobject']['respects `config.silent`'] = function() child.o.showcmd = false child.lua('MiniAi.config.silent = true') - child.o.timeoutlen = 50 - local total_wait_time = 1000 + child.o.timeoutlen + child.o.timeoutlen = 2 * small_time + local total_wait_time = helper_message_delay + child.o.timeoutlen + small_time set_lines({ '(aaa)' }) set_cursor(1, 1) @@ -3007,8 +3025,24 @@ T['Custom textobject']['handles function as textobject spec'] = function() child.lua([[MiniAi.config.search_method = 'next']]) validate_tobj(lines, { 2, 0 }, 'aL', { { 4, 1 }, { 4, 81 } }) - child.lua([[MiniAi.config.n_lines = 0]]) + child.lua('MiniAi.config.n_lines = 0') validate_no_tobj(lines, { 2, 0 }, 'aL') + + -- Function which returns region array with `vis_mode` set + child.lua([[MiniAi.config.search_method = 'cover']]) + child.lua('MiniAi.config.n_lines = 50') + child.lua([[_G.line_regions = function(_, _, _) + return { + { from = { line = 1, col = 1 }, to = { line = 2, col = 1 }, vis_mode = 'V' }, + { from = { line = 3, col = 1 }, to = { line = 4, col = 1 }, vis_mode = 'V' }, + } + end]]) + child.lua('MiniAi.config.custom_textobjects = { m = _G.line_regions }') + + set_lines({ 'aaa', 'bbb', 'ccc', 'ddd' }) + set_cursor(3, 0) + type_keys('d', 'a', 'm') + eq(get_lines(), { 'aaa', 'bbb' }) end T['Custom textobject']['handles function as specification item'] = function() diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_align.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_align.lua index cd3c4a13..a30f01be 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_align.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_align.lua @@ -13,8 +13,7 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end local set_config_steps = function(tbl) @@ -51,6 +50,10 @@ local eq_tostring = function(var_name1, var_name2) eq(child.lua_get(cmd), true) end +-- Time constants +local helper_message_delay, error_message_force_delay = 1000, 500 +local small_time = helpers.get_time_const(10) + -- Output test set local T = new_set({ hooks = { @@ -1318,7 +1321,7 @@ T['Align']['does not stop on error during modifier execution'] = function() local before_time = vim.loop.hrtime() type_keys('Vj', 'ga', 'e') local duration = 0.000001 * (vim.loop.hrtime() - before_time) - eq(500 <= duration and duration <= 510, true) + eq(error_message_force_delay <= duration and duration <= error_message_force_delay + 2 * small_time, true) expect.match(get_latest_message(), '^%(mini.align%) Modifier "e" should be properly callable%. Reason:') end @@ -1337,6 +1340,7 @@ T['Align']['prompts helper message after one idle second'] = new_set({ -- Check this only on Neovim>=0.10, as there is a slight change in -- highlighting command line area if child.fn.has('nvim-0.10') == 0 then return end + helpers.skip_if_slow() local expect_screenshot = function() child.expect_screenshot({ redraw = false }) end child.set_size(12, 20) @@ -1348,7 +1352,7 @@ T['Align']['prompts helper message after one idle second'] = new_set({ local keys = test_mode == 'Normal' and { 'ga', 'Vip' } or { 'Vip', 'ga' } type_keys(unpack(keys)) - sleep(1000 - 15) + sleep(helper_message_delay - small_time) -- Should show no message expect_screenshot() type_keys('j') @@ -1357,10 +1361,10 @@ T['Align']['prompts helper message after one idle second'] = new_set({ type_keys('r') -- Should show effect of hitting `r` and redraw if `showmode` is set (which -- it is by default) - sleep(1000 - 15) + sleep(helper_message_delay - small_time) -- Should still not show helper message expect_screenshot() - sleep(15 + 15) + sleep(small_time + small_time) -- Should now show helper message expect_screenshot() @@ -1381,7 +1385,7 @@ T['Align']['helper message does not cause hit-enter-prompt'] = function() set_cursor(1, 0) type_keys('ga', 'Vj') - sleep(1000) + sleep(helper_message_delay + small_time) child.expect_screenshot() end @@ -1456,7 +1460,7 @@ T['Align']['respects `config.silent`'] = function() set_cursor(1, 0) type_keys('Vip', 'ga') - sleep(1000 + 15) + sleep(helper_message_delay + small_time) child.expect_screenshot() end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_animate.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_animate.lua index 14c35d48..501af29e 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_animate.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_animate.lua @@ -12,8 +12,7 @@ local set_cursor = function(...) return child.set_cursor(...) end local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child, true) end --stylua: ignore end local get_virt_cursor = function() @@ -82,11 +81,6 @@ local create_openclose_test_winconfig = function() end -- Data ======================================================================= -local test_times = { total_timing = 250 } - -local step_time = 40 -local small_time = 5 - --stylua: ignore local example_scroll_lines = { 'aaaa', 'bbbb', 'cccc', 'dddd', 'eeee', @@ -101,12 +95,19 @@ local example_scroll_lines_2 = { 'KKKK', 'LLLL', 'MMMM', 'NNNN', 'OOOO', } +-- Time constants +local default_total_time = 250 +local step_time = helpers.get_time_const(40) +local small_time = helpers.get_time_const(10) + -- Output test set ============================================================ local T = new_set({ hooks = { pre_case = function() child.setup() load_module() + + child.lua('_G.step_time, _G.small_time = ' .. step_time .. ', ' .. small_time) end, post_once = child.stop, }, @@ -203,8 +204,8 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ close = { winblend = 'a' } }, 'close.winblend', 'callable') end -T['setup()']['defines non-linked default highlighting on `ColorScheme`'] = function() - child.cmd('colorscheme blue') +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') expect.match(child.cmd_capture('hi MiniAnimateCursor'), 'gui=reverse,nocombine') end @@ -219,9 +220,9 @@ T['is_active()']['works for `cursor`'] = function() set_cursor(1, 0) type_keys('2j') eq(is_active('cursor'), true) - sleep(test_times.total_timing - 20) + sleep(default_total_time - small_time) eq(is_active('cursor'), true) - sleep(20 + 10) + sleep(small_time + 3 * small_time) eq(is_active('cursor'), false) end @@ -232,9 +233,9 @@ T['is_active()']['works for `scroll`'] = function() set_cursor(1, 0) type_keys('') eq(is_active('scroll'), true) - sleep(test_times.total_timing - 20) + sleep(default_total_time - small_time) eq(is_active('scroll'), true) - sleep(20 + 10) + sleep(small_time + 3 * small_time) eq(is_active('scroll'), false) end @@ -243,9 +244,9 @@ T['is_active()']['works for `resize`'] = function() type_keys('v', '|') eq(is_active('resize'), true) - sleep(test_times.total_timing - 20) + sleep(default_total_time - small_time) eq(is_active('resize'), true) - sleep(20 + 20) + sleep(small_time + 3 * small_time) eq(is_active('resize'), false) end @@ -256,20 +257,20 @@ T['is_active()']['works for `open`/`close`'] = function() type_keys('v') eq(is_active('open'), true) eq(is_active('close'), false) - sleep(test_times.total_timing - 20) + sleep(default_total_time - small_time) eq(is_active('open'), true) eq(is_active('close'), false) - sleep(20 + 10) + sleep(small_time + 3 * small_time) eq(is_active('open'), false) eq(is_active('close'), false) child.cmd('quit') eq(is_active('open'), false) eq(is_active('close'), true) - sleep(test_times.total_timing - 20) + sleep(default_total_time - small_time) eq(is_active('open'), false) eq(is_active('close'), true) - sleep(20 + 10) + sleep(small_time + 3 * small_time) eq(is_active('open'), false) eq(is_active('close'), false) end @@ -296,9 +297,9 @@ T['execute_after()']['works after animation is done'] = function() type_keys('n') eq(child.g.been_here, vim.NIL) - sleep(test_times.total_timing - 20) + sleep(default_total_time - small_time) eq(child.g.been_here, vim.NIL) - sleep(20 + 10) + sleep(small_time + small_time) eq(child.g.been_here, true) end @@ -317,28 +318,28 @@ T['animate()'] = new_set() T['animate()']['works'] = function() child.lua('_G.action_history = {}') child.lua('_G.step_action = function(step) table.insert(_G.action_history, step); return step < 3 end') - child.lua('_G.step_timing = function(step) return 25 * step end') + child.lua('_G.step_timing = function(step) return _G.step_time * step end') child.lua([[MiniAnimate.animate(_G.step_action, _G.step_timing)]]) -- It should execute the following order: -- Action (step 0) - wait (step 1) - action (step 1) - ... - -- So here it should be: + -- So here it should be (with `step_time = 25`): -- 0 ms - `action(0)` -- 25(=`timing(1)`) ms - `action(1)` -- 75 ms - `action(2)` -- 150 ms - `action(3)` and stop eq(child.lua_get('_G.action_history'), { 0 }) - sleep(25 - small_time) + sleep(step_time - small_time) eq(child.lua_get('_G.action_history'), { 0 }) sleep(small_time) eq(child.lua_get('_G.action_history'), { 0, 1 }) - sleep(50 - small_time) + sleep(2 * step_time - small_time) eq(child.lua_get('_G.action_history'), { 0, 1 }) sleep(small_time) eq(child.lua_get('_G.action_history'), { 0, 1, 2 }) - sleep(75 - small_time) + sleep(3 * step_time - small_time) eq(child.lua_get('_G.action_history'), { 0, 1, 2 }) sleep(small_time) eq(child.lua_get('_G.action_history'), { 0, 1, 2, 3 }) @@ -346,8 +347,8 @@ end T['animate()']['respects `opts.max_steps`'] = function() child.lua('_G.step_action = function(step) _G.latest_step = step; return step < 1000 end') - child.lua('MiniAnimate.animate(_G.step_action, function() return 10 end, { max_steps = 2 })') - sleep(10 * 2 + 5) + child.lua('MiniAnimate.animate(_G.step_action, function() return _G.step_time end, { max_steps = 2 })') + sleep(step_time * 2 + small_time) eq(child.lua_get('_G.latest_step'), 2) end @@ -356,18 +357,20 @@ T['animate()']['handles step times less than 1 ms'] = function() child.lua('MiniAnimate.animate(_G.step_action, function() return 0.1 end)') -- All steps should be executed almost immediately (respectnig `libuv` loops) - poke_eventloop() - poke_eventloop() - poke_eventloop() + child.poke_eventloop() + child.poke_eventloop() + child.poke_eventloop() eq(child.lua_get('_G.latest_step'), 3) end T['animate()']['handles non-integer step times'] = function() + local new_step_time = 0.91 * step_time + child.lua('_G.new_step_time = ' .. new_step_time) -- It should accumulate fractional parts, not discard them child.lua('_G.step_action = function(step) _G.latest_step = step; return step < 10 end') - child.lua('MiniAnimate.animate(_G.step_action, function() return 1.9 end)') + child.lua('MiniAnimate.animate(_G.step_action, function() return _G.new_step_time end)') - sleep(19 - small_time) + sleep(10 * new_step_time - small_time) eq(child.lua_get('_G.latest_step') < 10, true) sleep(small_time + small_time) @@ -1263,7 +1266,7 @@ T['Cursor']['stops on buffer change'] = function() set_cursor(5, 0) child.expect_screenshot() - sleep(step_time + small_time) + sleep(step_time) child.expect_screenshot() sleep(step_time) child.expect_screenshot() @@ -1313,10 +1316,10 @@ T['Cursor']['correctly calls `timing`'] = function() child.lua('_G.args_history = {}') child.lua([[MiniAnimate.config.cursor.timing = function(s, n) table.insert(_G.args_history, { s = s, n = n }) - return 10 + return _G.step_time end]]) set_cursor(5, 0) - sleep(10 * 5) + sleep(step_time * 5 + small_time) eq(child.lua_get('_G.args_history'), { { s = 1, n = 4 }, { s = 2, n = 4 }, { s = 3, n = 4 }, { s = 4, n = 4 } }) end @@ -1811,14 +1814,14 @@ T['Scroll']["does not automatically animate result of 'incsearch'"] = function() -- Should work for search with `/` type_keys('/', 'oo', '') child.expect_screenshot() - sleep(step_time + 10) + sleep(step_time + small_time) -- Should be the same child.expect_screenshot() -- Should work for search with `?` type_keys('?', 'aa', '') child.expect_screenshot() - sleep(step_time + 10) + sleep(step_time + small_time) -- Should be the same child.expect_screenshot() end @@ -1867,7 +1870,7 @@ end T['Scroll']['works with different keys']['zb'] = function() type_keys('2') - sleep(step_time * 2 + 10) + sleep(step_time * 2 + small_time) set_cursor(6, 0) validate_topline(3) @@ -1927,7 +1930,8 @@ T['Scroll']['works with different keys']['G'] = function() sleep(step_time) validate_topline(3) - sleep(step_time * 6 + 2) + sleep(small_time) + sleep(step_time * 6) validate_topline(9) sleep(step_time) validate_topline(10) @@ -1948,11 +1952,11 @@ T['Scroll']['correctly calls `timing`'] = function() child.lua('_G.args_history = {}') child.lua([[MiniAnimate.config.scroll.timing = function(s, n) table.insert(_G.args_history, { s = s, n = n }) - return 10 + return _G.step_time end]]) type_keys('4') - sleep(10 * 4 + 5) + sleep(step_time * 4 + small_time) eq(child.lua_get('_G.args_history'), { { s = 1, n = 4 }, { s = 2, n = 4 }, { s = 3, n = 4 }, { s = 4, n = 4 } }) end @@ -2195,11 +2199,11 @@ T['Resize']['correctly calls `timing`'] = function() child.lua('_G.args_history = {}') child.lua([[MiniAnimate.config.resize.timing = function(s, n) table.insert(_G.args_history, { s = s, n = n }) - return 10 + return _G.step_time end]]) type_keys('|') - sleep(10 * 5 + 5) + sleep(step_time * 5 + small_time) eq( child.lua_get('_G.args_history'), { { s = 1, n = 5 }, { s = 2, n = 5 }, { s = 3, n = 5 }, { s = 4, n = 5 }, { s = 5, n = 5 } } @@ -2333,7 +2337,7 @@ T['Open']['works for a new tabpage'] = function() validate_floats({ [win_id] = { relative = 'editor', row = 1, col = 0, width = 12, height = 5, winblend = 80 }, }) - sleep(2 * 20) + sleep(2 * small_time) child.cmd('tabclose') -- Should also work second time (testing correct usage of tabpage number) @@ -2391,11 +2395,11 @@ T['Open']['correctly calls `timing`'] = function() child.lua('_G.args_history = {}') child.lua([[MiniAnimate.config.open.timing = function(s, n) table.insert(_G.args_history, { s = s, n = n }) - return 10 + return _G.step_time end]]) child.cmd('wincmd v') - sleep(10 * 2 + 5) + sleep(step_time * 2 + small_time) eq(child.lua_get('_G.args_history'), { { s = 1, n = 2 }, { s = 2, n = 2 } }) end @@ -2527,12 +2531,12 @@ T['Close']['correctly calls `timing`'] = function() child.lua('_G.args_history = {}') child.lua([[MiniAnimate.config.close.timing = function(s, n) table.insert(_G.args_history, { s = s, n = n }) - return 10 + return _G.step_time end]]) child.cmd('wincmd v') child.cmd('close') - sleep(10 * 2 + 5) + sleep(step_time * 2 + small_time) eq(child.lua_get('_G.args_history'), { { s = 1, n = 2 }, { s = 2, n = 2 } }) end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_bracketed.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_bracketed.lua index c427fc8f..89f1dae5 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_bracketed.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_bracketed.lua @@ -6,7 +6,7 @@ local new_set = MiniTest.new_set local path_sep = package.config:sub(1, 1) local project_root = vim.fn.fnamemodify(vim.fn.getcwd(), ':p') -local dir_bracketed_path = project_root .. 'tests/dir-bracketed/' +local dir_bracketed_path = project_root .. 'tests' .. path_sep .. 'dir-bracketed' -- Helpers with child processes --stylua: ignore start @@ -1219,7 +1219,7 @@ local validate_file = function(id_start, direction, id_ref, opts) end T['file()']['works'] = function() - eq(child.fn.getcwd() .. '/', project_root) + eq(child.fn.getcwd() .. path_sep, project_root) -- Should traverse files alphabetically in directory of currently opened file validate_works(validate_file, #test_files) @@ -2306,6 +2306,33 @@ T['treesitter()']['works'] = function() end end +T['treesitter()']['sets cursor safely'] = function() + child.lua([[ + if vim.fn.has('nvim-0.9') == 1 then + vim.treesitter.get_node = function() return _G.node end + else + vim.treesitter.get_node_at_pos = function() return _G.node end + end + ]]) + set_lines({ 'aaa' }) + + -- Before start + child.lua([[_G.node = { + start = function() return -1, 0 end, + end_ = function() return 1, 0 end, + range = function() return -1, 0, 1, 0 end, + parent = function() return _G.node end, + }]]) + + set_cursor(1, 1) + backward('treesitter') + eq(get_cursor(), { 1, 0 }) + + set_cursor(1, 1) + forward('treesitter') + eq(get_cursor(), { 1, 2 }) +end + T['treesitter()']['moves to other edge of current node'] = function() local nodes, validate, _ = setup_treesitter() local n = #nodes diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_clue.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_clue.lua index 2f74c506..37eaca3e 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_clue.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_clue.lua @@ -12,8 +12,7 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end local get_window = function() return child.api.nvim_get_current_win() end @@ -159,7 +158,9 @@ local mock_comment_operators = function() ]]) end --- Data ======================================================================= +-- Time constants +local default_delay, postkeys_check_delay, redraw_interval = 1000, 50, 50 +local small_time = helpers.get_time_const(10) -- Output test set ============================================================ local T = new_set({ @@ -234,6 +235,12 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ window = { scroll_up = 1 } }, 'window.scroll_up', 'string') end +T['setup()']['ensures colors'] = function() + load_module() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniClueBorder'), 'links to FloatBorder') +end + T['setup()']['creates mappings for `@` and `Q`'] = function() load_module() expect.match(child.lua_get("vim.fn.maparg('@', 'n', false, true).desc"), 'macro.*mini%.clue') @@ -1182,38 +1189,42 @@ end T['Showing keys'] = new_set({ hooks = { pre_case = function() child.set_size(10, 40) end } }) T['Showing keys']['works'] = function() + helpers.skip_if_slow() + make_test_map('n', 'aa') make_test_map('n', 'ab') load_module({ triggers = { { mode = 'n', keys = '' } } }) -- Window should be shown after debounced delay type_keys(' ') - sleep(980) + sleep(default_delay - small_time) child.expect_screenshot() type_keys('a') - sleep(980) + sleep(default_delay - small_time) child.expect_screenshot() - sleep(20 + 5) + sleep(small_time + small_time) child.expect_screenshot() end T['Showing keys']['respects `config.window.delay`'] = function() + helpers.skip_if_slow() + make_test_map('n', 'aa') make_test_map('n', 'ab') load_module({ triggers = { { mode = 'n', keys = '' } }, - window = { delay = 30 }, + window = { delay = 0.5 * default_delay }, }) type_keys(' ') - sleep(20) + sleep(0.5 * default_delay - small_time) child.expect_screenshot() type_keys('a') - sleep(20) + sleep(0.5 * default_delay - small_time) child.expect_screenshot() - sleep(10 + 5) + sleep(small_time + small_time) child.expect_screenshot() end @@ -1549,6 +1560,7 @@ T['Showing keys']['works with multibyte characters'] = function() type_keys(' ') child.expect_screenshot() + helpers.skip_on_windows('Windows has different collation order') type_keys('э') child.expect_screenshot() end @@ -1556,14 +1568,14 @@ end T['Showing keys']['works in Command-line window'] = function() make_test_map('n', 'f') load_module({ triggers = { { mode = 'n', keys = '' } }, window = { delay = 0 } }) - child.o.timeoutlen = 5 + child.o.timeoutlen = small_time type_keys('q:') type_keys(' ') child.expect_screenshot() - sleep(5 + 5) + sleep(small_time + small_time) type_keys('f') -- Closing floating window is allowed only on Neovim>=0.10. @@ -1922,8 +1934,7 @@ T['Postkeys']['closes window if postkeys do not end up key querying'] = function }) type_keys(' ', 'a') - -- 50 ms is a hardcoded check delay - sleep(50 + 5) + sleep(postkeys_check_delay + small_time) child.expect_screenshot() end @@ -1981,11 +1992,11 @@ T['Querying keys']['does not entirely block redraws'] = function() type_keys('', 'f') -- - Redraws don't happen immediately but inside a repeating timer - sleep(50 + 5) + sleep(redraw_interval + small_time) child.expect_screenshot() type_keys('f') - sleep(50 + 5) + sleep(redraw_interval + small_time) child.expect_screenshot() end @@ -2007,9 +2018,9 @@ T['Querying keys']["does not time out after 'timeoutlen'"] = function() load_module({ triggers = { { mode = 'n', keys = '' } } }) -- Should wait for next key as there are still multiple clues available - child.o.timeoutlen = 10 + child.o.timeoutlen = small_time type_keys(' ', 'f') - sleep(20) + sleep(2 * small_time) eq(get_test_map_count('n', ' f'), 0) end @@ -2037,9 +2048,9 @@ T['Querying keys']['respects ``'] = function() validate_trigger_keymap('n', '') -- `` should execute current query - child.o.timeoutlen = 10 + child.o.timeoutlen = small_time type_keys(' ', 'f', '') - sleep(15) + sleep(small_time + small_time) eq(get_test_map_count('n', ' f'), 1) end @@ -2109,9 +2120,9 @@ T['Querying keys']['allows reaching longest keymap'] = function() load_module({ triggers = { { mode = 'n', keys = '' } } }) validate_trigger_keymap('n', '') - child.o.timeoutlen = 5 + child.o.timeoutlen = small_time type_keys(' ', 'f', 'f') - sleep(10) + sleep(small_time + small_time) type_keys('f') eq(get_test_map_count('n', ' f'), 0) eq(get_test_map_count('n', ' fff'), 1) @@ -2841,7 +2852,7 @@ T['Reproducing keys']['works for builtin keymaps in Terminal mode'] = function() child.cmd('wincmd v') child.cmd('terminal') -- Wait for terminal to load - vim.loop.sleep(100) + vim.loop.sleep(6 * small_time) child.cmd('startinsert') eq(child.fn.mode(), 't') @@ -2860,7 +2871,7 @@ T['Reproducing keys']['works for user keymaps in Terminal mode'] = function() child.cmd('wincmd v') child.cmd('terminal') -- Wait for terminal to load - vim.loop.sleep(100) + vim.loop.sleep(6 * small_time) child.cmd('startinsert') eq(child.fn.mode(), 't') diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_colors.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_colors.lua index 5a2d5266..582a5671 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_colors.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_colors.lua @@ -12,16 +12,15 @@ local colors_path = dir_path .. '/colors/' local load_module = function(config) child.mini_load('colors', config) end local unload_module = function(config) child.mini_unload('colors', config) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end -- Mock test color scheme local mock_cs = function() child.cmd('set rtp+=' .. dir_path .. 'mock_cs/') end --- Data ======================================================================= --- Small time used to reduce test flackiness -local small_time = 15 +-- Time constants +local default_transition_duration, default_show_duration = 1000, 1000 +local small_time = helpers.get_time_const(10) -- Output test set ============================================================ local T = new_set({ @@ -1313,7 +1312,7 @@ end T['as_colorscheme() methods']['write()'] = new_set({ hooks = { pre_case = function() - local lua_cmd = string.format([[vim.fn.stdpath = function() return '%s' end]], dir_path) + local lua_cmd = string.format([[vim.fn.stdpath = function() return %s end]], vim.inspect(dir_path)) child.lua(lua_cmd) -- Add to `rtp` to be able to discrove color schemes @@ -1381,7 +1380,9 @@ T['as_colorscheme() methods']['write()']['makes unique color scheme name'] = fun local files = child.fn.readdir(colors_path) eq(#files, 1) - -- File name should add timestamp suffix in case of duplicated name + -- File name should add timestamp suffix in case of duplicated name, but + -- doesn't work on Windows + helpers.skip_on_windows('`vim.fn.strftime()` does not work on Windows') expect.match(files[1], 'mock_cs_%d%d%d%d%d%d%d%d_%d%d%d%d%d%d%.lua') end @@ -1432,7 +1433,7 @@ T['as_colorscheme() methods']['write()']['respects `opts.directory`'] = function groups = { Normal = { fg = '#ffffff' } } })]]) - local write_cmd = string.format([[_G.cs:write({ directory = '%s' })]], inner_dir) + local write_cmd = '_G.cs:write({ directory = ' .. vim.inspect(inner_dir) .. ' })' child.lua(write_cmd) eq(child.fn.filereadable(inner_dir .. 'my_cs.lua'), 1) @@ -1609,6 +1610,10 @@ T['animate()'] = new_set({ } } end]]) + + -- Create reference duration values + child.lua('_G.default_transition_duration = ' .. default_transition_duration) + child.lua('_G.default_show_duration = ' .. default_show_duration) end, }, }) @@ -1629,6 +1634,8 @@ end --stylua: ignore T['animate()']['works'] = function() + helpers.skip_if_slow() + local validate_init = function() local cur_cs = child.lua_get('_G.get_relevant_cs_data()') eq(cur_cs.name, 'cs_1') @@ -1676,7 +1683,7 @@ T['animate()']['works'] = function() ) end - sleep(500 - small_time) + sleep(0.5 * default_transition_duration - small_time) validate_before_half() -- Check slightly after half-way @@ -1708,7 +1715,7 @@ T['animate()']['works'] = function() ) end - sleep(2 * small_time) + sleep(3 * small_time) validate_after_half() -- After first transition end it should show intermediate step for 1 second @@ -1723,56 +1730,60 @@ T['animate()']['works'] = function() eq(child.g.terminal_color_15, '#000000') end - sleep(500) + sleep(0.5 * default_transition_duration) validate_intermediate() - sleep(1000 - 2 * small_time) + sleep(default_show_duration - 3 * small_time) validate_intermediate() -- After showing period it should start transition back to first one (as it -- was specially designed command) - sleep(500) + sleep(0.5 * default_transition_duration) validate_after_half() - sleep(2 * small_time) + sleep(3 * small_time) validate_before_half() - sleep(500 - small_time) + sleep(0.5 * default_transition_duration) validate_init() end T['animate()']['respects `opts.transition_steps`'] = function() + helpers.skip_if_slow() + child.lua('_G.cs_1:apply()') child.lua([[MiniColors.animate({ _G.cs_2 }, { transition_steps = 2 })]]) - sleep(500 - small_time - 10) + sleep(0.5 * default_transition_duration - 2 * small_time) eq(is_cs_1(), true) - sleep(2 * small_time + 10) + sleep(2 * small_time + small_time) eq(child.lua_get('_G.get_relevant_cs_data().groups.Normal.fg'), '#050000') - sleep(500 - small_time) + sleep(0.5 * default_transition_duration - small_time) eq(is_cs_2(), true) end T['animate()']['respects `opts.transition_duration`'] = function() - child.lua([[MiniColors.animate({ _G.cs_2 }, { transition_duration = 500 })]]) + helpers.skip_if_slow() - sleep(500 + small_time) + child.lua([[MiniColors.animate({ _G.cs_2 }, { transition_duration = 0.5 * default_transition_duration })]]) + sleep(0.5 * default_transition_duration + 2 * small_time) eq(is_cs_2(), true) end T['animate()']['respects `opts.show_duration`'] = function() - child.lua([[MiniColors.animate({ _G.cs_1, _G.cs_2 }, { show_duration = 100 })]]) + helpers.skip_if_slow() - sleep(1000 + small_time) + child.lua([[MiniColors.animate({ _G.cs_1, _G.cs_2 }, { show_duration = 0.5 * default_show_duration })]]) + sleep(default_transition_duration + small_time) eq(is_cs_1(), true) - sleep(100 - 2 * small_time) + sleep(0.5 * default_show_duration - 3 * small_time) eq(is_cs_1(), true) - -- Account that first step takes 40 ms - sleep(small_time + 40 + 10) + -- Account that first step takes some time + sleep(3 * small_time + 2 * small_time) eq(is_cs_1(), false) end @@ -2205,22 +2216,24 @@ T[':Colorscheme']['works'] = function() child.cmd('hi Normal guifg=#ffffff') type_keys(':Colorscheme mock_cs') - sleep(1000 + small_time) + sleep(default_transition_duration + 3 * small_time) expect.match(child.cmd_capture('hi Normal'), 'guifg=#5f87af') end T[':Colorscheme']['accepts several arguments'] = function() + helpers.skip_if_slow() + child.cmd('colorscheme blue') mock_cs() type_keys(':Colorscheme mock_cs blue') - sleep(1000 + small_time) + sleep(default_transition_duration + small_time) expect.match(child.cmd_capture('hi Normal'), 'guifg=#5f87af') - sleep(1000 - 2 * small_time) + sleep(default_show_duration - 2 * small_time) expect.match(child.cmd_capture('hi Normal'), 'guifg=#5f87af') - sleep(1000 + 2 * small_time) + sleep(default_transition_duration + 2 * small_time) local blue_normal_fg = '#ffd700' expect.match(child.cmd_capture('hi Normal'), 'guifg=' .. blue_normal_fg) end @@ -2236,7 +2249,7 @@ T['interactive()'] = new_set() T['interactive()']['works'] = function() -- - Mock '~/.config/nvim' - local lua_cmd = string.format([[vim.fn.stdpath = function() return '%s' end]], dir_path) + local lua_cmd = 'vim.fn.stdpath = function() return ' .. vim.inspect(dir_path) .. ' end' child.lua(lua_cmd) child.cmd('set rtp+=' .. dir_path) MiniTest.finally(function() vim.fn.delete(colors_path, 'rf') end) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_completion.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_completion.lua index de88ce4f..dcc0d740 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_completion.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_completion.lua @@ -16,12 +16,20 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child, true) end local mock_lsp = function() child.cmd('luafile tests/dir-completion/mock-months-lsp.lua') end local new_buffer = function() child.api.nvim_set_current_buf(child.api.nvim_create_buf(true, false)) end --stylua: ignore end +local mock_miniicons = function() + child.lua([[ + require('mini.icons').setup() + local _, hl_text = MiniIcons.get('lsp', 'Text') + local _, hl_function = MiniIcons.get('lsp', 'Function') + _G.ref_hlgroup = { text = hl_text, func = hl_function} + ]]) +end + -- NOTE: this can't show "what filtered text is actually shown in window". -- Seems to be because information for `complete_info()` --- is updated in the very last minute (probably, by UI). This means that the @@ -64,8 +72,9 @@ local validate_single_floating_win = function(opts) end end --- Data ======================================================================= -local test_times = { completion = 100, info = 100, signature = 50 } +-- Time constants +local default_completion_delay, default_info_delay, default_signature_delay = 100, 100, 50 +local small_time = helpers.get_time_const(10) -- Output test set ============================================================ local T = new_set({ @@ -160,6 +169,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ set_vim_settings = 1 }, 'set_vim_settings', 'boolean') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniCompletionActiveParameter'), 'gui=underline') +end + T['setup()']['properly handles `config.mappings`'] = function() local has_map = function(lhs, pattern) return child.cmd_capture('imap ' .. lhs):find(pattern) ~= nil end eq(has_map('', 'Complete'), true) @@ -187,8 +201,8 @@ T['setup()']['uses `config.lsp_completion`'] = function() completefunc = source_func == 'completefunc' and val or '' end - eq(child.api.nvim_buf_get_option(0, 'omnifunc'), omnifunc) - eq(child.api.nvim_buf_get_option(0, 'completefunc'), completefunc) + eq(child.bo.omnifunc, omnifunc) + eq(child.bo.completefunc, completefunc) end validate(false) @@ -203,9 +217,61 @@ T['setup()']['respects `config.set_vim_settings`'] = function() eq(child.api.nvim_get_option('completeopt'), 'menuone,noinsert,noselect') end -T['setup()']['defines non-linked default highlighting on `ColorScheme`'] = function() - child.cmd('colorscheme blue') - expect.match(child.cmd_capture('hi MiniCompletionActiveParameter'), 'gui=underline') +T['default_process_items()'] = new_set({ + hooks = { + pre_case = function() + -- Mock LSP items + child.lua([[ + _G.items = { + { kind = 1, label = "January", sortText = "001" }, + { kind = 2, label = "May", sortText = "005" }, + { kind = 2, label = "March", sortText = "003" }, + { kind = 2, label = "April", sortText = "004" }, + { kind = 1, label = "February", sortText = "002" }, + -- Unknown kind + { kind = 100, label = "July", sortText = "007" }, + { kind = 3, label = "June", sortText = "006" }, + } + ]]) + end, + }, +}) + +T['default_process_items()']['works'] = function() + local ref_processed_items = { + { kind = 2, label = 'March', sortText = '003' }, + { kind = 2, label = 'May', sortText = '005' }, + } + eq(child.lua_get('MiniCompletion.default_process_items(_G.items, "M")'), ref_processed_items) +end + +T['default_process_items()']["highlights LSP kind if 'mini.icons' is enabled"] = function() + mock_miniicons() + local ref_hlgroup = child.lua_get('_G.ref_hlgroup') + local ref_processed_items = { + { kind = 1, kind_hlgroup = ref_hlgroup.text, label = 'January', sortText = '001' }, + { kind = 3, kind_hlgroup = ref_hlgroup.func, label = 'June', sortText = '006' }, + -- Unknown kind should not get highlighted + { kind = 100, kind_hlgroup = nil, label = 'July', sortText = '007' }, + } + eq(child.lua_get('MiniCompletion.default_process_items(_G.items, "J")'), ref_processed_items) + + -- Should not modify original items + eq(child.lua_get('_G.items[1].kind_hlgroup'), vim.NIL) +end + +T['default_process_items()']['works after `MiniIcons.tweak_lsp_kind()`'] = function() + mock_miniicons() + child.lua('MiniIcons.tweak_lsp_kind()') + + local ref_hlgroup = child.lua_get('_G.ref_hlgroup') + local ref_processed_items = { + { kind = 1, kind_hlgroup = ref_hlgroup.text, label = 'January', sortText = '001' }, + { kind = 3, kind_hlgroup = ref_hlgroup.func, label = 'June', sortText = '006' }, + -- Unknown kind should not get highlighted + { kind = 100, kind_hlgroup = nil, label = 'July', sortText = '007' }, + } + eq(child.lua_get('MiniCompletion.default_process_items(_G.items, "J")'), ref_processed_items) end -- Integration tests ========================================================== @@ -225,9 +291,9 @@ T['Autocompletion']['works with LSP client'] = function() eq(get_completion(), {}) -- Shows completion only after delay - sleep(test_times.completion - 10) + sleep(default_completion_delay - small_time) eq(get_completion(), {}) - sleep(10) + sleep(small_time + small_time) -- Both completion word and kind are shown eq(get_completion(), { 'January', 'June', 'July' }) eq(get_completion('kind'), { 'Text', 'Function', 'Function' }) @@ -245,9 +311,9 @@ T['Autocompletion']['works without LSP clients'] = function() type_keys('i', 'aab aac aba a') eq(get_completion(), {}) - sleep(test_times.completion - 10) + sleep(default_completion_delay - small_time) eq(get_completion(), {}) - sleep(10) + sleep(small_time + small_time) eq(get_completion(), { 'aab', 'aac', 'aba' }) -- Completion menu is filtered after entering characters @@ -259,12 +325,12 @@ end T['Autocompletion']['implements debounce-style delay'] = function() type_keys('i', 'J') - sleep(test_times.completion - 10) + sleep(default_completion_delay - small_time) eq(get_completion(), {}) type_keys('u') - sleep(test_times.completion - 10) + sleep(default_completion_delay - small_time) eq(get_completion(), {}) - sleep(10) + sleep(small_time + small_time) eq(get_completion(), { 'June', 'July' }) end @@ -273,7 +339,7 @@ T['Autocompletion']['uses fallback'] = function() set_cursor(2, 0) type_keys('i', 'Ja') - sleep(test_times.completion + 1) + sleep(default_completion_delay + small_time) eq(get_completion(), { 'January' }) -- Due to how 'completefunc' and 'omnifunc' currently work, fallback won't @@ -312,9 +378,9 @@ T['Autocompletion']['forces new LSP completion at LSP trigger'] = new_set( type_keys('May.') eq(child.fn.pumvisible(), 0) - sleep(test_times.completion - 10) + sleep(default_completion_delay - small_time) eq(child.fn.pumvisible(), 0) - sleep(10 + 10) + sleep(small_time + small_time) eq(get_completion(), all_months) child.expect_screenshot() @@ -322,30 +388,30 @@ T['Autocompletion']['forces new LSP completion at LSP trigger'] = new_set( -- show no completion if there is no LSP completion (as is imitated -- inside commented lines). type_keys('o', '# .') - sleep(test_times.completion + 10) + sleep(default_completion_delay + small_time) child.expect_screenshot() end, } ) T['Autocompletion']['respects `config.delay.completion`'] = function() - child.lua('MiniCompletion.config.delay.completion = 300') + child.lua('MiniCompletion.config.delay.completion = ' .. (2 * default_completion_delay)) type_keys('i', 'J') - sleep(300 - 10) + sleep(2 * default_completion_delay - small_time) eq(get_completion(), {}) - sleep(10) + sleep(small_time + small_time) eq(get_completion(), { 'January', 'June', 'July' }) -- Should also use buffer local config child.ensure_normal_mode() set_lines({ '' }) set_cursor(1, 0) - child.b.minicompletion_config = { delay = { completion = 50 } } + child.b.minicompletion_config = { delay = { completion = default_completion_delay } } type_keys('i', 'J') - sleep(50 - 10) + sleep(default_completion_delay - small_time) eq(get_completion(), {}) - sleep(10) + sleep(small_time + small_time) eq(get_completion(), { 'January', 'June', 'July' }) end @@ -354,7 +420,7 @@ T['Autocompletion']['respects `config.lsp_completion.process_items`'] = function child.lua('MiniCompletion.config.lsp_completion.process_items = _G.process_items') type_keys('i', 'J') - sleep(test_times.completion + 1) + sleep(default_completion_delay + small_time) eq(get_completion(), { 'February', 'March' }) child.ensure_normal_mode() @@ -364,7 +430,7 @@ T['Autocompletion']['respects `config.lsp_completion.process_items`'] = function child.lua('vim.b.minicompletion_config = { lsp_completion = { process_items = _G.process_items_2 } }') type_keys('i', 'J') - sleep(test_times.completion + 1) + sleep(default_completion_delay + small_time) eq(get_completion(), { 'April', 'May' }) end @@ -375,7 +441,7 @@ T['Autocompletion']['respects string `config.fallback_action`'] = function() set_lines({ 'Line number 1', '' }) set_cursor(2, 0) type_keys('i', 'L') - sleep(test_times.completion + 1) + sleep(default_completion_delay + small_time) child.expect_screenshot() -- Should also use buffer local config @@ -384,20 +450,20 @@ T['Autocompletion']['respects string `config.fallback_action`'] = function() set_lines({ 'Line number 1', '' }) set_cursor(2, 0) type_keys('i', 'L') - sleep(test_times.completion + 1) + sleep(default_completion_delay + small_time) child.expect_screenshot() end T['Autocompletion']['respects function `config.fallback_action`'] = function() child.lua([[MiniCompletion.config.fallback_action = function() _G.inside_fallback = true end]]) type_keys('i', 'a') - sleep(test_times.completion + 1) + sleep(default_completion_delay + small_time) eq(child.lua_get('_G.inside_fallback'), true) child.ensure_normal_mode() child.lua('vim.b.minicompletion_config = { fallback_action = function() _G.inside_local_fallback = true end }') type_keys('i', 'a') - sleep(test_times.completion + 1) + sleep(default_completion_delay + small_time) eq(child.lua_get('_G.inside_local_fallback'), true) end @@ -407,7 +473,7 @@ T['Autocompletion']['respects `vim.{g,b}.minicompletion_disable`'] = new_set({ test = function(var_type) child[var_type].minicompletion_disable = true type_keys('i', 'J') - sleep(test_times.completion + 1) + sleep(default_completion_delay + small_time) eq(get_completion(), {}) end, }) @@ -471,7 +537,7 @@ T['Manual completion']['applies `additionalTextEdits` from "textDocument/complet child.ensure_normal_mode() set_lines({}) type_keys('i', 'Se', '') - poke_eventloop() + child.poke_eventloop() type_keys('', confirm_key) eq(child.fn.mode(), 'i') @@ -495,10 +561,10 @@ T['Manual completion']['applies `additionalTextEdits` from "completionItem/resol child.ensure_normal_mode() set_lines({}) type_keys('i', word_start, '') - poke_eventloop() + child.poke_eventloop() type_keys('') -- Wait until `completionItem/resolve` request is sent - sleep(test_times.info + 1) + sleep(default_info_delay + small_time) type_keys('') eq(child.fn.mode(), 'i') @@ -517,7 +583,7 @@ T['Manual completion']['applies `additionalTextEdits` from "completionItem/resol child.ensure_normal_mode() set_lines({}) type_keys('i', 'Ja', '') - poke_eventloop() + child.poke_eventloop() type_keys('', '') eq(get_lines(), { 'January' }) end @@ -560,17 +626,37 @@ T['Manual completion']['respects `filterText` from LSP response'] = function() eq(get_cursor(), { 1, 13 }) end +T['Manual completion']['respects `kind_hlgroup` as item field'] = function() + if child.fn.has('nvim-0.11') == 0 then MiniTest.skip('Kind highlighting is available on Neovim>=0.11') end + child.set_size(10, 40) + set_lines({}) + + child.lua([[ + MiniCompletion.config.lsp_completion.process_items = function(items, base) + local res = vim.tbl_filter(function(x) return vim.startswith(x.label, base) end, items) + table.sort(res, function(a, b) return a.sortText < b.sortText end) + for _, item in ipairs(res) do + if item.label == 'January' then item.kind_hlgroup = 'String' end + if item.label == 'June' then item.kind_hlgroup = 'Comment' end + end + return res + end + ]]) + type_keys('i', 'J', '') + child.expect_screenshot() +end + T['Manual completion']['respects `vim.{g,b}.minicompletion_disable`'] = new_set({ parametrize = { { 'g' }, { 'b' } }, }, { test = function(var_type) child[var_type].minicompletion_disable = true type_keys('i', '') - poke_eventloop() + child.poke_eventloop() eq(get_completion(), {}) type_keys('i', '') - poke_eventloop() + child.poke_eventloop() eq(get_completion(), {}) end, }) @@ -592,27 +678,27 @@ local validate_info_win = function(delay) type_keys('') eq(get_floating_windows(), {}) - sleep(delay - 10) + sleep(delay - small_time) eq(get_floating_windows(), {}) - sleep(10 + 1) + sleep(small_time + small_time) validate_single_floating_win({ lines = { 'Month #01' } }) end T['Information window']['works'] = function() child.set_size(10, 40) - validate_info_win(test_times.info) + validate_info_win(default_info_delay) child.expect_screenshot() end T['Information window']['respects `config.delay.info`'] = function() - child.lua('MiniCompletion.config.delay.info = 300') - validate_info_win(300) + child.lua('MiniCompletion.config.delay.info = ' .. (2 * default_info_delay)) + validate_info_win(2 * default_info_delay) -- Should also use buffer local config child.ensure_normal_mode() set_lines({ '' }) - child.b.minicompletion_config = { delay = { info = 50 } } - validate_info_win(50) + child.b.minicompletion_config = { delay = { info = default_info_delay } } + validate_info_win(default_info_delay) end local validate_info_window_config = function(keys, completion_items, win_config) @@ -622,7 +708,7 @@ local validate_info_window_config = function(keys, completion_items, win_config) type_keys('') -- Some windows can take a while to process on slow machines. So add `10` -- to ensure that processing is finished. - sleep(test_times.info + 10) + sleep(default_info_delay + small_time) validate_single_floating_win({ config = win_config }) end @@ -652,7 +738,7 @@ T['Information window']['accounts for border when picking side'] = function() set_lines({ 'aaaaaaaaaaaa ' }) type_keys('A', 'J', '', '') - sleep(test_times.info + 10) + sleep(default_info_delay + small_time) child.expect_screenshot() end @@ -669,7 +755,7 @@ T['Information window']['adjusts window width'] = function() child.lua([[MiniCompletion.config.window.info= { height = 15, width = 10, border = 'single' }]]) type_keys('i', 'J', '', '') - sleep(test_times.info + 10) + sleep(default_info_delay + small_time) child.expect_screenshot() end @@ -678,12 +764,12 @@ T['Information window']['implements debounce-style delay'] = function() eq(get_completion(), { 'January', 'June', 'July' }) type_keys('') - sleep(test_times.info - 10) + sleep(default_info_delay - small_time) eq(#get_floating_windows(), 0) type_keys('') - sleep(test_times.info - 10) + sleep(default_info_delay - small_time) eq(#get_floating_windows(), 0) - sleep(10 + 1) + sleep(small_time + small_time) validate_single_floating_win({ lines = { 'Month #06' } }) end @@ -695,7 +781,7 @@ T['Information window']['is closed when forced outside of Insert mode'] = new_se eq(get_completion(), { 'January', 'June', 'July' }) type_keys('') - sleep(test_times.info + 5) + sleep(default_info_delay + small_time) validate_single_floating_win({ lines = { 'Month #01' } }) type_keys(key) @@ -705,14 +791,14 @@ T['Information window']['is closed when forced outside of Insert mode'] = new_se ) T['Information window']['handles all buffer wipeout'] = function() - validate_info_win(test_times.info) + validate_info_win(default_info_delay) child.ensure_normal_mode() child.cmd('%bw!') new_buffer() mock_lsp() - validate_info_win(test_times.info) + validate_info_win(default_info_delay) end T['Information window']['respects `vim.{g,b}.minicompletion_disable`'] = new_set({ @@ -724,7 +810,7 @@ T['Information window']['respects `vim.{g,b}.minicompletion_disable`'] = new_set set_lines({ 'aa ab ', '' }) set_cursor(2, 0) type_keys('i', '', '') - sleep(test_times.info + 1) + sleep(default_info_delay + small_time) eq(#get_floating_windows(), 0) end, }) @@ -744,27 +830,27 @@ local validate_signature_win = function(delay) type_keys('i', 'abc(') eq(get_floating_windows(), {}) - sleep(delay - 10) + sleep(delay - small_time) eq(get_floating_windows(), {}) - sleep(10 + 1) + sleep(small_time + small_time) validate_single_floating_win({ lines = { 'abc(param1, param2)' } }) end T['Signature help']['works'] = function() child.set_size(5, 30) - validate_signature_win(test_times.signature) + validate_signature_win(default_signature_delay) child.expect_screenshot() end T['Signature help']['respects `config.delay.signature`'] = function() - child.lua('MiniCompletion.config.delay.signature = 300') - validate_signature_win(300) + child.lua('MiniCompletion.config.delay.signature = ' .. (2 * default_signature_delay)) + validate_signature_win(2 * default_signature_delay) -- Should also use buffer local config child.ensure_normal_mode() set_lines({ '' }) - child.b.minicompletion_config = { delay = { signature = 50 } } - validate_signature_win(50) + child.b.minicompletion_config = { delay = { signature = default_signature_delay } } + validate_signature_win(default_signature_delay) end T['Signature help']['updates highlighting of active parameter'] = function() @@ -772,23 +858,23 @@ T['Signature help']['updates highlighting of active parameter'] = function() child.cmd('startinsert') type_keys('abc(') - sleep(test_times.signature + 1) + sleep(default_signature_delay + small_time) child.expect_screenshot() type_keys('1,') - sleep(test_times.signature + 1) + sleep(default_signature_delay + small_time) child.expect_screenshot() -- As there are only two parameters, nothing should be highlighted type_keys('2,') - sleep(test_times.signature + 1) + sleep(default_signature_delay + small_time) child.expect_screenshot() end local validate_signature_window_config = function(keys, win_config) child.cmd('startinsert') type_keys(keys) - sleep(test_times.signature + 2) + sleep(default_signature_delay + small_time) validate_single_floating_win({ config = win_config }) end @@ -817,7 +903,7 @@ T['Signature help']['accounts for border when picking side'] = function() child.lua([[MiniCompletion.config.window.signature.border = 'single']]) type_keys('o', 'abc(') - sleep(test_times.signature + 10) + sleep(default_signature_delay + small_time) child.expect_screenshot() end @@ -835,20 +921,20 @@ T['Signature help']['adjusts window height'] = function() child.lua([[MiniCompletion.config.window.signature = { height = 15, width = 10, border = 'single' }]]) type_keys('i', 'long(') - sleep(test_times.signature + 10) + sleep(default_signature_delay + small_time) child.expect_screenshot() end T['Signature help']['implements debounce-style delay'] = function() child.cmd('startinsert') type_keys('abc(') - sleep(test_times.signature - 10) + sleep(default_signature_delay - small_time) type_keys('d') - sleep(test_times.signature + 1) + sleep(default_signature_delay + small_time) eq(#get_floating_windows(), 0) type_keys(',') - sleep(test_times.signature + 1) + sleep(default_signature_delay + small_time) validate_single_floating_win({ lines = { 'abc(param1, param2)' } }) end @@ -857,7 +943,7 @@ T['Signature help']['is closed when forced outside of Insert mode'] = new_set( { test = function(key) type_keys('i', 'abc(') - sleep(test_times.signature + 5) + sleep(default_signature_delay + small_time) validate_single_floating_win({ lines = { 'abc(param1, param2)' } }) type_keys(key) @@ -867,14 +953,14 @@ T['Signature help']['is closed when forced outside of Insert mode'] = new_set( ) T['Signature help']['handles all buffer wipeout'] = function() - validate_signature_win(test_times.signature) + validate_signature_win(default_signature_delay) child.ensure_normal_mode() child.cmd('%bw!') new_buffer() mock_lsp() - validate_signature_win(test_times.signature) + validate_signature_win(default_signature_delay) end T['Signature help']['respects `vim.{g,b}.minicompletion_disable`'] = new_set({ @@ -884,7 +970,7 @@ T['Signature help']['respects `vim.{g,b}.minicompletion_disable`'] = new_set({ child[var_type].minicompletion_disable = true type_keys('i', 'abc(') - sleep(test_times.signature + 1) + sleep(default_signature_delay + small_time) eq(#get_floating_windows(), 0) end, }) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_cursorword.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_cursorword.lua index d1e5db91..f0216e6b 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_cursorword.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_cursorword.lua @@ -11,8 +11,7 @@ local unload_module = function() child.mini_unload('cursorword') end local set_cursor = function(...) return child.set_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child, true) end --stylua: ignore end -- Make helpers @@ -39,7 +38,9 @@ end -- Data ======================================================================= local example_lines = { 'aa', 'aa', 'aaa' } -local test_times = { delay = 100 } +-- Time constants +local default_delay = 100 +local small_time = helpers.get_time_const(10) -- Output test set ============================================================ local T = new_set({ @@ -93,8 +94,8 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ delay = 'a' }, 'delay', 'number') end -T['setup()']['defines non-linked default highlighting on `ColorScheme`'] = function() - child.cmd('colorscheme blue') +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') expect.match(child.cmd_capture('hi MiniCursorword'), 'gui=underline') expect.match(child.cmd_capture('hi MiniCursorwordCurrent'), 'links to MiniCursorword') end @@ -163,27 +164,27 @@ T['Autohighlighting'] = new_set({ local validate_cursorword = function(delay) set_cursor(2, 0) eq(word_is_highlighted('aa'), false) - sleep(delay - 10) + sleep(delay - small_time) eq(word_is_highlighted('aa'), false) - sleep(10) + sleep(small_time) eq(word_is_highlighted('aa'), true) end -T['Autohighlighting']['works'] = function() validate_cursorword(test_times.delay) end +T['Autohighlighting']['works'] = function() validate_cursorword(default_delay) end T['Autohighlighting']['respects `config.delay`'] = function() - child.lua('MiniCursorword.config.delay = 200') - validate_cursorword(200) + child.lua('MiniCursorword.config.delay = ' .. (3 * default_delay)) + validate_cursorword(3 * default_delay) -- Should also use buffer local config set_cursor(3, 0) - child.b.minicursorword_config = { delay = 50 } - validate_cursorword(50) + child.b.minicursorword_config = { delay = default_delay } + validate_cursorword(default_delay) end T['Autohighlighting']['removes highlight immediately after move'] = function() set_cursor(2, 0) - sleep(test_times.delay) + sleep(default_delay) eq(word_is_highlighted('aa'), true) set_cursor(3, 0) eq(child.fn.getmatches(), {}) @@ -191,12 +192,12 @@ end local validate_immediate = function(move_command) set_cursor(2, 0) - sleep(test_times.delay) + sleep(default_delay) eq(word_is_highlighted('aa'), true) local match_gen = get_match('MiniCursorword') child.cmd(move_command) - sleep(0) + child.poke_eventloop() eq(word_is_highlighted('aa'), true) -- Check that general match group didn't change (as word is same) @@ -233,7 +234,7 @@ end T['Autohighlighting']['stops in Insert mode'] = function() set_cursor(2, 0) - sleep(test_times.delay) + sleep(default_delay) eq(word_is_highlighted('aa'), true) type_keys('i') eq(word_is_highlighted('aa'), false) @@ -241,7 +242,7 @@ end T['Autohighlighting']['stops in Terminal mode'] = function() set_cursor(2, 0) - sleep(test_times.delay) + sleep(default_delay) eq(word_is_highlighted('aa'), true) child.cmd('doautocmd TermEnter') eq(word_is_highlighted('aa'), false) @@ -277,12 +278,12 @@ T['Autohighlighting']['respects `vim.{g,b}.minicursorword_disable`'] = new_set({ child[var_type].minicursorword_disable = true set_cursor(1, 0) - sleep(test_times.delay) + sleep(default_delay) eq(word_is_highlighted('aa'), false) child[var_type].minicursorword_disable = false set_cursor(1, 1) - sleep(test_times.delay) + sleep(default_delay) eq(word_is_highlighted('aa'), true) end, }) @@ -296,12 +297,12 @@ T['Autohighlighting']['respects deferred `vim.{g,b}.minicursorword_disable`'] = local lua_cmd = string.format( 'vim.defer_fn(function() vim.%s.minicursorword_disable = true end, %d)', var_type, - math.floor(0.5 * test_times.delay) + math.floor(0.5 * default_delay) ) child.lua(lua_cmd) set_cursor(1, 0) - sleep(test_times.delay) + sleep(default_delay) eq(word_is_highlighted('aa'), false) end, }) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_deps.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_deps.lua index dff13c81..ecc0676a 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_deps.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_deps.lua @@ -8,15 +8,14 @@ local new_set = MiniTest.new_set --stylua: ignore start local load_module = function(config) child.mini_load('deps', config) end local unload_module = function() child.mini_unload('deps') end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end -- TODO: Remove after compatibility with Neovim=0.9 is dropped local islist = vim.fn.has('nvim-0.10') == 1 and vim.islist or vim.tbl_islist local test_dir = 'tests/dir-deps' -local test_dir_absolute = vim.fn.fnamemodify(test_dir, ':p'):gsub('(.)/$', '%1') +local test_dir_absolute = vim.fs.normalize(vim.fn.fnamemodify(test_dir, ':p')):gsub('(.)/$', '%1') local test_opt_dir = test_dir_absolute .. '/pack/deps/opt' local test_snap_path = test_dir_absolute .. '/snapshots/snap' local test_log_path = test_dir_absolute .. '/mini-deps.log' @@ -88,7 +87,8 @@ end local mock_hide_path = function(path) path = path or test_dir_absolute - child.cmd(':%s/' .. child.fn.escape(path, ' /') .. '/MOCKDIR/') + -- NOTE: use "^" as pattern separator because "/" can cause troubles + child.cmd(':%s^' .. child.fn.escape(path, ' /') .. '^MOCKDIR^') child.bo.modified = false end @@ -160,6 +160,19 @@ end local clear_notify_log = function() return child.lua('_G.notify_log = {}') end +-- Common validators +local is_in_rtp = function(path) + path = vim.fs.normalize(path) + for _, p in ipairs(child.api.nvim_list_runtime_paths()) do + if path == vim.fs.normalize(p) then return true end + end + return false +end + +-- Time constants +local small_time = helpers.get_time_const(10) +local micro_time = 1 + -- Output test set ============================================================ local T = new_set({ hooks = { @@ -172,6 +185,7 @@ local T = new_set({ -- Make more comfortable screenshots child.o.laststatus = 0 child.o.ruler = false + child.o.showtabline = 0 -- Mock `vim.notify()` mock_notify() @@ -193,6 +207,9 @@ T['setup()']['creates side effects'] = function() -- Global variable eq(child.lua_get('type(_G.MiniDeps)'), 'table') + -- Autocommand group + eq(child.fn.exists('#MiniDeps'), 1) + -- User commands local has_user_command = function(cmd) eq(child.fn.exists(':' .. cmd), 2) end has_user_command('DepsAdd') @@ -262,6 +279,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ silent = 'a' }, 'silent', 'boolean') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniDepsHint'), 'links to DiagnosticHint') +end + T['setup()']["prepends 'packpath' with package path"] = function() mock_test_package(test_dir_absolute) eq(vim.startswith(child.o.packpath, test_dir_absolute), true) @@ -281,22 +303,18 @@ T['add()'] = new_set({ hooks = { pre_case = mock_test_package } }) T['add()']['works for present plugins'] = new_set({ parametrize = { { 'plugin_1' }, { { name = 'plugin_1' } } } }, { test = function(spec) local ref_path = test_opt_dir .. '/plugin_1' - expect.no_match(child.o.runtimepath, vim.pesc(ref_path)) + eq(is_in_rtp(ref_path), false) eq(get_session(), {}) add(spec) - expect.match(child.o.runtimepath, vim.pesc(ref_path)) + eq(is_in_rtp(ref_path), true) + eq(is_in_rtp(ref_path .. '/after'), true) eq(get_session(), { { name = 'plugin_1', path = ref_path, hooks = {}, depends = {} } }) -- No CLI process should be run as plugin is already present eq(get_spawn_log(), {}) - -- Should add plugin to 'runtimepath' - local rtp = vim.split(child.o.runtimepath, ',') - eq(vim.tbl_contains(rtp, ref_path), true) - eq(vim.tbl_contains(rtp, ref_path .. '/after'), true) - -- Should load 'plugin/', 'after/plugin/', etc. eq(child.lua_get('type(_G.plugin_log)'), 'table') end, @@ -313,7 +331,7 @@ T['add()']['infers name from source'] = new_set({ test = function(spec) local ref_path = test_opt_dir .. '/plugin_1' add(spec) - expect.match(child.o.runtimepath, vim.pesc(ref_path)) + eq(is_in_rtp(ref_path), true) eq( get_session(), { { source = 'https://github.com/user/plugin_1', name = 'plugin_1', path = ref_path, hooks = {}, depends = {} } } @@ -1123,6 +1141,7 @@ T['add()']['Install']['works when no information about number of cores is availa end T['add()']['Install']['respects `config.job.timeout`'] = function() + child.lua('_G.duration = ' .. (10 * small_time)) child.lua([[ _G.stdio_queue = { { out = 'git version 2.43.0'}, -- Check Git executable @@ -1132,10 +1151,10 @@ T['add()']['Install']['respects `config.job.timeout`'] = function() } -- Mock long execution of some jobs - _G.process_mock_data = { [2] = { duration = 50 }, [3] = { duration = 0 }, [4] = { duration = 50 } } + _G.process_mock_data = { [2] = { duration = _G.duration }, [3] = { duration = 0 }, [4] = { duration = _G.duration } } ]]) - child.lua('MiniDeps.config.job.timeout = 25') + child.lua('MiniDeps.config.job.timeout = ' .. (5 * small_time)) add({ source = 'user/new_plugin', depends = { 'user/dep_plugin' } }) local ref_notify_log = { @@ -1879,6 +1898,9 @@ T['update()']['works when no information about number of cores is available'] = end T['update()']['respects `config.job.timeout`'] = function() + helpers.skip_if_slow() + + child.lua('_G.duration = ' .. (10 * small_time)) child.lua([[ _G.stdio_queue = { { out = 'git version 2.43.0'}, -- Check Git executable @@ -1890,12 +1912,12 @@ T['update()']['respects `config.job.timeout`'] = function() } -- Mock non-trivial durations - _G.process_mock_data = { [3] = { duration = 50 }, [6] = { duration = 50 } } + _G.process_mock_data = { [3] = { duration = _G.duration }, [6] = { duration = _G.duration } } ]]) add('user/plugin_1') add('user/plugin_2') - child.lua('MiniDeps.config.job.timeout = 25') + child.lua('MiniDeps.config.job.timeout = ' .. (5 * small_time)) update() local ref_notify_log = { @@ -2448,7 +2470,7 @@ T['now()']['can be called inside other `now()`/`later()` call'] = function() ]]) eq(child.lua_get('_G.immediate_log'), { 'now', 'now_now' }) - sleep(20) + sleep(small_time) eq(child.lua_get('_G.log'), { 'now', 'now_now', 'later', 'later_now' }) end @@ -2461,7 +2483,7 @@ T['now()']['clears queue between different event loops'] = function() ]]) eq(child.lua_get('_G.immediate_log'), { 'now' }) - sleep(2) + sleep(small_time) child.lua('MiniDeps.now(_G.f)') -- If it did not clear the queue, it would have been 3 elements eq(child.lua_get('_G.log'), { 'now', 'now' }) @@ -2469,22 +2491,14 @@ end T['now()']['notifies about errors after everything is executed'] = function() child.lua([[ - _G.log = {} MiniDeps.now(function() error('Inside now()') end) - _G.f = function() log[#log + 1] = 'later' end - MiniDeps.later(_G.f) - MiniDeps.later(_G.f) - MiniDeps.later(_G.f) - MiniDeps.later(_G.f) - MiniDeps.later(_G.f) + local f = function() vim.notify('Info', vim.log.levels.INFO) end + MiniDeps.later(f) + MiniDeps.later(f) ]]) - sleep(1) - validate_notifications({}, true) - - sleep(10) - eq(child.lua_get('_G.log'), { 'later', 'later', 'later', 'later', 'later' }) - validate_notifications({ { 'errors.*Inside now()', 'ERROR' } }, true) + sleep(2 * small_time) + validate_notifications({ { 'Info', 'INFO' }, { 'Info', 'INFO' }, { 'errors.*Inside now()', 'ERROR' } }, true) end T['now()']['shows all errors at once'] = function() @@ -2492,7 +2506,7 @@ T['now()']['shows all errors at once'] = function() MiniDeps.now(function() error('Inside now() #1') end) MiniDeps.now(function() error('Inside now() #2') end) ]]) - sleep(2) + sleep(micro_time) validate_notifications({ { 'errors.*Inside now%(%) #1.*Inside now%(%) #2', 'ERROR' } }, true) end @@ -2500,7 +2514,7 @@ T['now()']['does not respect `config.silent`'] = function() -- Should still show errors even if `config.silent = true` child.lua('MiniDeps.config.silent = true') child.lua('MiniDeps.now(function() error("Inside now()") end)') - sleep(2) + sleep(micro_time) validate_notifications({ { 'Inside now%(%)', 'ERROR' } }, true) end @@ -2516,7 +2530,7 @@ T['later()']['works'] = function() ]]) eq(child.lua_get('_G.log_in_this_loop'), { 'after later' }) - sleep(2) + sleep(small_time) eq(child.lua_get('_G.log'), { 'after later', 'later' }) end @@ -2535,7 +2549,7 @@ T['later()']['can be called inside other `now()`/`later()` call'] = function() ]]) eq(child.lua_get('_G.immediate_log'), { 'now' }) - sleep(10) + sleep(2 * small_time) eq(child.lua_get('_G.log'), { 'now', 'later', 'now_later', 'later_later' }) end @@ -2547,34 +2561,25 @@ T['later()']['clears queue between different event loops'] = function() _G.immediate_log = vim.deepcopy(_G.log) ]]) eq(child.lua_get('_G.immediate_log'), {}) - sleep(2) + sleep(micro_time) eq(child.lua_get('_G.log'), { 'later' }) child.lua('MiniDeps.later(_G.f)') -- If it did not clear the queue, it would have been 3 elements - sleep(4) + sleep(2 * micro_time) eq(child.lua_get('_G.log'), { 'later', 'later' }) end T['later()']['notifies about errors after everything is executed'] = function() child.lua([[ - _G.log = {} MiniDeps.later(function() error('Inside later()') end) - _G.f = function() log[#log + 1] = 'later' end - MiniDeps.later(_G.f) - MiniDeps.later(_G.f) - MiniDeps.later(_G.f) - MiniDeps.later(_G.f) - MiniDeps.later(_G.f) + local f = function() vim.notify('Info', vim.log.levels.INFO) end + MiniDeps.later(f) + MiniDeps.later(f) ]]) - eq(child.lua_get('_G.log'), {}) - sleep(1) - validate_notifications({}, true) - - sleep(10) - eq(child.lua_get('_G.log'), { 'later', 'later', 'later', 'later', 'later' }) - validate_notifications({ { 'errors.*Inside later()', 'ERROR' } }, true) + sleep(2 * small_time) + validate_notifications({ { 'Info', 'INFO' }, { 'Info', 'INFO' }, { 'errors.*Inside later()', 'ERROR' } }, true) end T['later()']['shows all errors at once'] = function() @@ -2582,7 +2587,7 @@ T['later()']['shows all errors at once'] = function() MiniDeps.later(function() error('Inside later() #1') end) MiniDeps.later(function() error('Inside later() #2') end) ]]) - sleep(5) + sleep(2 * small_time) validate_notifications({ { 'errors.*Inside later%(%) #1.*Inside later%(%) #2', 'ERROR' } }, true) end @@ -2590,7 +2595,7 @@ T['later()']['does not respect `config.silent`'] = function() -- Should still show errors even if `config.silent = true` child.lua('MiniDeps.config.silent = true') child.lua('MiniDeps.later(function() error("Inside later()") end)') - sleep(2) + sleep(small_time) validate_notifications({ { 'Inside later%(%)', 'ERROR' } }, true) end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_diff.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_diff.lua index 05b5d183..3c291c46 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_diff.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_diff.lua @@ -13,20 +13,18 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end local new_buf = function() return child.api.nvim_create_buf(true, false) end local new_scratch_buf = function() return child.api.nvim_create_buf(false, true) end local get_buf = function() return child.api.nvim_get_current_buf() end local set_buf = function(buf_id) child.api.nvim_set_current_buf(buf_id) end -local edit = function(path) child.cmd('edit ' .. child.fn.fnameescape(path)) end --stylua: ignore end -- TODO: Remove after compatibility with Neovim=0.9 is dropped local islist = vim.fn.has('nvim-0.10') == 1 and vim.islist or vim.tbl_islist local test_dir = 'tests/dir-diff' -local test_dir_absolute = vim.fn.fnamemodify(test_dir, ':p'):gsub('(.)/$', '%1') +local test_dir_absolute = vim.fs.normalize(vim.fn.fnamemodify(test_dir, ':p')):gsub('(.)/$', '%1') local test_file_path = test_dir_absolute .. '/file' local git_repo_dir = test_dir_absolute .. '/git-repo' @@ -40,7 +38,24 @@ local forward_lua = function(fun_str) return function(...) return child.lua_get(lua_cmd, { ... }) end end -local set_ref_text = forward_lua([[require('mini.diff').set_ref_text]]) +-- Time constants +local default_watch_debounce_delay = 50 +local dummy_text_change_delay = helpers.get_time_const(30) +local small_time = helpers.get_time_const(10) +local micro_time = 1 + +-- Common wrappers +local edit = function(path) + child.cmd('edit ' .. child.fn.fnameescape(path)) + -- Slow context needs a small delay to get things up to date + if helpers.is_slow() then sleep(small_time) end +end + +local set_ref_text = function(...) + local res = child.lua_get([[require('mini.diff').set_ref_text(...)]], { ... }) + -- Slow context needs a small delay to get things up to date + if helpers.is_slow() then sleep(small_time) end +end local get_buf_hunks = function(buf_id) buf_id = buf_id or 0 @@ -62,12 +77,9 @@ end local is_buf_enabled = function(buf_id) return get_buf_data(buf_id) ~= vim.NIL end --- Common mocks -local small_time = 10 - -- - Dummy source, which is set by default in most tests local setup_with_dummy_source = function(text_change_delay) - text_change_delay = text_change_delay or small_time + text_change_delay = text_change_delay or dummy_text_change_delay child.lua([[ _G.dummy_log = {} _G.dummy_source = { @@ -106,7 +118,7 @@ end local mock_change_git_index = function() local index_path = git_git_dir .. '/index' child.fn.writefile({}, index_path .. '.lock') - sleep(1) + sleep(micro_time) child.fn.delete(index_path) child.loop.fs_rename(index_path .. '.lock', index_path) end @@ -132,6 +144,7 @@ local validate_git_spawn_log = function(ref_log) elseif islist(ref) then eq(real, { executable = 'git', options = { args = ref, cwd = real.options.cwd } }) else + if real.options.cwd ~= nil then real.options.cwd = vim.fs.normalize(real.options.cwd) end eq(real, { executable = 'git', options = ref }) end end @@ -318,6 +331,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ options = { wrap_goto = 'a' } }, 'options.wrap_goto', 'boolean') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniDiffOverAdd'), 'links to DiffAdd') +end + T['setup()']['auto enables in all existing buffers'] = function() local buf_id_normal = new_buf() set_buf(buf_id_normal) @@ -386,7 +404,7 @@ T['enable()']['makes sure buffer is loaded'] = function() end T['enable()']['makes buffer update cache on `BufWinEnter`'] = function() - eq(get_buf_data().config.delay.text_change, small_time) + eq(get_buf_data().config.delay.text_change, dummy_text_change_delay) child.b.minidiff_config = { delay = { text_change = 200 } } child.api.nvim_exec_autocmds('BufWinEnter', { buffer = get_buf() }) eq(get_buf_data().config.delay.text_change, 200) @@ -846,7 +864,7 @@ T['gen_source']['git()']['can apply hunks'] = function() -- Make change type_keys('G', 'cc', 'world') - sleep(small_time + 5) + sleep(small_time) local ref_hunks = { { buf_start = 0, buf_count = 0, ref_start = 1, ref_count = 2, type = 'delete' }, @@ -967,11 +985,13 @@ T['gen_source']['git()']['returns correct structure'] = function() end T['gen_source']['git()']["reacts to change in 'index' Git file"] = function() + helpers.skip_if_slow() + child.lua([[ _G.stdio_queue = { - { { 'out', _G.git_dir } }, -- Get path to repo's Git dir - { { 'out', 'Line 1\nLine 2\n' } }, -- Get reference text - { { 'out', 'Line 1\nLine 22\n' } }, -- Get reference text after 'index' update + { { 'out', _G.git_dir } }, -- Get path to repo's Git dir + { { 'out', 'Line 1\nLine 2\n' } }, -- Get reference text + { { 'out', 'Line 1\nLine 22\n' } }, -- Get reference text after 'index' update } ]]) @@ -982,30 +1002,33 @@ T['gen_source']['git()']["reacts to change in 'index' Git file"] = function() -- Emulate change in 'index' as it is done by Git mock_count_set_ref_text() + -- Use slightly bigger yet constrained delay for more robust tests + local small_time_bigger = math.min(2 * small_time, 0.9 * default_watch_debounce_delay) + -- Should react to change in 'index' file by reasking reference text - -- These reactions should be debounced (currently by 50 ms) + -- These reactions should be debounced mock_change_git_index() - sleep(50 - 20) + sleep(default_watch_debounce_delay - small_time_bigger) -- - No changes as less than 50 ms has passed eq(get_buf_data(0).ref_text, 'Line 1\nLine 2\n') eq(child.lua_get('_G.n_set_ref_text_calls'), 0) mock_change_git_index() - sleep(50 - 20) + sleep(default_watch_debounce_delay - small_time_bigger) eq(child.lua_get('_G.n_set_ref_text_calls'), 0) - sleep(20 + 5) + sleep(small_time_bigger + small_time) eq(get_buf_data(0).ref_text, 'Line 1\nLine 22\n') eq(child.lua_get('_G.n_set_ref_text_calls'), 1) -- Should react __only__ to changes in 'index' file child.fn.writefile({}, git_git_dir .. '/index.lock') - sleep(50 + 5) + sleep(default_watch_debounce_delay + small_time) eq(child.lua_get('_G.n_set_ref_text_calls'), 1) -- Should stop reacting after detaching disable() mock_change_git_index() - sleep(10 + 5) + sleep(2 * small_time) eq(child.lua_get('_G.n_set_ref_text_calls'), 1) -- Should make proper process spawns @@ -1162,7 +1185,7 @@ T['gen_source']['save()']['works'] = function() -- Should update reference text on save validate_ref_text('aaa\nuuu\n') type_keys('G', 'o', 'vvv', '') - sleep(small_time + 5) + sleep(small_time + small_time) validate_ref_text('aaa\nuuu\n') child.cmd('write') validate_ref_text('aaa\nuuu\nvvv\n') @@ -1176,7 +1199,13 @@ T['gen_source']['save()']['works'] = function() local cur_changedtick = child.api.nvim_buf_get_changedtick(0) child.cmd('silent! checktime') -- - Wait for `:checktime` itself to process - vim.wait(500, function() return child.api.nvim_buf_get_changedtick(0) ~= cur_changedtick end, 10) + for _ = 1, 100 do + if child.api.nvim_buf_get_changedtick(0) ~= cur_changedtick then break end + vim.loop.sleep(small_time) + end + if child.api.nvim_buf_get_changedtick(0) == cur_changedtick then + MiniTest.skip('Could not wait for `silent! checktime` to take effect') + end validate_ref_text('bbb\nxxx\n') -- Should clean up buffer autocommands on detach @@ -1888,14 +1917,14 @@ T['Visualization']['works'] = function() type_keys('o', 'hello') validate_viz_extmarks(0, init_viz_extmarks) - sleep(small_time - 5) + sleep(dummy_text_change_delay - 2 * small_time) validate_viz_extmarks(0, init_viz_extmarks) type_keys('', 'world') - sleep(small_time - 5) + sleep(dummy_text_change_delay - 2 * small_time) validate_viz_extmarks(0, init_viz_extmarks) - sleep(5 + 5) + sleep(2 * small_time + small_time) validate_viz_extmarks(0, { { line = 2, sign_hl_group = 'MiniDiffSignAdd', sign_text = '▒ ' }, { line = 4, sign_hl_group = 'MiniDiffSignChange', sign_text = '▒ ' }, @@ -1984,6 +2013,7 @@ end T['Visualization']['reacts to hunk lines delete/move'] = function() if child.fn.has('nvim-0.10') == 0 then MiniTest.skip('Reaction to line delete/move is available on Neovim>0.10.') end + child.o.signcolumn = 'yes' set_lines({ 'aaa', 'bbb', 'uuu', 'vvv', 'ccc', 'ddd' }) set_ref_text(0, { 'aaa', 'bbb', 'ccc', 'ddd' }) @@ -1998,7 +2028,7 @@ T['Visualization']['reacts to hunk lines delete/move'] = function() -- Should be immediately not drawn (invalidated) child.expect_screenshot() - sleep(small_time + 5) + sleep(dummy_text_change_delay + small_time) validate_viz_extmarks(0, { { line = 2, sign_hl_group = 'MiniDiffSignAdd', sign_text = '▒ ' }, { line = 3, sign_hl_group = 'MiniDiffSignAdd', sign_text = '▒ ' }, @@ -2017,7 +2047,7 @@ T['Visualization']['forces redraw when it is needed'] = function() set_ref_text(0, { 'aaa' }) type_keys('gg', '') - sleep(small_time + 5) + sleep(dummy_text_change_delay + small_time) validate_viz_extmarks(0, { { line = 2, sign_hl_group = 'MiniDiffSignAdd', sign_text = '▒ ' } }) child.expect_screenshot() @@ -2126,7 +2156,7 @@ T['Overlay']['works'] = function() type_keys('A', '', 'EeE') child.expect_screenshot() - sleep(small_time + 5) + sleep(dummy_text_change_delay + small_time) child.expect_screenshot() end @@ -2317,7 +2347,9 @@ T['Diff']['works'] = function() eq(get_buf_hunks(0), ref_hunks_before) eq(get_buf_hunks(other_buf_id), ref_hunks_before) - sleep(small_time - 5) + local small_time_bigger = 2 * small_time + + sleep(dummy_text_change_delay - small_time_bigger) eq(get_buf_hunks(0), ref_hunks_before) eq(get_buf_hunks(other_buf_id), ref_hunks_before) @@ -2325,11 +2357,11 @@ T['Diff']['works'] = function() set_cursor(2, 0) type_keys('o', 'world', '') - sleep(small_time - 5) + sleep(dummy_text_change_delay - small_time_bigger) eq(get_buf_hunks(0), ref_hunks_before) eq(get_buf_hunks(other_buf_id), ref_hunks_before) - sleep(5 + 5) + sleep(small_time_bigger + small_time) local ref_hunks_after = { { buf_start = 2, buf_count = 2, ref_start = 1, ref_count = 0, type = 'add' } } eq(get_buf_hunks(0), ref_hunks_after) @@ -2429,7 +2461,7 @@ T['Diff']['redraws statusline when diff is updated'] = function() set_cursor(2, 0) type_keys('o', 'hello') - sleep(small_time + 5) + sleep(dummy_text_change_delay + small_time) child.expect_screenshot() end @@ -2444,7 +2476,7 @@ T['Diff']['triggers dedicated event'] = function() type_keys('o', 'hello') eq(child.lua_get('_G.n'), 1) - sleep(small_time + 5) + sleep(dummy_text_change_delay + small_time) eq(child.lua_get('_G.n'), 2) end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_extra.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_extra.lua index 41bd88bb..a91d8ff5 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_extra.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_extra.lua @@ -12,8 +12,7 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end -- TODO: Remove after compatibility with Neovim=0.9 is dropped @@ -28,15 +27,12 @@ child.expect_screenshot = function(opts) end -- Test paths helpers -local join_path = function(...) return table.concat({ ... }, '/') end - -local full_path = function(x) - local res = child.fn.fnamemodify(x, ':p'):gsub('(.)/$', '%1') - return res -end +local path_sep = package.config:sub(1, 1) +local join_path = function(...) return (table.concat({ ... }, path_sep):gsub('([\\/])[\\/]*', '%1')) end +local full_path = function(x) return (child.fn.fnamemodify(x, ':p'):gsub('(.)[\\/]$', '%1')) end local test_dir = 'tests/dir-extra' -local test_dir_absolute = vim.fn.fnamemodify(test_dir, ':p'):gsub('(.)/$', '%1') +local test_dir_absolute = vim.fn.fnamemodify(test_dir, ':p'):gsub('(.)[\\/]$', '%1') local real_files_dir = 'tests/dir-extra/real-files' local make_testpath = function(...) return join_path(test_dir, ...) end @@ -63,7 +59,6 @@ local is_picker_active = forward_lua('MiniPick.is_picker_active') local validate_buf_name = function(buf_id, name) buf_id = buf_id or child.api.nvim_get_current_buf() name = name ~= '' and full_path(name) or '' - name = name:gsub('/+$', '') eq(child.api.nvim_buf_get_name(buf_id), name) end @@ -191,6 +186,31 @@ local get_process_log = function() return child.lua_get('_G.process_log') end local clear_process_log = function() child.lua('_G.process_log = {}') end +-- Mock consistent paths for more robust screenshot testing +local mock_slash_path_sep = function() + if path_sep == '/' then return end + child.lua([[ + _G.fnamemodify_orig = vim.fn.fnamemodify + vim.fn.fnamemodify = function(...) + return (_G.fnamemodify_orig(...):gsub('\\', '/')) + end + + _G.getcwd_orig = vim.fn.getcwd + vim.fn.getcwd = function() return (getcwd_orig():gsub('\\', '/')) end + ]]) +end + +local unmock_slash_path_sep = function() + if path_sep == '/' then return end + child.lua([[ + package.config = _G.package_config_orig + vim.fn.fnamemodify, vim.fn.getcwd = _G.fnamemodify_orig, _G.getcwd_orig + ]]) +end + +-- Time constants +local small_time = helpers.get_time_const(10) + -- Output test set ============================================================ local T = new_set({ hooks = { @@ -198,9 +218,9 @@ local T = new_set({ child.setup() -- Make more comfortable screenshots - child.set_size(15, 40) child.o.laststatus = 0 child.o.ruler = false + child.set_size(15, 40) end, post_once = child.stop, }, @@ -310,7 +330,7 @@ T['gen_ai_spec']['diagnostic()'] = new_set({ hooks = { pre_case = function() local mock_path = make_testpath('mocks', 'diagnostic.lua') - child.lua(string.format('dofile("%s")', mock_path)) + child.lua(string.format('dofile(%s)', vim.inspect(mock_path))) end, }, }) @@ -782,6 +802,78 @@ T['pickers']['buf_lines()']['respects `local_opts.scope`'] = function() child.expect_screenshot() end +T['pickers']['buf_lines()']['respects `local_opts.preserve_order`'] = function() + set_lines({ 'axay', 'b', 'aaxy', 'ccc', 'xaa' }) + pick_buf_lines({ scope = 'current', preserve_order = true }) + + type_keys('x') + eq(get_picker_matches().all_inds, { 1, 3, 5 }) + type_keys('y') + eq(get_picker_matches().all_inds, { 1, 3 }) +end + +T['pickers']['buf_lines()']['pads line numbers'] = function() + local set_n_lines = function(buf_id, prefix, n) + local lines = {} + for i = 1, n do + lines[i] = prefix .. '-' .. i + end + child.api.nvim_buf_set_lines(buf_id, 0, -1, false, lines) + end + + local buf_id_1 = child.api.nvim_create_buf(true, false) + set_n_lines(buf_id_1, 'buf-1', 9) + + local buf_id_2 = child.api.nvim_create_buf(true, false) + set_n_lines(buf_id_2, 'buf-2', 10) + + local buf_id_3 = child.api.nvim_create_buf(true, false) + set_n_lines(buf_id_3, 'buf-3', 99) + + local buf_id_4 = child.api.nvim_create_buf(true, false) + set_n_lines(buf_id_4, 'buf-4', 100) + + -- Should pad line numbers to achieve more aligned look + child.lua_notify('MiniExtra.pickers.buf_lines()') + sleep(small_time) + local items = get_picker_items() + + local validate_has_item_with_text = function(text) + local res = false + for _, item in ipairs(items) do + if item.text == text then res = true end + end + eq(res, true) + end + + validate_has_item_with_text('\0001\000buf-1-1') + validate_has_item_with_text('\0009\000buf-1-9') + + validate_has_item_with_text('\000 1\000buf-2-1') + validate_has_item_with_text('\000 9\000buf-2-9') + validate_has_item_with_text('\00010\000buf-2-10') + + validate_has_item_with_text('\000 1\000buf-3-1') + validate_has_item_with_text('\00099\000buf-3-99') + + validate_has_item_with_text('\000 1\000buf-4-1') + validate_has_item_with_text('\000 99\000buf-4-99') + validate_has_item_with_text('\000100\000buf-4-100') + + type_keys('') + + -- Should work with `scope='current'` + child.api.nvim_set_current_buf(buf_id_4) + child.lua_notify('MiniExtra.pickers.buf_lines({ scope = "current" })') + sleep(small_time) + items = get_picker_items() + + validate_has_item_with_text(' 1\000buf-4-1') + validate_has_item_with_text(' 99\000buf-4-99') + validate_has_item_with_text('100\000buf-4-100') + type_keys('') +end + T['pickers']['buf_lines()']['can not show icons'] = function() setup_buffers() child.lua('MiniPick.config.source.show = MiniPick.default_show') @@ -859,7 +951,7 @@ T['pickers']['diagnostic()'] = new_set({ hooks = { pre_case = function() local mock_path = make_testpath('mocks', 'diagnostic.lua') - child.lua(string.format('dofile("%s")', mock_path)) + child.lua(string.format('dofile(%s)', vim.inspect(mock_path))) end, }, }) @@ -870,6 +962,7 @@ T['pickers']['diagnostic()']['works'] = function() child.set_size(25, 100) child.cmd('enew') + mock_slash_path_sep() child.lua_notify('_G.return_item = MiniExtra.pickers.diagnostic()') validate_picker_name('Diagnostic (all)') child.expect_screenshot() @@ -894,6 +987,7 @@ T['pickers']['diagnostic()']['works'] = function() type_keys('') type_keys('') child.expect_screenshot() + unmock_slash_path_sep() -- Should properly choose type_keys('') @@ -940,6 +1034,9 @@ T['pickers']['diagnostic()']['respects `local_opts.sort_by`'] = function() local path_1 = make_testpath('mocks', 'diagnostic-file-1') local path_2 = make_testpath('mocks', 'diagnostic-file-2') + if path_sep == '\\' then + path_1, path_2 = (path_1:gsub('/', '\\')), (path_2:gsub('/', '\\')) + end pick_diagnostic({ sort_by = 'severity' }) --stylua: ignore @@ -998,7 +1095,7 @@ end T['pickers']['diagnostic()']["forces 'buflisted' on opened buffer"] = function() -- This matters for project wide diagnostic done inside unlisted buffers - child.api.nvim_buf_set_option(child.lua_get('_G.buf_id_2'), 'buflisted', false) + child.lua('vim.bo[_G.buf_id_2].buflisted = false') pick_diagnostic() type_keys('', '') @@ -1031,7 +1128,7 @@ T['pickers']['explorer()']['works'] = function() type_keys('', '') child.expect_screenshot() validate_picker_name('File explorer') - validate_picker_cwd(join_path(init_dir, 'dir1')) + validate_picker_cwd(init_dir .. '/dir1') -- - Should actually change items eq(vim.deep_equal(init_items, get_picker_items()), false) @@ -1055,7 +1152,7 @@ T['pickers']['explorer()']['works'] = function() eq(get_lines(), { 'File 3' }) -- Should return chosen value - eq(child.lua_get('_G.return_item'), { fs_type = 'file', path = join_path(init_dir, 'file3'), text = 'file3' }) + eq(child.lua_get('_G.return_item'), { fs_type = 'file', path = init_dir .. '/file3', text = 'file3' }) end T['pickers']['explorer()']['works with query'] = function() @@ -1064,12 +1161,12 @@ T['pickers']['explorer()']['works with query'] = function() pick_explorer() type_keys('^D') - eq(get_picker_matches().all, { { fs_type = 'directory', path = join_path(init_dir, 'Dir2'), text = 'Dir2/' } }) + eq(get_picker_matches().all, { { fs_type = 'directory', path = init_dir .. '/Dir2', text = 'Dir2/' } }) type_keys('') eq(get_picker_matches().all, { { fs_type = 'directory', path = init_dir, text = '..' }, - { fs_type = 'file', path = join_path(init_dir, 'Dir2', 'file2-1'), text = 'file2-1' }, + { fs_type = 'file', path = init_dir .. '/Dir2/file2-1', text = 'file2-1' }, }) -- - Should reset the query eq(child.lua_get('MiniPick.get_picker_query()'), {}) @@ -1084,7 +1181,7 @@ T['pickers']['explorer()']['can be resumed'] = function() stop_picker() child.lua_notify('MiniPick.builtin.resume()') - validate_picker_cwd(join_path(init_dir, 'dir1')) + validate_picker_cwd(init_dir .. '/dir1') child.expect_screenshot() end @@ -1627,7 +1724,7 @@ T['pickers']['git_hunks()']['works'] = function() local return_item_keys = vim.tbl_keys(return_item) table.sort(return_item_keys) eq(return_item_keys, { 'header', 'hunk', 'lnum', 'path', 'text' }) - eq(return_item.path, target_path) + eq(return_item.path, 'git-files/git-file-2') eq(return_item.lnum, 12) end @@ -1779,12 +1876,13 @@ T['pickers']['hipatterns()'] = new_set() local pick_hipatterns = forward_lua_notify('MiniExtra.pickers.hipatterns') local setup_hipatterns = function() + child.lua('_G.delay = ' .. (2 * small_time)) child.lua([[require('mini.hipatterns').setup({ highlighters = { minmax = { pattern = { 'min', 'max' }, group = 'Error' }, ['local'] = { pattern = 'local', group = 'Comment' }, }, - delay = { text_change = 20 }, + delay = { text_change = _G.delay }, })]]) child.cmd('edit ' .. real_file('a.lua')) local buf_id_1 = child.api.nvim_create_buf(true, false) @@ -1792,7 +1890,7 @@ local setup_hipatterns = function() local buf_id_2 = child.api.nvim_create_buf(true, false) child.api.nvim_set_current_buf(buf_id_2) child.api.nvim_buf_set_lines(buf_id_2, 0, -1, false, { '', 'min', 'max', 'local' }) - sleep(20 + 5) + sleep(2 * small_time + small_time) -- Should not be present in results local buf_id_not_enabled = child.api.nvim_create_buf(true, false) @@ -1805,6 +1903,7 @@ T['pickers']['hipatterns()']['works'] = function() child.set_size(15, 120) local _, buf_id_2 = setup_hipatterns() + mock_slash_path_sep() child.lua_notify('_G.return_item = MiniExtra.pickers.hipatterns()') validate_picker_name('Mini.hipatterns matches (all)') child.expect_screenshot() @@ -1863,6 +1962,7 @@ T['pickers']['hipatterns()']['respects `local_opts.highlighters`'] = function() child.set_size(15, 120) setup_hipatterns() + mock_slash_path_sep() pick_hipatterns({ highlighters = { 'minmax' } }) child.expect_screenshot() stop_picker() @@ -2251,6 +2351,7 @@ local validate_qf_loc = function(scope) child.set_size(20, 70) -- Setup quickfix/location list + mock_slash_path_sep() local path = real_file('a.lua') child.cmd('edit ' .. path) child.cmd('enew') @@ -2307,6 +2408,7 @@ T['pickers']['list()']['works for `jump`'] = function() type_keys('G', 'gg') -- Start picker + mock_slash_path_sep() child.lua_notify([[_G.return_item = MiniExtra.pickers.list({ scope = 'jump' })]]) validate_picker_name('List (jump)') child.expect_screenshot() @@ -2331,7 +2433,7 @@ T['pickers']['list()']['works for `change`'] = function() child.set_size(20, 70) -- Setup jump list - local path = real_file('a.lua') + local path = real_file('a.lua'):gsub('\\', '/') child.cmd('edit ' .. path) set_cursor(1, 1) type_keys('i', ' Change 1 ', '') @@ -2340,6 +2442,7 @@ T['pickers']['list()']['works for `change`'] = function() type_keys('i', ' Change 2 ', '') -- Start picker + mock_slash_path_sep() child.lua_notify([[_G.return_item = MiniExtra.pickers.list({ scope = 'change' })]]) validate_picker_name('List (change)') child.expect_screenshot() @@ -2408,6 +2511,7 @@ end local validate_location_scope = function(scope) local file_path, file_path_full = setup_lsp() + mock_slash_path_sep() pick_lsp({ scope = scope }) eq(child.lua_get('_G.lsp_buf_calls'), { scope }) validate_picker_name('LSP (' .. scope .. ')') @@ -2416,6 +2520,7 @@ local validate_location_scope = function(scope) -- Should preview position type_keys('') child.expect_screenshot() + unmock_slash_path_sep() -- Should have proper items local ref_item = { @@ -2423,7 +2528,7 @@ local validate_location_scope = function(scope) path = file_path_full, lnum = 3, col = 16, - text = file_path .. '│3│16│ x = math.max(a, 2),', + text = file_path:gsub('\\', '/') .. '│3│16│ x = math.max(a, 2),', } eq(get_picker_items()[1], ref_item) @@ -2433,9 +2538,10 @@ local validate_location_scope = function(scope) eq(get_cursor(), { 3, 15 }) end -local validate_symbol_scope = function(scope) +local validate_symbol_scope = function(scope, skip_preview) local file_path, file_path_full = setup_lsp() + mock_slash_path_sep() pick_lsp({ scope = scope }) validate_picker_name('LSP (' .. scope .. ')') eq(child.lua_get('_G.lsp_buf_calls'), { scope }) @@ -2459,19 +2565,25 @@ local validate_symbol_scope = function(scope) eq(get_extra_picker_extmarks(0, -1), ref_extmark_data) -- Should preview position - type_keys('') - child.expect_screenshot() + if not skip_preview then + type_keys('') + child.expect_screenshot() + end + unmock_slash_path_sep() -- Should have proper items - local text_prefix = scope == 'workspace_symbol' and (file_path .. '│1│7│ ') or '' - if has_mini_icons then text_prefix = ' ' .. text_prefix end + local text_prefix = scope == 'workspace_symbol' and (file_path:gsub('\\', '/') .. '│1│7│ ') or '' + local kind_name = child.lua_get('vim.lsp.protocol.SymbolKind[16]') + -- - Icon should be added only if it is not already assumed to be inside + -- `SymbolKind` map (as after `MiniIcons.tweak_lsp_kind()`). + if has_mini_icons and kind_name == 'Number' then text_prefix = ' ' .. text_prefix end local ref_item = { filename = file_path_full, path = file_path_full, lnum = 1, col = 7, kind = 'Number', - text = text_prefix .. '[Number] a', + text = text_prefix .. '[' .. kind_name .. '] a', hl = ref_extmark_data[1].hl_group, } eq(get_picker_items()[1], ref_item) @@ -2482,6 +2594,16 @@ local validate_symbol_scope = function(scope) eq(get_cursor(), { 1, 6 }) end +local validate_symbol_scope_with_tweaked_kind = function(scope, tweak_lsp_kind_mode) + child.lua('_G.symbol_kind_orig = vim.deepcopy(vim.lsp.protocol.SymbolKind)') + child.lua("require('mini.icons').setup()") + child.lua('MiniIcons.tweak_lsp_kind(...)', { tweak_lsp_kind_mode }) + + validate_symbol_scope(scope, true) + + child.lua('vim.lsp.protocol.SymbolKind = _G.symbol_kind_orig') +end + T['pickers']['lsp()']['works for `declaration`'] = function() validate_location_scope('declaration') end T['pickers']['lsp()']['works for `definition`'] = function() validate_location_scope('definition') end @@ -2493,11 +2615,18 @@ T['pickers']['lsp()']["works for `document_symbol` with 'mini.icons' set up"] = validate_symbol_scope('document_symbol') end +T['pickers']['lsp()']['works for `document_symbol` after `MiniIcons.tweak_lsp_kind()`'] = function() + validate_symbol_scope_with_tweaked_kind('document_symbol', 'prepend') + validate_symbol_scope_with_tweaked_kind('document_symbol', 'append') + validate_symbol_scope_with_tweaked_kind('document_symbol', 'replace') +end + T['pickers']['lsp()']['works for `implementation`'] = function() validate_location_scope('implementation') end T['pickers']['lsp()']['works for `references`'] = function() local file_path, file_path_full = setup_lsp() + mock_slash_path_sep() pick_lsp({ scope = 'references' }) validate_picker_name('LSP (references)') eq(child.lua_get('_G.lsp_buf_calls'), { 'references' }) @@ -2506,6 +2635,7 @@ T['pickers']['lsp()']['works for `references`'] = function() -- Should preview position type_keys('', '') child.expect_screenshot() + unmock_slash_path_sep() -- Should have proper items local ref_item = { @@ -2513,7 +2643,7 @@ T['pickers']['lsp()']['works for `references`'] = function() path = file_path_full, lnum = 3, col = 16, - text = file_path .. '│3│16│ x = math.max(a, 2),', + text = file_path:gsub('\\', '/') .. '│3│16│ x = math.max(a, 2),', } eq(get_picker_items()[2], ref_item) @@ -2532,6 +2662,12 @@ T['pickers']['lsp()']["works for `workspace_symbol` with 'mini.icons' set up"] = validate_symbol_scope('workspace_symbol') end +T['pickers']['lsp()']['works for `workspace_symbol` after `MiniIcons.tweak_lsp_kind()`'] = function() + validate_symbol_scope_with_tweaked_kind('workspace_symbol', 'prepend') + validate_symbol_scope_with_tweaked_kind('workspace_symbol', 'append') + validate_symbol_scope_with_tweaked_kind('workspace_symbol', 'replace') +end + T['pickers']['lsp()']['respects `local_opts.symbol_query`'] = function() setup_lsp() @@ -2590,6 +2726,7 @@ T['pickers']['marks()']['works'] = function() child.set_size(20, 70) setup_marks() + mock_slash_path_sep() child.lua_notify('_G.return_item = MiniExtra.pickers.marks()') validate_picker_name('Marks (all)') child.expect_screenshot() @@ -2601,6 +2738,7 @@ T['pickers']['marks()']['works'] = function() child.expect_screenshot() type_keys('', '', '', '') child.expect_screenshot() + unmock_slash_path_sep() -- Should properly choose by positioning on mark local path = real_file('a.lua') @@ -2609,13 +2747,16 @@ T['pickers']['marks()']['works'] = function() eq(get_cursor(), { 1, 5 }) -- Should return chosen value - eq(child.lua_get('_G.return_item'), { col = 6, lnum = 1, path = path, text = 'A │ ' .. path .. '│1│6' }) + local path_slash = path:gsub('\\', '/') + local ref_item = { col = 6, lnum = 1, path = path_slash, text = 'A │ ' .. path_slash .. '│1│6' } + eq(child.lua_get('_G.return_item'), ref_item) end T['pickers']['marks()']['respects `local_opts.scope`'] = function() local buffers = setup_marks() child.set_size(15, 40) + mock_slash_path_sep() pick_marks({ scope = 'global' }) child.expect_screenshot() stop_picker() @@ -2644,12 +2785,18 @@ T['pickers']['marks()']['validates arguments'] = function() validate({ scope = '1' }, '`pickers%.marks`.*"scope".*"1".*one of') end -T['pickers']['oldfiles()'] = new_set() +T['pickers']['oldfiles()'] = new_set({ + hooks = { + pre_case = function() + child.set_size(10, 70) + mock_slash_path_sep() + end, + }, +}) local pick_oldfiles = forward_lua_notify('MiniExtra.pickers.oldfiles') T['pickers']['oldfiles()']['works'] = function() - child.set_size(10, 70) local path_1, path_2 = real_file('LICENSE'), make_testpath('mocks', 'diagnostic.lua') local ref_oldfiles = { full_path(path_1), full_path(path_2), 'not-existing' } child.v.oldfiles = ref_oldfiles @@ -2657,9 +2804,11 @@ T['pickers']['oldfiles()']['works'] = function() child.lua_notify('_G.return_item = MiniExtra.pickers.oldfiles()') validate_picker_name('Old files') child.expect_screenshot() + unmock_slash_path_sep() -- Should have proper items (only readable files with short paths) - eq(get_picker_items(), { path_1, path_2 }) + local path_1_slash, path_2_slash = (path_1:gsub('\\', '/')), (path_2:gsub('\\', '/')) + eq(get_picker_items(), { path_1_slash, path_2_slash }) -- Should properly choose type_keys('') @@ -2668,7 +2817,7 @@ T['pickers']['oldfiles()']['works'] = function() --stylua: ignore -- Should return chosen value with proper structure - eq(child.lua_get('_G.return_item'), path_1) + eq(child.lua_get('_G.return_item'), path_1_slash) end T['pickers']['oldfiles()']['works with empty `v:oldfiles`'] = function() @@ -2700,6 +2849,17 @@ T['pickers']['oldfiles()']['respects `local_opts.current_dir'] = function() eq(items[1], 'LICENSE') end +T['pickers']['oldfiles()']['respects `local_opts.preserve_order`'] = function() + child.lua('vim.fn.filereadable = function() return 1 end') + child.v.oldfiles = { 'axay', 'b', 'aaxy', 'ccc', 'xaa' } + pick_oldfiles({ preserve_order = true }) + + type_keys('x') + eq(get_picker_matches().all_inds, { 1, 3, 5 }) + type_keys('y') + eq(get_picker_matches().all_inds, { 1, 3 }) +end + T['pickers']['oldfiles()']['respects `opts`'] = function() pick_oldfiles({}, { source = { name = 'My name' } }) validate_picker_name('My name') @@ -2999,7 +3159,7 @@ local setup_treesitter = function() local path = real_file('a.lua') child.cmd('edit ' .. path) child.lua('vim.treesitter.start()') - sleep(10) + sleep(small_time) return path end @@ -3045,22 +3205,25 @@ T['pickers']['treesitter()']['respects `opts`'] = function() end local setup_visits = function() - --stylua: ignore + -- NOTE: 'mini.visits' uses forward slashes in index + local dir = test_dir_absolute:gsub('\\', '/') + local path_1 = full_path(make_testpath('git-files', 'git-file-1')):gsub('\\', '/') + local path_2 = full_path(make_testpath('git-files', 'git-file-2')):gsub('\\', '/') local visit_index = { - [test_dir_absolute] = { - [join_path(test_dir_absolute, 'file-xyyx')] = { count = 5, latest = 5 }, - [join_path(test_dir_absolute, 'file-xx')] = { count = 1, labels = { xxx = true, uuu = true }, latest = 10 }, - [join_path(test_dir_absolute, 'file-xyx')] = { count = 10, labels = { xxx = true }, latest = 2 }, - [join_path(test_dir_absolute, 'real-files', 'a.lua')] = { count = 3, labels = { yyy = true }, latest = 3 }, + [dir] = { + [dir .. '/file-xyyx'] = { count = 5, latest = 5 }, + [dir .. '/file-xx'] = { count = 1, labels = { xxx = true, uuu = true }, latest = 10 }, + [dir .. '/file-xyx'] = { count = 10, labels = { xxx = true }, latest = 2 }, + [dir .. '/real-files/a.lua'] = { count = 3, labels = { yyy = true }, latest = 3 }, }, - [join_path(test_dir_absolute, 'git-files')] = { - [full_path(make_testpath('git-files', 'git-file-1'))] = { count = 0, labels = { xxx = true, www = true }, latest = 0 }, - [full_path(make_testpath('git-files', 'git-file-2'))] = { count = 100, latest = 100 }, + [dir .. '/git-files'] = { + [path_1] = { count = 0, labels = { xxx = true, www = true }, latest = 0 }, + [path_2] = { count = 100, latest = 100 }, }, } child.lua([[require('mini.visits').set_index(...)]], { visit_index }) - child.fn.chdir(test_dir_absolute) + child.fn.chdir(dir) end T['pickers']['visit_paths()'] = new_set({ hooks = { pre_case = setup_visits } }) @@ -3083,7 +3246,7 @@ T['pickers']['visit_paths()']['works'] = function() validate_buf_name(0, join_path('real-files', 'a.lua')) -- Should return chosen value - eq(child.lua_get('_G.return_item'), join_path('real-files', 'a.lua')) + eq(child.lua_get('_G.return_item'), 'real-files/a.lua') end T['pickers']['visit_paths()']['respects `local_opts.cwd`'] = function() @@ -3091,12 +3254,12 @@ T['pickers']['visit_paths()']['respects `local_opts.cwd`'] = function() validate_picker_name('Visit paths (all)') eq(get_picker_items(), { -- Should use short paths relative to the current working directory - join_path('git-files', 'git-file-2'), + 'git-files/git-file-2', 'file-xyyx', 'file-xx', 'file-xyx', - join_path('real-files', 'a.lua'), - join_path('git-files', 'git-file-1'), + 'real-files/a.lua', + 'git-files/git-file-1', }) end @@ -3121,11 +3284,11 @@ end T['pickers']['visit_paths()']['respects `local_opts.recency_weight`'] = function() pick_visit_paths({ recency_weight = 1 }) - eq(get_picker_items(), { 'file-xx', 'file-xyyx', join_path('real-files', 'a.lua'), 'file-xyx' }) + eq(get_picker_items(), { 'file-xx', 'file-xyyx', 'real-files/a.lua', 'file-xyx' }) end T['pickers']['visit_paths()']['respects `local_opts.sort`'] = function() - child.lua([[_G.sort = function() return { { path = vim.fn.getcwd() .. '/aaa' } } end]]) + child.lua([[_G.sort = function() return { { path = vim.fn.getcwd():gsub('\\', '/') .. '/aaa' } } end]]) child.lua_notify([[MiniExtra.pickers.visit_paths({ sort = _G.sort })]]) eq(get_picker_items(), { 'aaa' }) end @@ -3177,7 +3340,7 @@ T['pickers']['visit_labels()']['works'] = function() validate_buf_name(0, join_path('real-files', 'a.lua')) -- Should return chosen path - eq(child.lua_get('_G.return_item'), join_path('real-files', 'a.lua')) + eq(child.lua_get('_G.return_item'), 'real-files/a.lua') end T['pickers']['visit_labels()']['respects `local_opts.cwd`'] = function() @@ -3199,7 +3362,7 @@ end T['pickers']['visit_labels()']['respects `local_opts.sort`'] = function() child.set_size(15, 60) - child.lua([[_G.sort = function() return { { path = vim.fn.getcwd() .. '/aaa' } } end]]) + child.lua([[_G.sort = function() return { { path = vim.fn.getcwd():gsub('\\', '/') .. '/aaa' } } end]]) child.lua_notify([[MiniExtra.pickers.visit_labels({ sort = _G.sort })]]) eq(get_picker_items(), { 'xxx', 'uuu', 'yyy' }) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_files.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_files.lua index 6d90ddc0..10073488 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_files.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_files.lua @@ -13,8 +13,7 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end -- Tweak `expect_screenshot()` to test only on Neovim>=0.9 (as it introduced @@ -29,21 +28,10 @@ end local test_dir = 'tests/dir-files' local join_path = function(...) return table.concat({ ... }, '/') end +local full_path = function(...) return (vim.fn.fnamemodify(join_path(...), ':p'):gsub('\\', '/'):gsub('(.)/$', '%1')) end +local short_path = function(...) return (vim.fn.fnamemodify(join_path(...), ':~'):gsub('\\', '/'):gsub('(.)/$', '%1')) end -local full_path = function(...) - local res = vim.fn.fnamemodify(join_path(...), ':p'):gsub('(.)/$', '%1') - return res -end - -local short_path = function(...) - local res = vim.fn.fnamemodify(join_path(...), ':~'):gsub('(.)/$', '%1') - return res -end - -local make_test_path = function(...) - local path = join_path(test_dir, join_path(...)) - return child.fn.fnamemodify(path, ':p') -end +local make_test_path = function(...) return full_path(join_path(test_dir, ...)) end local make_temp_dir = function(name, children) -- Make temporary directory and make sure it is removed after test is done @@ -66,18 +54,37 @@ local make_temp_dir = function(name, children) end -- Common validators and helpers -local validate_directory = function(...) eq(child.fn.isdirectory(join_path(...)), 1) end - -local validate_no_directory = function(...) eq(child.fn.isdirectory(join_path(...)), 0) end - -local validate_file = function(...) eq(child.fn.filereadable(join_path(...)), 1) end - -local validate_no_file = function(...) eq(child.fn.filereadable(join_path(...)), 0) end - local validate_file_content = function(path, lines) eq(child.fn.readfile(path), lines) end +local validate_tree = function(dir, ref_tree) + child.lua('_G.dir = ' .. vim.inspect(dir)) + local tree = child.lua([[ + local read_dir + read_dir = function(path, res) + res = res or {} + local fs = vim.loop.fs_scandir(path) + local name, fs_type = vim.loop.fs_scandir_next(fs) + while name do + local cur_path = path .. '/' .. name + table.insert(res, cur_path .. (fs_type == 'directory' and '/' or '')) + if fs_type == 'directory' then read_dir(cur_path, res) end + name, fs_type = vim.loop.fs_scandir_next(fs) + end + return res + end + local dir_len = _G.dir:len() + return vim.tbl_map(function(p) return p:sub(dir_len + 2) end, read_dir(_G.dir)) + ]]) + table.sort(tree) + local ref = vim.deepcopy(ref_tree) + table.sort(ref) + eq(tree, ref) +end + local validate_cur_line = function(x) eq(get_cursor()[1], x) end +local is_explorer_active = function() return child.lua_get('MiniFiles.get_explorer_state() ~= nil') end + local validate_n_wins = function(n) eq(#child.api.nvim_tabpage_list_wins(0), n) end local validate_fs_entry = function(x) @@ -98,7 +105,7 @@ end local make_plain_pattern = function(...) return table.concat(vim.tbl_map(vim.pesc, { ... }), '.*') end local is_file_in_buffer = function(buf_id, path) - return string.find(child.api.nvim_buf_get_name(buf_id), vim.pesc(path) .. '$') ~= nil + return string.find(child.api.nvim_buf_get_name(buf_id):gsub('\\', '/'), vim.pesc(path:gsub('\\', '/')) .. '$') ~= nil end local is_file_in_window = function(win_id, path) return is_file_in_buffer(child.api.nvim_win_get_buf(win_id), path) end @@ -115,6 +122,12 @@ local go_in = forward_lua('MiniFiles.go_in') local go_out = forward_lua('MiniFiles.go_out') local trim_left = forward_lua('MiniFiles.trim_left') local trim_right = forward_lua('MiniFiles.trim_right') +local get_explorer_state = forward_lua('MiniFiles.get_explorer_state') +local set_bookmark = forward_lua('MiniFiles.set_bookmark') + +local get_visible_paths = function() + return vim.tbl_map(function(x) return x.path end, get_explorer_state().windows) +end -- Extmark helper local get_extmarks_hl = function() @@ -143,10 +156,10 @@ local mock_stdpath_data = function() [[ _G.stdpath_orig = vim.fn.stpath vim.fn.stdpath = function(what) - if what == 'data' then return '%s' end + if what == 'data' then return %s end return _G.stdpath_orig(what) end]], - data_dir + vim.inspect(data_dir) ) child.lua(lua_cmd) return data_dir @@ -167,6 +180,10 @@ local test_fs_entries = { { fs_type = 'file', name = 'b-file', path = full_path('b-file') }, } +-- Time constants +local track_lost_focus_delay = 1000 +local small_time = helpers.get_time_const(10) + -- Output test set ============================================================ local T = new_set({ hooks = { @@ -294,6 +311,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ windows = { width_preview = 'a' } }, 'windows.width_preview', 'number') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniFilesBorder'), 'links to FloatBorder') +end + T['open()'] = new_set() T['open()']['works with directory path'] = function() @@ -301,13 +323,13 @@ T['open()']['works with directory path'] = function() open(test_dir_path) child.expect_screenshot() close() - validate_n_wins(1) + eq(is_explorer_active(), false) -- Works with absolute path open(vim.fn.fnamemodify(test_dir_path, ':p')) child.expect_screenshot() close() - validate_n_wins(1) + eq(is_explorer_active(), false) -- Works with trailing slash open(test_dir_path .. '/') @@ -371,6 +393,7 @@ T['open()']['uses icon provider'] = function() 'MiniIconsAzure', 'MiniFilesFile', 'MiniIconsCyan', 'MiniFilesFile', 'MiniIconsGrey', 'MiniFilesFile', + 'MiniIconsGrey', 'MiniFilesFile', }) go_out() @@ -420,7 +443,7 @@ T['open()']['history']['opens from history by default'] = function() child.expect_screenshot() close() - validate_n_wins(1) + eq(is_explorer_active(), false) open(test_dir_path) -- Should be exactly the same, including cursors child.expect_screenshot() @@ -447,7 +470,7 @@ T['open()']['history']['respects `use_latest`'] = function() child.expect_screenshot() close() - validate_n_wins(1) + eq(is_explorer_active(), false) open(test_dir_path, false) -- Should be as if opened first time child.expect_screenshot() @@ -556,7 +579,7 @@ T['open()']['normalizes before first refresh when focused on file'] = function() -- Prepare explorer state to be opened from history open(make_test_path('common')) go_in() - validate_n_wins(3) + eq(is_explorer_active(), true) close() -- Mock `nvim_open_win()` @@ -581,7 +604,7 @@ end T['open()']['normalizes before first refresh when focused on directory with `windows.preview`'] = function() -- Prepare explorer state to be opened from history open(test_dir_path) - validate_n_wins(2) + eq(is_explorer_active(), true) close() -- Mock `nvim_open_win()` @@ -678,6 +701,64 @@ T['open()']['`content.prefix` can return `nil`'] = function() validate([[nil, '']]) end +T['open()']['`content.prefix` is called only on visible part of preview'] = function() + child.set_size(5, 100) + child.lua([[ + MiniFiles.config.windows.preview = true + + _G.log = {} + MiniFiles.config.content.prefix = function(fs_entry) + table.insert(_G.log, fs_entry.name) + return '-', 'Comment' + end + + _G.scandir_log = {} + fs_scandir_orig = vim.loop.fs_scandir + vim.loop.fs_scandir = function(path) + table.insert(_G.scandir_log, path) + return fs_scandir_orig(path) + end + ]]) + + local validate_log = function(ref) + local computed_prefix = child.lua_get('_G.log') + table.sort(computed_prefix) + eq(computed_prefix, ref) + child.lua('_G.log = {}') + end + + local children = { 'dir/', 'dir/subdir/' } + for i = 1, 6 do + table.insert(children, 'dir/subdir/file-' .. i) + end + local temp_dir = make_temp_dir('temp', children) + + open(temp_dir .. '/dir') + -- Prefix should be computed only for entries that might be visible (first + -- vim.o.cmdheight) + validate_log({ 'file-1', 'file-2', 'file-3', 'file-4', 'file-5', 'subdir' }) + + -- Prefix should be recomputed for all entries *only* if the path is focused + go_out() + validate_log({ 'dir' }) + + go_in() + validate_log({}) + + -- - Synchronization should also not force recomputation on **all** entries + type_keys('o', 'new-file', '', 'k') + mock_confirm(1) + child.lua('MiniFiles.synchronize()') + validate_log({ 'dir', 'file-1', 'file-2', 'file-3', 'file-4', 'file-5', 'new-file', 'subdir' }) + + child.lua('_G.scandir_log = {}') + go_in() + -- - Only focus should result into prefix recomputation on all entries + validate_log({ 'file-1', 'file-2', 'file-3', 'file-4', 'file-5', 'file-6' }) + -- - Should also not result in additional disk read + eq(child.lua_get('_G.scandir_log'), {}) +end + T['open()']['respects `content.sort`'] = function() child.lua([[ _G.sort_arg = {} @@ -822,7 +903,7 @@ T['open()']['properly closes currently opened explorer'] = function() local path_1, path_2 = make_test_path('common'), make_test_path('common/a-dir') open(path_1) go_in() - validate_n_wins(3) + eq(is_explorer_active(), true) -- Should properly close current opened explorer (at least save to history) open(path_2) @@ -854,10 +935,11 @@ T['open()']['tracks lost focus'] = function() local validate = function(loose_focus) open(test_dir_path) + child.cmd('redraw') loose_focus() -- Tracking is done by checking every second - sleep(1000 + 20) - validate_n_wins(1) + sleep(track_lost_focus_delay + small_time) + eq(is_explorer_active(), false) eq(#child.api.nvim_list_bufs(), 1) end @@ -873,7 +955,7 @@ T['open()']['tracks lost focus'] = function() -- Should still be possible to open same explorer afterwards open(test_dir_path) - validate_n_wins(3) + eq(is_explorer_active(), true) end T['open()']['validates input'] = function() @@ -986,7 +1068,7 @@ end T['refresh()']['works when no explorer is opened'] = function() expect.no_error(refresh) end --- More extensive testing is done in 'File Manipulation' +-- More extensive testing is done in 'File manipulation' T['synchronize()'] = new_set() local synchronize = forward_lua('MiniFiles.synchronize') @@ -1013,10 +1095,10 @@ T['synchronize()']['can apply file system actions'] = function() local new_file_path = join_path(temp_dir, 'new-file') mock_confirm(1) - validate_no_file(new_file_path) + validate_tree(temp_dir, {}) synchronize() - validate_file(new_file_path) + validate_tree(temp_dir, { 'new-file' }) end T['synchronize()']['should follow cursor on current entry path'] = function() @@ -1116,7 +1198,7 @@ T['close()']['works'] = function() child.expect_screenshot() -- Should close all windows and delete all buffers - validate_n_wins(1) + eq(is_explorer_active(), false) eq(#child.api.nvim_list_bufs(), 1) end @@ -1211,7 +1293,7 @@ T['go_in()']['works on file'] = function() eq(get_lines(), { '.a-file' }) -- Should open with relative path to have better view in `:buffers` - expect.match(child.cmd_capture('buffers'), '"' .. vim.pesc(test_dir_path)) + expect.match(child.cmd_capture('buffers'):gsub('\\', '/'), '"' .. vim.pesc(test_dir_path)) end T['go_in()']['respects `opts.close_on_file`'] = function() @@ -1221,13 +1303,13 @@ T['go_in()']['respects `opts.close_on_file`'] = function() expect.match(child.api.nvim_buf_get_name(0), '%.a%-file$') eq(get_lines(), { '.a-file' }) - validate_n_wins(1) + eq(is_explorer_active(), false) end T['go_in()']['works on files with problematic names'] = function() local bad_name = '%a bad-file-name' local temp_dir = make_temp_dir('temp', { bad_name }) - vim.fn.writefile({ 'aaa' }, join_path(temp_dir, bad_name)) + child.fn.writefile({ 'aaa' }, join_path(temp_dir, bad_name)) open(temp_dir) go_in() @@ -1299,6 +1381,41 @@ end T['go_in()']['works when no explorer is opened'] = function() expect.no_error(go_in) end +T['go_in()']['warns about paths not present on disk'] = function() + local validate_log = function(msg_pattern) + local notify_log = child.lua_get('_G.notify_log') + eq(#notify_log, 1) + expect.match(notify_log[1][1], msg_pattern) + eq(notify_log[1][2], child.lua_get('vim.log.levels.WARN')) + child.lua('_G.notify_log = {}') + end + + open(test_dir_path) + + -- Modified line without synchronization + type_keys('O', 'new-file', '') + go_in() + validate_log('Line "new%-file".*Did you modify without synchronization%?') + + -- Entry which doesn't exist on disk + child.lua([[ + local get_fs_entry_orig = MiniFiles.get_fs_entry + MiniFiles.get_fs_entry = function(...) + local res = get_fs_entry_orig(...) + res.fs_type = nil + return res + end + ]]) + type_keys('j') + go_in() + validate_log('Path .* is not present on disk%.$') + + -- Entry with possibly miscreated symlink + child.lua('vim.fn.resolve = function() return "miscreated-symlink" end') + go_in() + validate_log('Path.*is not present on disk.*miscreated symlink %(resolved to miscreated%-symlink%)') +end + T['go_out()'] = new_set() T['go_out()']['works on not branch root'] = function() @@ -1476,7 +1593,7 @@ T['show_help()'] = new_set() local show_help = forward_lua('MiniFiles.show_help') T['show_help()']['works'] = function() - child.set_size(20, 60) + child.set_size(22, 60) open(test_dir_path) local win_id_explorer = child.api.nvim_get_current_win() @@ -1494,7 +1611,7 @@ T['show_help()']['works'] = function() end T['show_help()']['opens relatively current window'] = function() - child.set_size(20, 60) + child.set_size(22, 60) child.lua('MiniFiles.config.windows.width_focus = 30') open(test_dir_path) @@ -1505,7 +1622,7 @@ T['show_help()']['opens relatively current window'] = function() end T['show_help()']['handles non-default mappings'] = function() - child.set_size(20, 60) + child.set_size(22, 60) child.lua('MiniFiles.config.mappings.go_in = ""') child.lua('MiniFiles.config.mappings.go_in_plus = "l"') @@ -1515,7 +1632,7 @@ T['show_help()']['handles non-default mappings'] = function() end T['show_help()']['handles mappings without description'] = function() - child.set_size(20, 60) + child.set_size(22, 60) open(test_dir_path) child.lua([[vim.keymap.set('n', 'g.', 'echo 1', { buffer = vim.api.nvim_get_current_buf() })]]) @@ -1523,8 +1640,31 @@ T['show_help()']['handles mappings without description'] = function() child.expect_screenshot() end +T['show_help()']['handles bookmarks'] = function() + child.set_size(30, 60) + open(test_dir_path) + local root = full_path(test_dir) + -- Relative (should use path as is) + set_bookmark('a', test_dir) + -- With description + set_bookmark('b', root .. '/common', { desc = 'Desc' }) + -- Not normalized + set_bookmark('~', '~') + child.lua([[ + -- Function without description (should be called and use output) + MiniFiles.set_bookmark('c', function() return '~/' end) + -- Function with description + MiniFiles.set_bookmark('d', vim.fn.getcwd, { desc = 'Cwd' }) + ]]) + -- Long description + set_bookmark('e', root .. '/nested', { desc = 'Should use these to adjust width' }) + + show_help() + child.expect_screenshot() +end + T['show_help()']['adjusts window width'] = function() - child.set_size(20, 60) + child.set_size(22, 60) child.lua('MiniFiles.config.mappings.go_in = ""') open(test_dir_path) @@ -1574,6 +1714,131 @@ T['get_fs_entry()']['validates input'] = function() expect.error(function() get_fs_entry(0, 1000) end, 'line.*valid line number in buffer %d') end +T['get_explorer_state()'] = new_set() + +T['get_explorer_state()']['works'] = function() + child.cmd('belowright vertical split') + local ref_target_win = child.api.nvim_get_current_win() + local anchor = full_path(test_dir_path) + + open(anchor) + local win_1 = child.api.nvim_get_current_win() + local path_2 = get_fs_entry().path + go_in() + local win_2 = child.api.nvim_get_current_win() + + set_bookmark('a', anchor, { desc = 'Anchor' }) + + local ref_branch = { anchor, path_2 } + local ref_windows = { { win_id = win_1, path = anchor }, { win_id = win_2, path = path_2 } } + local ref_state = { + anchor = anchor, + bookmarks = { a = { path = anchor, desc = 'Anchor' } }, + branch = ref_branch, + depth_focus = 2, + target_window = ref_target_win, + windows = ref_windows, + } + eq(get_explorer_state(), ref_state) +end + +T['get_explorer_state()']['works with preview'] = function() + child.lua('MiniFiles.config.windows.preview = true') + local ref_target_win = child.api.nvim_get_current_win() + local anchor = full_path(test_dir_path) + + open(anchor) + local win_cur = child.api.nvim_get_current_win() + local path_preview = get_fs_entry().path + local win_preview + for _, win_id in ipairs(child.api.nvim_list_wins()) do + if win_id ~= ref_target_win and win_id ~= win_cur then win_preview = win_id end + end + + -- Should show preview as window entry + local ref_branch = { anchor, path_preview } + local ref_windows = { { win_id = win_cur, path = anchor }, { win_id = win_preview, path = path_preview } } + local ref_state = { + anchor = anchor, + bookmarks = {}, + branch = ref_branch, + depth_focus = 1, + target_window = ref_target_win, + windows = ref_windows, + } + eq(get_explorer_state(), ref_state) +end + +T['get_explorer_state()']['works when explorer is opened with file path'] = function() + child.lua('MiniFiles.config.windows.preview = true') + local file_full = full_path(test_file_path) + local file_parent_dir = file_full:gsub('[\\/][^\\/]-$', '') + + open(file_full) + local state = get_explorer_state() + + -- Anchor is always a directory path, parent directory of a file in this case + eq(state.anchor, file_parent_dir) + + -- Should include file path in branch + eq(state.branch, { file_parent_dir, file_full }) + eq(state.depth_focus, 1) + + -- Should show file preview as window entry + eq(vim.tbl_map(function(x) return x.path end, state.windows), { file_parent_dir, file_full }) +end + +T['get_explorer_state()']['works when branch is not fully visible'] = function() + child.set_size(10, 40) + child.lua('MiniFiles.config.windows.width_focus = 35') + + local test_path = make_test_path('nested') + open(test_path) + go_in() + go_in() + + local ref_branch = { test_path, test_path .. '/dir-1', test_path .. '/dir-1/dir-11' } + local validate = function(depth_focus) + local state = get_explorer_state() + eq(state.branch, ref_branch) + eq(state.depth_focus, depth_focus) + eq(state.windows, { { win_id = child.api.nvim_get_current_win(), path = ref_branch[depth_focus] } }) + end + + validate(3) + go_out() + validate(2) + go_out() + validate(1) +end + +T['get_explorer_state()']['returns copy of data'] = function() + open(test_dir_path) + local res = child.lua([[ + local state = MiniFiles.get_explorer_state() + local ref = vim.deepcopy(state) + state.bookmarks.a, state.branch[1], state.windows[1].win_id = -1, -1, -1 + local new_state = MiniFiles.get_explorer_state() + return vim.deep_equal(new_state, ref) + ]]) + eq(res, true) +end + +T['get_explorer_state()']['works when no explorer is opened'] = function() eq(get_explorer_state(), vim.NIL) end + +T['get_explorer_state()']['ensures valid target window'] = function() + local init_win_id = child.api.nvim_get_current_win() + child.cmd('belowright vertical split') + local ref_win_id = child.api.nvim_get_current_win() + + open(test_dir_path) + + eq(get_explorer_state().target_window, ref_win_id) + + child.api.nvim_win_close(ref_win_id, true) + eq(get_explorer_state().target_window, init_win_id) +end + T['get_target_window()'] = new_set() local get_target_window = forward_lua('MiniFiles.get_target_window') @@ -1615,9 +1880,9 @@ T['set_target_window()']['works'] = function() open(test_file_path) - eq(get_target_window(), ref_win_id) + eq(get_explorer_state().target_window, ref_win_id) set_target_window(init_win_id) - eq(get_target_window(), init_win_id) + eq(get_explorer_state().target_window, init_win_id) go_in() eq(is_file_in_buffer(child.api.nvim_win_get_buf(init_win_id), test_file_path), true) @@ -1632,6 +1897,300 @@ T['set_target_window()']['works when no explorer is opened'] = function() expect.no_error(function() set_target_window(child.api.nvim_get_current_win()) end) end +T['set_branch()'] = new_set() + +local set_branch = forward_lua('MiniFiles.set_branch') +local get_branch = function() return child.lua_get('(MiniFiles.get_explorer_state() or {}).branch') end +local get_depth_focus = function() return (get_explorer_state() or {}).depth_focus end + +T['set_branch()']['works'] = function() + child.set_size(12, 30) + child.lua('MiniFiles.config.windows.width_focus = 20') + child.lua('MiniFiles.config.windows.width_nofocus = 10') + child.lua('MiniFiles.config.windows.width_preview = 15') + open() + + local path = full_path(test_dir_path) + set_branch({ path }) + eq(get_branch(), { path }) + eq(get_depth_focus(), 1) + child.expect_screenshot() + + -- More than one path + set_branch({ path, path .. '/a-dir' }) + eq(get_branch(), { path, path .. '/a-dir' }) + -- - Should set default focus on deepest directory + eq(get_depth_focus(), 2) + -- - Should set full branch although it might not be visible fully + child.expect_screenshot() + + -- - Changing instance width should show more of branch + child.set_size(12, 40) + child.expect_screenshot() +end + +T['set_branch()']['works with file path in branch'] = function() + child.lua('MiniFiles.config.windows.width_focus = 20') + child.lua('MiniFiles.config.windows.width_nofocus = 10') + child.lua('MiniFiles.config.windows.width_preview = 15') + child.set_size(12, 40) + local anchor = child.fn.getcwd() + open(anchor) + + local real_dir = make_test_path('real') + set_branch({ real_dir, real_dir .. '/LICENSE' }) + -- Width of 'LICENSE' window is `width_nofocus` because preview is disabled + child.expect_screenshot() + -- - Should show file preview even though preview is not enabled + eq(get_branch(), { real_dir, real_dir .. '/LICENSE' }) + -- - Should set default focus on deepest directory + eq(get_depth_focus(), 1) + -- - Should position cursor on child entry + eq(get_fs_entry().name, 'LICENSE') + + close() + + -- Should use `width_preview` when preview is enabled + child.lua('MiniFiles.config.windows.preview = true') + open(anchor, false) + set_branch({ real_dir, real_dir .. '/LICENSE' }) + child.expect_screenshot() +end + +T['set_branch()']['works with preview'] = function() + child.lua('MiniFiles.config.windows.width_focus = 20') + child.lua('MiniFiles.config.windows.width_nofocus = 10') + child.lua('MiniFiles.config.windows.width_preview = 15') + child.set_size(12, 40) + child.lua('MiniFiles.config.windows.preview = true') + open() + + -- Preview should be applied after setting branch + local path = full_path(test_dir_path) + set_branch({ path }) + eq(get_branch(), { path, get_fs_entry().path }) + eq(get_depth_focus(), 1) + child.expect_screenshot() +end + +T['set_branch()']['works with not absolute paths'] = function() + open() + + -- Using `~` for home directory should be allowed + set_branch({ '~' }) + eq(get_explorer_state().branch, { full_path(child.loop.os_homedir()) }) + + -- Relative paths should be resolved against current working directory + local nested = make_test_path('nested') + child.fn.chdir(nested) + set_branch({ '.', './dir-1' }) + eq(get_explorer_state().branch, { nested, nested .. '/dir-1' }) + + -- The ".." should also be resolved (but supported only on Neovim>=0.10) + if child.fn.has('nvim-0.10') == 1 then + set_branch({ '..' }) + eq(get_explorer_state().branch, { full_path(test_dir) }) + end +end + +T['set_branch()']['sets cursors on child entries'] = function() + child.set_size(12, 180) + local root = full_path(test_dir) + local root_parent = child.fn.fnamemodify(root, ':h') + + open(root_parent) + local branch = { root, root .. '/nested', root .. '/nested/dir-1', root .. '/nested/dir-1/dir-12' } + set_branch(branch) + eq(get_branch(), branch) + eq(get_visible_paths(), branch) + + local cursor_lines = vim.tbl_map(function(x) + local lnum = child.api.nvim_win_get_cursor(x.win_id)[1] + return child.fn.getbufline(child.api.nvim_win_get_buf(x.win_id), lnum)[1]:match('[\\/]([^\\/]+)$') + end, get_explorer_state().windows) + eq(cursor_lines, { 'nested', 'dir-1', 'dir-12', 'file-121' }) +end + +T['set_branch()']['respects previously set cursors'] = function() + local nested = make_test_path('nested') + local path = join_path(nested, 'dir-1') + open(path) + type_keys('G') + eq(child.fn.line('.'), 2) + + -- Inside visible window + go_out() + eq(get_visible_paths(), { nested, path }) + set_branch({ path }) + eq(get_branch(), { path }) + eq(child.fn.line('.'), 2) + + -- Not inside visible window + go_out() + go_out() + type_keys('j') + eq(get_visible_paths(), { full_path(test_dir) }) + set_branch({ path }) + eq(get_branch(), { path }) + eq(child.fn.line('.'), 2) +end + +T['set_branch()']['respects `opts.depth_focus`'] = function() + open() + local path = full_path(test_dir_path) + local branch = { path, path .. '/a-dir', path .. '/a-dir/aa-file' } + + local validate = function(depth_focus, ref_depth_focus) + set_branch(branch, { depth_focus = depth_focus }) + eq(get_branch(), branch) + eq(get_depth_focus(), ref_depth_focus) + end + + validate(1, 1) + eq(get_fs_entry().path, path .. '/a-dir') + + -- Should normalize to fit in branch + validate(0, 1) + validate(-math.huge, 1) + + -- - Maximum allowed depth is the depth of deepest directory + validate(10, 2) + validate(math.huge, 2) + + -- - Fractional depth are allowed + validate(1.99, 1) +end + +T['set_branch()']['works when no explorer is opened'] = function() eq(set_branch(full_path(test_dir_path)), vim.NIL) end + +T['set_branch()']['validates input'] = function() + open() + local validate = function(branch, opts, err_pattern) + expect.error(function() set_branch(branch, opts or {}) end, err_pattern) + end + + validate(test_dir, nil, 'array') + validate({}, nil, 'at least one element') + validate({ -1 }, nil, 'not string.*%-1') + validate({ test_dir, -1 }, nil, 'not string.*%-1') + + validate({ test_dir .. '/absent' }, nil, 'not present path.*/absent') + validate({ test_dir, test_dir .. '/absent' }, nil, 'not present path.*/absent') + + validate({ test_dir .. '/common', test_dir }, nil, 'parent%-child') + validate({ test_dir, test_dir .. '/common/a-dir', test_dir .. '/common' }, nil, 'parent%-child') + + validate({ full_path(test_file_path) }, nil, 'one directory') +end + +T['set_bookmark()'] = new_set() + +T['set_bookmark()']['works'] = function() + open() + local root = full_path(test_dir) + local path_a, path_A, path_b = root, root .. '/common', root .. '/lua' + local path_c, path_d = root .. '/nested', root .. '/real' + + set_bookmark('a', path_a) + -- Allows different cases + set_bookmark('A', path_A) + -- Same path under different id + set_bookmark('x', path_a) + -- Allows any single character + set_bookmark('~', '~') + -- Allows description + set_bookmark('b', path_b, { desc = 'Path b' }) + + -- Allows callable path + child.lua([[ + local root = vim.fn.getcwd() .. '/tests/dir-files' + MiniFiles.set_bookmark('c', function() return root .. '/nested' end) + MiniFiles.set_bookmark('d', function() return root .. '/real' end, { desc = 'Path d' }) + ]]) + + local res = child.lua([[ + local bookmarks = MiniFiles.get_explorer_state().bookmarks + for k, v in pairs(bookmarks) do + if vim.is_callable(v.path) then v.path = { 'Callable', (v.path():gsub('\\', '/')) } end + end + return bookmarks + ]]) + + local ref = { + a = { path = path_a }, + A = { path = path_A }, + ['~'] = { path = '~' }, + b = { path = path_b, desc = 'Path b' }, + c = { path = { 'Callable', path_c } }, + d = { path = { 'Callable', path_d }, desc = 'Path d' }, + x = { path = path_a }, + } + eq(res, ref) + + -- Can override bookmarks + set_bookmark('a', path_b, { desc = 'Another path b' }) + eq(child.lua_get('MiniFiles.get_explorer_state().bookmarks.a'), { path = path_b, desc = 'Another path b' }) +end + +T['set_bookmark()']['preserves path as is'] = function() + open() + + -- Relative path + set_bookmark('a', test_dir) + eq(get_explorer_state().bookmarks.a, { path = test_dir }) + + -- Not normalized path + set_bookmark('b', test_dir .. '/common/') + eq(get_explorer_state().bookmarks.b, { path = test_dir .. '/common/' }) + + -- Path with `~` for home directory + set_bookmark('~', '~') + eq(get_explorer_state().bookmarks['~'], { path = '~' }) + + -- Callable + child.lua('MiniFiles.set_bookmark("c", vim.fn.getcwd)') + eq(child.lua_get('MiniFiles.get_explorer_state().bookmarks.c.path()'), child.fn.getcwd()) +end + +T['set_bookmark()']['persists across restart/reset'] = function() + local path = full_path(test_dir_path) + open(path) + go_in() + set_bookmark('a', path .. '/a-dir') + local ref_bookmarks = get_explorer_state().bookmarks + eq(ref_bookmarks.a, { path = path .. '/a-dir' }) + + reset() + eq(get_explorer_state().bookmarks, ref_bookmarks) + + -- Should preserve if opening explorer from history + close() + open(path, true) + eq(get_explorer_state().bookmarks, ref_bookmarks) + close() + + -- Should NOT preserve if opening fresh explorer + open(path, false) + eq(get_explorer_state().bookmarks, {}) +end + +T['set_bookmark()']['works when no explorer is opened'] = function() eq(set_bookmark('a', test_dir), vim.NIL) end + +T['set_bookmark()']['validates input'] = function() + open() + local validate = function(id, path, opts, err_pattern) + expect.error(function() set_bookmark(id, path, opts) end, err_pattern) + end + local path = full_path(test_dir_path) + local path_file = full_path(test_file_path) + + validate(1, path, nil, 'id.*character') + validate('aa', path, nil, 'id.*single') + validate('a', 1, nil, 'path.*valid') + validate('a', path_file, nil, 'path.*directory') + validate('a', path, { desc = 1 }, 'description.*string') +end + T['get_latest_path()'] = new_set() local get_latest_path = forward_lua('MiniFiles.get_latest_path') @@ -1923,6 +2482,38 @@ T['Windows']['never shows past end of buffer'] = function() child.expect_screenshot() end +T['Windows']['restricts manual buffer navigation'] = function() + if child.fn.has('nvim-0.10') == 0 then MiniTest.skip('Window and buffer pairing is available on Neovim>=0.10') end + child.api.nvim_create_buf(true, false) + open(test_dir_path) + validate_n_wins(2) + expect.error(function() child.cmd('bnext') end) + -- Attempting to switch buffer should keep explorer usable + expect.no_error(get_fs_entry) +end + +T['Windows']["do not evaluate 'foldexpr' too much"] = function() + if child.fn.has('nvim-0.10') == 0 then MiniTest.skip('Correct behavior is only on Neovim>=0.10') end + + child.lua('MiniFiles.config.windows.preview = true') + child.lua([[ + _G.n = 0 + _G.foldexpr_count = function() _G.n = _G.n + 1; return 0 end + vim.o.foldmethod = 'expr' + vim.o.foldexpr = 'v:lua.foldexpr_count()' + ]]) + open(test_dir_path) + + -- There still might be evaluations after `open()` because 'foldexpr' seems + -- to be executed even if buffer is not shown in any window + child.lua('_G.n = 0') + type_keys('j') + type_keys('k') + go_in() + go_out() + eq(child.lua_get('_G.n'), 0) +end + T['Preview'] = new_set({ hooks = { pre_case = function() @@ -1981,6 +2572,12 @@ T['Preview']['works for files'] = function() -- Should fall back to built-in syntax highlighting in case of no tree-sitter type_keys('j') expect_screenshot() + + -- Should not error on files which failed to read (looks like on Windows it + -- can be different from "non-readable" files) + child.lua('vim.loop.fs_open = function() return nil end') + type_keys('j') + expect_screenshot() end T['Preview']['does not highlight big files'] = function() @@ -2092,7 +2689,7 @@ T['Preview']['does not result in flicker'] = function() ]]) -- State shown initially should be the same as after some time has passed - sleep(10) + sleep(small_time) eq(child.lua_get('_G.visible_bufs'), child.lua_get('_G.get_visible_bufs()')) end @@ -2113,24 +2710,24 @@ T['Mappings'] = new_set() T['Mappings']['`close` works'] = function() -- Default open(test_dir_path) - validate_n_wins(2) + eq(is_explorer_active(), true) type_keys('q') - validate_n_wins(1) + eq(is_explorer_active(), false) close() -- User-supplied open(test_dir_path, false, { mappings = { close = 'Q' } }) - validate_n_wins(2) + eq(is_explorer_active(), true) type_keys('Q') - validate_n_wins(1) + eq(is_explorer_active(), false) close() -- Empty open(test_dir_path, false, { mappings = { close = '' } }) - validate_n_wins(2) + eq(is_explorer_active(), true) -- - Needs second `q` to unblock child process after built-in `q` type_keys('q', 'q') - validate_n_wins(2) + eq(is_explorer_active(), true) end T['Mappings']['`go_in` works'] = function() @@ -2389,29 +2986,177 @@ T['Mappings']['`go_out_plus` supports '] = function() child.expect_screenshot() end +T['Mappings']['`mark_goto` works'] = function() + local validate_log = function(ref_log) + eq(child.lua_get('_G.notify_log'), ref_log) + child.lua('_G.notify_log = {}') + end + local warn_level = child.lua_get('vim.log.levels.WARN') + + local path = full_path(test_dir_path) + local mark_path = path .. '/a-dir' + open(path) + set_bookmark('a', mark_path) + go_out() + expect.no_equality(get_branch(), { mark_path }) + type_keys("'", 'a') + eq(get_branch(), { mark_path }) + -- - Should show no notifications + validate_log({}) + + -- Warns about not existing bookmark id + go_out() + local ref_branch = get_branch() + type_keys("'", 'x') + eq(get_branch(), ref_branch) + validate_log({ { '(mini.files) No bookmark with id "x"', warn_level } }) + + -- Does nothing (silently) after `` or `` + type_keys("'", '') + eq(get_branch(), ref_branch) + validate_log({}) + type_keys("'", '') + eq(get_branch(), ref_branch) + validate_log({}) + + close() + + -- User-supplied + open(path, false, { mappings = { mark_goto = '`' } }) + set_bookmark('a', mark_path) + go_out() + type_keys('`', 'a') + eq(get_branch(), { mark_path }) + close() + + -- Empty + open(path, false, { mappings = { mark_goto = '' } }) + set_bookmark('a', mark_path) + go_out() + expect.error(function() type_keys("'", 'a') end, 'E20') +end + +T['Mappings']["`mark_goto` automatically sets `'` bookmark"] = function() + local get_cur_path = function() + local state = get_explorer_state() + return state.branch[state.depth_focus] + end + + local path = full_path(test_dir_path) + local mark_path = path .. '/a-dir' + open(path) + set_bookmark('a', mark_path) + + go_out() + local path_before_jump = get_cur_path() + eq(get_explorer_state().bookmarks["'"], nil) + type_keys("'", 'a') + eq(get_branch(), { mark_path }) + eq(get_explorer_state().bookmarks["'"], { desc = 'Before latest jump', path = path_before_jump }) + + type_keys("'", "'") + eq(get_branch(), { path_before_jump }) + eq(get_explorer_state().bookmarks["'"], { desc = 'Before latest jump', path = mark_path }) +end + +T['Mappings']['`mark_goto` works with special paths'] = function() + local validate_log = function(ref_log) + eq(child.lua_get('_G.notify_log'), ref_log) + child.lua('_G.notify_log = {}') + end + local warn_level = child.lua_get('vim.log.levels.WARN') + local cwd = child.fn.getcwd():gsub('\\', '/') + + local path = full_path(test_dir_path) + open(path) + + -- Relative paths (should be resolved against cwd, not currently focused) + local path_rel = test_dir_path .. '/a-dir' + set_bookmark('a', path_rel) + type_keys("'", 'a') + eq(get_branch(), { full_path(path_rel) }) + + -- Involving '~' + set_bookmark('~', '~') + type_keys("'", '~') + expect.no_equality(get_branch(), { full_path(path_rel) }) + validate_log({}) + + -- Function paths + child.lua([[MiniFiles.set_bookmark('b', vim.fn.getcwd)]]) + type_keys("'", 'b') + eq(get_branch(), { cwd }) + + -- Not existing on disk + child.lua([[MiniFiles.set_bookmark('c', function() return vim.fn.getcwd() .. '/not-present' end)]]) + type_keys("'", 'c') + eq(get_branch(), { cwd }) + validate_log({ { '(mini.files) Bookmark path should be a valid path to directory', warn_level } }) + + -- Not directory path + child.lua('_G.file_path = ' .. vim.inspect(full_path(test_file_path))) + child.lua([[MiniFiles.set_bookmark('d', function() return _G.file_path end)]]) + type_keys("'", 'd') + eq(get_branch(), { cwd }) + validate_log({ { '(mini.files) Bookmark path should be a valid path to directory', warn_level } }) +end + +T['Mappings']['`mark_set` works'] = function() + local path = full_path(test_dir_path) + open(path) + local mark_path = get_fs_entry().path + go_in() + type_keys('m', 'a') + local ref_bookmarks = { a = { path = mark_path } } + eq(get_explorer_state().bookmarks, ref_bookmarks) + + -- - Should show notification + local info_level = child.lua_get('vim.log.levels.INFO') + eq(child.lua_get('_G.notify_log'), { { '(mini.files) Bookmark "a" is set', info_level } }) + + -- Does nothing after `` or `` + type_keys('m', '') + eq(get_explorer_state().bookmarks, ref_bookmarks) + type_keys('m', '') + eq(get_explorer_state().bookmarks, ref_bookmarks) + + close() + + -- User-supplied + open(path, false, { mappings = { mark_set = 'M' } }) + go_in() + type_keys('M', 'a') + eq(get_explorer_state().bookmarks, ref_bookmarks) + close() + + -- Empty + open(path, false, { mappings = { mark_set = '' } }) + go_in() + type_keys('m', 'a') + eq(get_explorer_state().bookmarks, {}) +end + T['Mappings']['`reset` works'] = function() local prepare = function(...) close() open(...) type_keys('j') go_in() + validate_n_wins(3) end -- Default prepare(test_dir_path) - validate_n_wins(3) type_keys('') child.expect_screenshot() -- User-supplied prepare(test_dir_path, false, { mappings = { reset = 'Q' } }) - validate_n_wins(3) type_keys('Q') child.expect_screenshot() -- Empty prepare(test_dir_path, false, { mappings = { reset = '' } }) - validate_n_wins(3) type_keys('') child.expect_screenshot() end @@ -2449,11 +3194,10 @@ T['Mappings']['`reveal_cwd` works'] = function() end T['Mappings']['`show_help` works'] = function() - child.set_size(20, 60) + child.set_size(22, 60) -- Default open(test_dir_path) - validate_n_wins(2) type_keys('g?') child.expect_screenshot() type_keys('q') @@ -2461,7 +3205,6 @@ T['Mappings']['`show_help` works'] = function() -- User-supplied open(test_dir_path, false, { mappings = { show_help = 'Q' } }) - validate_n_wins(2) type_keys('Q') child.expect_screenshot() type_keys('q') @@ -2469,7 +3212,6 @@ T['Mappings']['`show_help` works'] = function() -- Empty open(test_dir_path, false, { mappings = { show_help = '' } }) - validate_n_wins(2) type_keys('g?') child.expect_screenshot() end @@ -2567,16 +3309,12 @@ T['File manipulation']['can create'] = function() synchronize() child.expect_screenshot() - validate_file(temp_dir, 'new-file') - validate_directory(temp_dir, 'new-dir') + validate_tree(temp_dir, { 'new-file', 'new-dir/' }) - local ref_pattern = make_plain_pattern( - 'CONFIRM FILE SYSTEM ACTIONS', - short_path(temp_dir) .. ':', - [[ CREATE: 'new-file' (file)]], - [[ CREATE: 'new-dir' (directory)]] - ) + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') validate_confirm_args(ref_pattern) + validate_confirm_args(' CREATE │ new%-file %(file%)') + validate_confirm_args(' CREATE │ new%-dir %(directory%)') end T['File manipulation']['create does not override existing entry'] = function() @@ -2594,9 +3332,8 @@ T['File manipulation']['create does not override existing entry'] = function() synchronize() child.expect_screenshot() - validate_file(file_path) + validate_tree(temp_dir, { 'dir/', 'dir/subfile', 'file' }) validate_file_content(file_path, { 'File' }) - validate_file(temp_dir, 'dir', 'subfile') -- Should show warning local warn_level = child.lua_get('vim.log.levels.WARN') @@ -2622,25 +3359,16 @@ T['File manipulation']['creates files in nested directories'] = function() synchronize() child.expect_screenshot() - validate_file(temp_dir, 'dir', 'nested-file') - validate_directory(temp_dir, 'dir-1') - validate_file(temp_dir, 'dir-1', 'nested-file-1') - validate_file(temp_dir, 'dir-1', 'nested-file-2') + validate_tree(temp_dir, { 'dir/', 'dir/nested-file', 'dir-1/', 'dir-1/nested-file-1', 'dir-1/nested-file-2' }) -- Validate separately because order is not guaranteed - local ref_pattern_1 = make_plain_pattern( - 'CONFIRM FILE SYSTEM ACTIONS', - short_path(temp_dir) .. '/dir' .. ':', - [[ CREATE: 'nested-file' (file)]] - ) - validate_confirm_args(ref_pattern_1) + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') + validate_confirm_args(ref_pattern) - local ref_pattern_2 = make_plain_pattern( - short_path(temp_dir) .. '/dir-1' .. ':', - [[ CREATE: 'nested-file-1' (file)]], - [[ CREATE: 'nested-file-2' (file)]] - ) - validate_confirm_args(ref_pattern_2) + -- - Should show paths relative to directory where manipulation was registered + validate_confirm_args(' CREATE │ dir/nested%-file %(file%)') + validate_confirm_args(' CREATE │ dir%-1/nested%-file%-1 %(file%)') + validate_confirm_args(' CREATE │ dir%-1/nested%-file%-2 %(file%)') end T['File manipulation']['creates nested directories'] = function() @@ -2658,25 +3386,16 @@ T['File manipulation']['creates nested directories'] = function() synchronize() child.expect_screenshot() - validate_directory(temp_dir, 'dir', 'nested-dir') - validate_directory(temp_dir, 'dir-1') - validate_directory(temp_dir, 'dir-1', 'nested-dir-1') - validate_directory(temp_dir, 'dir-1', 'nested-dir-2') + validate_tree(temp_dir, { 'dir/', 'dir/nested-dir/', 'dir-1/', 'dir-1/nested-dir-1/', 'dir-1/nested-dir-2/' }) -- Validate separately because order is not guaranteed - local ref_pattern_1 = make_plain_pattern( - 'CONFIRM FILE SYSTEM ACTIONS', - short_path(temp_dir) .. '/dir' .. ':', - [[ CREATE: 'nested-dir' (directory)]] - ) - validate_confirm_args(ref_pattern_1) + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') + validate_confirm_args(ref_pattern) - local ref_pattern_2 = make_plain_pattern( - short_path(temp_dir) .. '/dir-1' .. ':', - [[ CREATE: 'nested-dir-1' (directory)]], - [[ CREATE: 'nested-dir-2' (directory)]] - ) - validate_confirm_args(ref_pattern_2) + -- - Should show paths relative to directory where manipulation was registered + validate_confirm_args(' CREATE │ dir/nested%-dir %(directory%)') + validate_confirm_args(' CREATE │ dir%-1/nested%-dir%-1 %(directory%)') + validate_confirm_args(' CREATE │ dir%-1/nested%-dir%-2 %(directory%)') end T['File manipulation']['can delete'] = function() @@ -2691,17 +3410,15 @@ T['File manipulation']['can delete'] = function() synchronize() child.expect_screenshot() - validate_no_file(temp_dir, 'file') - validate_no_directory(temp_dir, 'empty-dir') - validate_no_directory(temp_dir, 'dir') + validate_tree(temp_dir, {}) -- Validate separately because order is not guaranteed - local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. ':') + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') validate_confirm_args(ref_pattern) - validate_confirm_args([[ DELETE: 'dir']]) - validate_confirm_args([[ DELETE: 'empty%-dir']]) - validate_confirm_args([[ DELETE: 'file']]) + validate_confirm_args(' DELETE │ dir %(permanently%)') + validate_confirm_args(' DELETE │ empty%-dir %(permanently%)') + validate_confirm_args(' DELETE │ file %(permanently%)') end T['File manipulation']['delete respects `options.permanent_delete`'] = function() @@ -2715,22 +3432,18 @@ T['File manipulation']['delete respects `options.permanent_delete`'] = function( child.lua('MiniFiles.config.options.permanent_delete = false') local temp_dir = make_temp_dir('temp', { 'file', 'dir/', 'dir/subfile' }) - local validate_move_delete = function() - -- Should move into special trash directory - validate_no_file(temp_dir, 'file') - validate_no_directory(temp_dir, 'dir') - validate_file(trash_dir, 'file') - validate_directory(trash_dir, 'dir') - validate_file(trash_dir, 'dir', 'subfile') - end - open(temp_dir) type_keys('VGd') mock_confirm(1) synchronize() - validate_move_delete() + -- Should move into special trash directory + validate_tree(temp_dir, {}) + validate_tree(trash_dir, { 'dir/', 'dir/subfile', 'file' }) + + validate_confirm_args(' DELETE │ file %(to trash%)') + validate_confirm_args(' DELETE │ dir %(to trash%)') -- Deleting entries again with same name should replace previous ones -- - Recreate previously deleted entries with different content @@ -2746,13 +3459,42 @@ T['File manipulation']['delete respects `options.permanent_delete`'] = function( mock_confirm(1) synchronize() - validate_move_delete() + validate_tree(temp_dir, {}) + validate_tree(trash_dir, { 'dir/', 'dir/subfile', 'file' }) -- - Check that files actually were replaced validate_file_content(join_path(trash_dir, 'file'), { 'New file' }) validate_file_content(join_path(trash_dir, 'dir', 'subfile'), { 'New subfile' }) end +T['File manipulation']['can move to trash across devices'] = function() + child.set_size(10, 60) + + local data_dir = mock_stdpath_data() + local trash_dir = join_path(data_dir, 'mini.files', 'trash') + child.lua('MiniFiles.config.options.permanent_delete = false') + + -- Mock `vim.loop.fs_rename()` not working across devices/volumes/partitions + child.lua('vim.loop.fs_rename = function() return nil, "EXDEV: cross-device link not permitted:", "EXDEV" end') + + local temp_dir = make_temp_dir('temp', { 'file', 'dir/', 'dir/nested/', 'dir/nested/file' }) + open(temp_dir) + + -- Write lines in moved files to check "copy-delete" and not "create-delete" + child.fn.writefile({ 'File' }, join_path(temp_dir, 'file')) + child.fn.writefile({ 'File nested' }, join_path(temp_dir, 'dir', 'nested', 'file')) + + type_keys('dG') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, {}) + validate_tree(trash_dir, { 'dir/', 'dir/nested/', 'dir/nested/file', 'file' }) + + validate_file_content(join_path(trash_dir, 'file'), { 'File' }) + validate_file_content(join_path(trash_dir, 'dir', 'nested', 'file'), { 'File nested' }) +end + T['File manipulation']['can rename'] = function() local temp_dir = make_temp_dir('temp', { 'file', 'dir/' }) open(temp_dir) @@ -2765,17 +3507,14 @@ T['File manipulation']['can rename'] = function() synchronize() child.expect_screenshot() - validate_no_file(temp_dir, 'file') - validate_file(temp_dir, 'file-new') - validate_no_directory(temp_dir, 'dir') - validate_directory(temp_dir, 'new-dir') + validate_tree(temp_dir, { 'file-new', 'new-dir/' }) -- Validate separately because order is not guaranteed - local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. ':') + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') validate_confirm_args(ref_pattern) - validate_confirm_args([[ RENAME: 'dir' to 'new%-dir']]) - validate_confirm_args([[ RENAME: 'file' to 'file%-new']]) + validate_confirm_args(' RENAME │ dir => new%-dir') + validate_confirm_args(' RENAME │ file => file%-new') end T['File manipulation']['rename does not override existing entry'] = function() @@ -2855,8 +3594,8 @@ T['File manipulation']['renames even if lines are rearranged'] = function() mock_confirm(1) synchronize() - validate_confirm_args([[RENAME: 'file%-2' to 'new%-file%-2']]) - validate_confirm_args([[RENAME: 'file%-1' to 'new%-file%-1']]) + validate_confirm_args('RENAME │ file%-2 => new%-file%-2') + validate_confirm_args('RENAME │ file%-1 => new%-file%-1') end T['File manipulation']['rename works again after undo'] = function() @@ -2869,13 +3608,12 @@ T['File manipulation']['rename works again after undo'] = function() mock_confirm(1) synchronize() - validate_no_file(temp_dir, 'file') - validate_file(temp_dir, 'file-new') + validate_tree(temp_dir, { 'file-new' }) -- Validate confirmation messages - local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. ':') + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') validate_confirm_args(ref_pattern) - validate_confirm_args([[ RENAME: 'file' to 'file%-new']]) + validate_confirm_args(' RENAME │ file => file%-new') -- Undo and synchronize should cleanly rename back type_keys('u', 'u') @@ -2884,9 +3622,8 @@ T['File manipulation']['rename works again after undo'] = function() mock_confirm(1) synchronize() - validate_confirm_args([[ RENAME: 'file%-new' to 'file']]) - validate_file(temp_dir, 'file') - validate_no_file(temp_dir, 'file-new') + validate_tree(temp_dir, { 'file' }) + validate_confirm_args(' RENAME │ file%-new => file') end T['File manipulation']['can move file'] = function() @@ -2906,18 +3643,14 @@ T['File manipulation']['can move file'] = function() synchronize() child.expect_screenshot() - validate_no_file(temp_dir, 'file') - validate_file(temp_dir, 'dir', 'file') + validate_tree(temp_dir, { 'dir/', 'dir/file' }) validate_file_content(join_path(temp_dir, 'dir', 'file'), { 'File' }) -- Validate separately because order is not guaranteed - local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. ':') + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') validate_confirm_args(ref_pattern) - - -- - Target path should be absolute but can with `~` for home directory - local target_path = short_path(temp_dir, 'dir', 'file') - local ref_pattern_2 = string.format([[ MOVE: 'file' to '%s']], vim.pesc(target_path)) - validate_confirm_args(ref_pattern_2) + -- - Target path should be relative to group directory + validate_confirm_args(' MOVE │ file => dir/file') end T['File manipulation']['can move directory'] = function() @@ -2936,17 +3669,32 @@ T['File manipulation']['can move directory'] = function() synchronize() child.expect_screenshot() - validate_no_directory(temp_dir, 'dir') - validate_directory(temp_dir, 'dir-target', 'dir') + --stylua: ignore + local ref_tree = { + 'dir-target/', + 'dir-target/dir/', 'dir-target/dir/file', + 'dir-target/dir/nested/', 'dir-target/dir/nested/file', + } + validate_tree(temp_dir, ref_tree) validate_file_content(join_path(temp_dir, 'dir-target', 'dir', 'file'), { 'File' }) - local target_path = short_path(temp_dir, 'dir-target', 'dir') - local ref_pattern = make_plain_pattern( - 'CONFIRM FILE SYSTEM ACTIONS', - short_path(temp_dir) .. ':', - string.format([[ MOVE: 'dir' to '%s']], target_path) - ) + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') validate_confirm_args(ref_pattern) + validate_confirm_args(' MOVE │ dir => dir%-target/dir') +end + +T['File manipulation']['move can show not relative "to" path'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + + -- Perform manipulation + type_keys('dd') + go_out() + type_keys('P') + mock_confirm(1) + synchronize() + + validate_confirm_args(' MOVE │ file => ' .. vim.pesc(short_path(temp_dir, 'file'))) end T['File manipulation']['move does not override existing entry'] = function() @@ -2991,10 +3739,9 @@ T['File manipulation']['handles move directory inside itself'] = function() synchronize() child.expect_screenshot() - validate_directory(temp_dir, 'dir') - validate_no_directory(temp_dir, 'dir', 'nested', 'dir') + validate_tree(temp_dir, { 'dir/', 'dir/file', 'dir/nested/' }) - validate_confirm_args([[ MOVE: 'dir' to '.*dir/nested/dir']]) + validate_confirm_args(' MOVE │ dir => dir/nested/dir') end T['File manipulation']['can move while changing basename'] = function() @@ -3016,14 +3763,10 @@ T['File manipulation']['can move while changing basename'] = function() synchronize() child.expect_screenshot() - validate_no_file(temp_dir, 'file') - validate_file(temp_dir, 'dir', 'new-file') + validate_tree(temp_dir, { 'dir/', 'dir/new-file' }) validate_file_content(join_path(temp_dir, 'dir', 'new-file'), { 'File' }) - -- - Target path should be absolute but can with `~` for home directory - local target_path = short_path(temp_dir, 'dir', 'new-file') - local ref_pattern_2 = string.format([[ MOVE: 'file' to '%s']], vim.pesc(target_path)) - validate_confirm_args(ref_pattern_2) + validate_confirm_args(' MOVE │ file => dir/new%-file') end T['File manipulation']['can move inside new directory'] = function() @@ -3043,9 +3786,39 @@ T['File manipulation']['can move inside new directory'] = function() synchronize() child.expect_screenshot() - validate_no_file(temp_dir, 'file') - validate_file(temp_dir, 'new-dir', 'new-subdir', 'file') + validate_tree(temp_dir, { 'new-dir/', 'new-dir/new-subdir/', 'new-dir/new-subdir/file' }) validate_file_content(join_path(temp_dir, 'new-dir', 'new-subdir', 'file'), { 'File' }) + + local ref_pattern = make_plain_pattern(short_path(temp_dir) .. '\n') + validate_confirm_args(ref_pattern) + validate_confirm_args(' MOVE │ file => new%-dir/new%-subdir/file') +end + +T['File manipulation']['can move across devices'] = function() + child.set_size(10, 60) + + -- Mock `vim.loop.fs_rename()` not working across devices/volumes/partitions + child.lua('vim.loop.fs_rename = function() return nil, "EXDEV: cross-device link not permitted:", "EXDEV" end') + + local tmp_children = { 'dir/', 'dir/file', 'dir/nested/', 'dir/nested/sub/', 'dir/nested/sub/file' } + local temp_dir = make_temp_dir('temp', tmp_children) + open(temp_dir) + + -- Write lines in moved files to check "copy-delete" and not "create-delete" + child.fn.writefile({ 'File' }, join_path(temp_dir, 'dir', 'file')) + child.fn.writefile({ 'File nested' }, join_path(temp_dir, 'dir', 'nested', 'sub', 'file')) + + go_in() + type_keys('dG') + go_out() + type_keys('P') + + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'dir/', 'file', 'nested/', 'nested/sub/', 'nested/sub/file' }) + validate_file_content(join_path(temp_dir, 'file'), { 'File' }) + validate_file_content(join_path(temp_dir, 'nested', 'sub', 'file'), { 'File nested' }) end T['File manipulation']['move works again after undo'] = function() @@ -3061,34 +3834,27 @@ T['File manipulation']['move works again after undo'] = function() mock_confirm(1) synchronize() - validate_no_file(temp_dir, 'file') - validate_file(temp_dir, 'dir', 'file') + validate_tree(temp_dir, { 'dir/', 'dir/file' }) -- Validate confirmation messages - local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. ':') + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') validate_confirm_args(ref_pattern) - - -- - Target path should be absolute but can with `~` for home directory - local target_path = short_path(temp_dir, 'dir', 'file') - local ref_pattern_2 = string.format([[ MOVE: 'file' to '%s']], vim.pesc(target_path)) - validate_confirm_args(ref_pattern_2) + validate_confirm_args(' MOVE │ file => dir/file') -- Undos and synchronize should cleanly move back type_keys('u', 'u') go_out() type_keys('u', 'u') + -- - Clear command line + type_keys(':', '') -- - Highlighting is different on Neovim>=0.10 if child.fn.has('nvim-0.10') == 1 then child.expect_screenshot() end mock_confirm(1) synchronize() - validate_file(temp_dir, 'file') - validate_no_file(temp_dir, 'dir', 'file') - - local target_path_2 = short_path(temp_dir, 'file') - local ref_pattern_3 = string.format([[ MOVE: 'file' to '%s']], vim.pesc(target_path_2)) - validate_confirm_args(ref_pattern_3) + validate_tree(temp_dir, { 'dir/', 'file' }) + validate_confirm_args(' MOVE │ file => ' .. vim.pesc(short_path(temp_dir, 'file'))) end T['File manipulation']['can copy file'] = function() @@ -3111,25 +3877,18 @@ T['File manipulation']['can copy file'] = function() synchronize() child.expect_screenshot() - validate_file(temp_dir, 'file') + validate_tree(temp_dir, { 'dir/', 'dir/file', 'file', 'file-copy' }) validate_file_content(join_path(temp_dir, 'file'), { 'File' }) - validate_file(temp_dir, 'dir', 'file') validate_file_content(join_path(temp_dir, 'dir', 'file'), { 'File' }) - validate_file(temp_dir, 'file-copy') validate_file_content(join_path(temp_dir, 'file-copy'), { 'File' }) -- Validate separately because order is not guaranteed - local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. ':') + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') validate_confirm_args(ref_pattern) - -- - Target path should be absolute but can with `~` for home directory - local target_path_1 = short_path(temp_dir, 'dir', 'file') - local ref_pattern_1 = string.format([[ COPY: 'file' to '%s']], vim.pesc(target_path_1)) - validate_confirm_args(ref_pattern_1) - - local target_path_2 = short_path(temp_dir, 'file-copy') - local ref_pattern_2 = string.format([[ COPY: 'file' to '%s']], vim.pesc(target_path_2)) - validate_confirm_args(ref_pattern_2) + -- - Target path should be relative to group directory + validate_confirm_args(' COPY │ file => dir/file') + validate_confirm_args(' COPY │ file => file%-copy') end T['File manipulation']['can copy file inside new directory'] = function() @@ -3150,8 +3909,7 @@ T['File manipulation']['can copy file inside new directory'] = function() synchronize() child.expect_screenshot() - validate_file(temp_dir, 'file') - validate_file(temp_dir, 'new-dir', 'new-subdir', 'file') + validate_tree(temp_dir, { 'file', 'new-dir/', 'new-dir/new-subdir/', 'new-dir/new-subdir/file' }) validate_file_content(join_path(temp_dir, 'new-dir', 'new-subdir', 'file'), { 'File' }) end @@ -3175,31 +3933,25 @@ T['File manipulation']['can copy directory'] = function() synchronize() child.expect_screenshot() - validate_directory(temp_dir, 'dir') + --stylua: ignore + local ref_tree = { + 'dir/', 'dir/file', 'dir/nested/', + 'dir-target/', 'dir-target/dir/', 'dir-target/dir/file', 'dir-target/dir/nested/', + 'dir-copy/', 'dir-copy/file', 'dir-copy/nested/', + } + validate_tree(temp_dir, ref_tree) + validate_file_content(join_path(temp_dir, 'dir', 'file'), { 'File' }) - - validate_directory(temp_dir, 'dir-target', 'dir') - validate_file(temp_dir, 'dir-target', 'dir', 'file') validate_file_content(join_path(temp_dir, 'dir-target', 'dir', 'file'), { 'File' }) - validate_directory(temp_dir, 'dir-target', 'dir', 'nested') - - validate_directory(temp_dir, 'dir-copy') - validate_file(temp_dir, 'dir-copy', 'file') validate_file_content(join_path(temp_dir, 'dir-copy', 'file'), { 'File' }) - validate_directory(temp_dir, 'dir-copy', 'nested') -- Validate separately because order is not guaranteed - local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. ':') + local ref_pattern = make_plain_pattern('CONFIRM FILE SYSTEM ACTIONS', short_path(temp_dir) .. '\n') validate_confirm_args(ref_pattern) - -- - Target path should be absolute but can with `~` for home directory - local target_path_1 = short_path(temp_dir, 'dir-target', 'dir') - local ref_pattern_1 = string.format([[ COPY: 'dir' to '%s']], vim.pesc(target_path_1)) - validate_confirm_args(ref_pattern_1) - - local target_path_2 = short_path(temp_dir, 'dir-copy') - local ref_pattern_2 = string.format([[ COPY: 'dir' to '%s']], vim.pesc(target_path_2)) - validate_confirm_args(ref_pattern_2) + -- - Target path should be relative to group directory + validate_confirm_args(' COPY │ dir => dir%-target/dir') + validate_confirm_args(' COPY │ dir => dir%-copy') end T['File manipulation']['can copy directory inside new directory'] = function() @@ -3220,17 +3972,32 @@ T['File manipulation']['can copy directory inside new directory'] = function() synchronize() child.expect_screenshot() - validate_directory(temp_dir, 'dir') - validate_directory(temp_dir, 'dir', 'nested') - validate_file(temp_dir, 'dir', 'file') - validate_file_content(join_path(temp_dir, 'dir', 'file'), { 'File' }) + --stylua: ignore + local ref_tree = { + 'dir/', 'dir/file', 'dir/nested/', + 'new-dir/', 'new-dir/new-subdir/', + 'new-dir/new-subdir/dir/', 'new-dir/new-subdir/dir/file', 'new-dir/new-subdir/dir/nested/', + } + validate_tree(temp_dir, ref_tree) - validate_directory(temp_dir, 'new-dir', 'new-subdir', 'dir') - validate_directory(temp_dir, 'new-dir', 'new-subdir', 'dir', 'nested') - validate_file(temp_dir, 'new-dir', 'new-subdir', 'dir', 'file') + validate_file_content(join_path(temp_dir, 'dir', 'file'), { 'File' }) validate_file_content(join_path(temp_dir, 'new-dir', 'new-subdir', 'dir', 'file'), { 'File' }) end +T['File manipulation']['copy can show not relative "to" path'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + + -- Perform manipulation + type_keys('yy') + go_out() + type_keys('p') + mock_confirm(1) + synchronize() + + validate_confirm_args(' COPY │ file => ' .. vim.pesc(short_path(temp_dir, 'file'))) +end + T['File manipulation']['copy does not override existing entry'] = function() child.set_size(10, 80) @@ -3272,82 +4039,11 @@ T['File manipulation']['can copy directory inside itself'] = function() synchronize() child.expect_screenshot() - validate_directory(temp_dir, 'dir') + validate_tree(temp_dir, { 'dir/', 'dir/dir/', 'dir/dir/file', 'dir/dir/nested/', 'dir/file', 'dir/nested/' }) validate_file_content(join_path(temp_dir, 'dir', 'file'), { 'File' }) - - validate_directory(temp_dir, 'dir', 'dir') - validate_file(temp_dir, 'dir', 'dir', 'file') validate_file_content(join_path(temp_dir, 'dir', 'dir', 'file'), { 'File' }) - validate_directory(temp_dir, 'dir', 'dir', 'nested') - -- Target path should be absolute but can with `~` for home directory - local target_path = short_path(temp_dir, 'dir', 'dir') - local ref_pattern = string.format([[ COPY: 'dir' to '%s']], vim.pesc(target_path)) - validate_confirm_args(ref_pattern) -end - -T['File manipulation']['handles simultaneous copy and move'] = function() - local temp_dir = make_temp_dir('temp', { 'file', 'dir/' }) - open(temp_dir) - - -- Write lines in copied file to check actual move/copy - child.fn.writefile({ 'File' }, join_path(temp_dir, 'file')) - - -- Perform manipulation - type_keys('j', 'dd') - go_in() - -- - Move - type_keys('V', 'P') - -- - Copy - type_keys('P', 'C', 'file-1', '') - - child.expect_screenshot() - - mock_confirm(1) - synchronize() - child.expect_screenshot() - - validate_no_file(temp_dir, 'file') - validate_file(temp_dir, 'dir', 'file') - validate_file_content(join_path(temp_dir, 'dir', 'file'), { 'File' }) - validate_file(temp_dir, 'dir', 'file-1') - validate_file_content(join_path(temp_dir, 'dir', 'file-1'), { 'File' }) - - -- Validate separately as there is no guarantee which file is copied and - -- which is moved - validate_confirm_args(' COPY:') - validate_confirm_args(' MOVE:') -end - -T['File manipulation']['handles simultaneous copy and rename'] = function() - local temp_dir = make_temp_dir('temp', { 'file' }) - open(temp_dir) - - -- Write lines in copied file to check actual move/copy - child.fn.writefile({ 'File' }, join_path(temp_dir, 'file')) - - -- Perform manipulation - type_keys('yy') - -- - Rename - type_keys('C', 'file-1', '') - -- - Copy - type_keys('"0p', 'C', 'file-2', '') - child.expect_screenshot() - - mock_confirm(1) - synchronize() - child.expect_screenshot() - - validate_no_file(temp_dir, 'file') - validate_file(temp_dir, 'file-1') - validate_file_content(join_path(temp_dir, 'file-1'), { 'File' }) - validate_file(temp_dir, 'file-2') - validate_file_content(join_path(temp_dir, 'file-2'), { 'File' }) - - -- Validate separately as there is no guarantee which file is copied and - -- which is moved - validate_confirm_args(' COPY:') - validate_confirm_args(' RENAME:') + validate_confirm_args(' COPY │ dir => dir/dir') end T['File manipulation']['respects modified hidden buffers'] = function() @@ -3363,7 +4059,7 @@ T['File manipulation']['respects modified hidden buffers'] = function() mock_confirm(1) synchronize() - validate_file(temp_dir, 'dir', 'new-file') + validate_tree(temp_dir, { 'dir/', 'dir/new-file', 'file' }) end T['File manipulation']['can be not confirmed'] = function() @@ -3374,7 +4070,7 @@ T['File manipulation']['can be not confirmed'] = function() mock_confirm(2) synchronize() child.expect_screenshot() - validate_no_file(test_dir_path, 'new-file') + eq(child.fn.filereadable(join_path(test_dir_path, 'new-file')), 0) end T['File manipulation']['can be not confirmed with preview'] = function() @@ -3386,7 +4082,7 @@ T['File manipulation']['can be not confirmed with preview'] = function() mock_confirm(2) synchronize() child.expect_screenshot() - validate_no_file(test_dir_path, 'new-file') + eq(child.fn.filereadable(join_path(test_dir_path, 'new-file')), 0) end T['File manipulation']['works with problematic names'] = function() @@ -3406,14 +4102,11 @@ T['File manipulation']['works with problematic names'] = function() synchronize() if child.fn.has('nvim-0.10') == 1 then child.expect_screenshot() end - validate_no_file(temp_dir, [[a %file-]]) - validate_no_file(temp_dir, 'b file') - validate_file(temp_dir, 'c file') - validate_file(temp_dir, 'd file') + validate_tree(temp_dir, { 'c file', 'd file' }) end T['File manipulation']['handles backslash on Unix'] = function() - if child.lua_get('vim.loop.os_uname().sysname') == 'Windows_NT' then MiniTest.skip('Test is not for Windows.') end + if child.loop.os_uname().sysname == 'Windows_NT' then MiniTest.skip('Test is not for Windows.') end local temp_dir = make_temp_dir('temp', { '\\', 'hello\\', 'wo\\rld' }) open(temp_dir) @@ -3431,10 +4124,7 @@ T['File manipulation']['handles backslash on Unix'] = function() synchronize() if child.fn.has('nvim-0.10') == 1 then child.expect_screenshot() end - validate_no_file(temp_dir, [[\]]) - validate_no_file(temp_dir, [[hello\]]) - validate_file(temp_dir, 'new-hello') - validate_file(temp_dir, [[bad\file]]) + validate_tree(temp_dir, { 'bad\\file', 'new-hello', 'wo\\rld' }) end T['File manipulation']['ignores blank lines'] = function() @@ -3457,6 +4147,630 @@ T['File manipulation']['ignores identical user-copied entries'] = function() child.expect_screenshot() end +T['File manipulation']['special cases'] = new_set() + +T['File manipulation']['special cases']['freed path'] = new_set() + +T['File manipulation']['special cases']['freed path']['delete and move other'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file-a', 'file-b' }) + child.fn.writefile({ 'File A' }, join_path(temp_dir, 'dir', 'file-a')) + open(temp_dir) + type_keys('j', 'dd') + go_in() + type_keys('dd') + go_out() + type_keys('p', 'C', 'file-b') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'dir/', 'file-b' }) + validate_file_content(join_path(temp_dir, 'file-b'), { 'File A' }) +end + +T['File manipulation']['special cases']['freed path']['delete and rename other'] = function() + local temp_dir = make_temp_dir('temp', { 'file-a', 'file-b' }) + child.fn.writefile({ 'File B' }, join_path(temp_dir, 'file-b')) + open(temp_dir) + type_keys('dd', 'C', 'file-a', '') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file-a' }) + validate_file_content(join_path(temp_dir, 'file-a'), { 'File B' }) +end + +T['File manipulation']['special cases']['freed path']['delete and copy other'] = function() + local temp_dir = make_temp_dir('temp', { 'file-a', 'file-b' }) + child.fn.writefile({ 'File A' }, join_path(temp_dir, 'file-a')) + child.fn.writefile({ 'File B' }, join_path(temp_dir, 'file-b')) + open(temp_dir) + type_keys('dd', 'yy', 'p', 'C', 'file-a', '') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file-a', 'file-b' }) + validate_file_content(join_path(temp_dir, 'file-a'), { 'File B' }) + validate_file_content(join_path(temp_dir, 'file-b'), { 'File B' }) +end + +T['File manipulation']['special cases']['freed path']['delete and create'] = function() + local temp_dir = make_temp_dir('temp', { 'file' }) + child.fn.writefile({ 'File' }, join_path(temp_dir, 'file')) + open(temp_dir) + type_keys('dd', 'o', 'file', '') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file' }) + validate_file_content(join_path(temp_dir, 'file'), {}) +end + +T['File manipulation']['special cases']['freed path']['move and rename other'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'file-a', 'file-b' }) + child.fn.writefile({ 'File A' }, join_path(temp_dir, 'file-a')) + child.fn.writefile({ 'File B' }, join_path(temp_dir, 'file-b')) + open(temp_dir) + type_keys('j', 'dd', 'k') + go_in() + type_keys('P') + go_out() + type_keys('j', 'C', 'file-a') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'dir/', 'dir/file-a', 'file-a' }) + validate_file_content(join_path(temp_dir, 'file-a'), { 'File B' }) + validate_file_content(join_path(temp_dir, 'dir', 'file-a'), { 'File A' }) +end + +T['File manipulation']['special cases']['freed path']['move and copy other'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'file-a', 'file-b' }) + child.fn.writefile({ 'File A' }, join_path(temp_dir, 'file-a')) + child.fn.writefile({ 'File B' }, join_path(temp_dir, 'file-b')) + open(temp_dir) + type_keys('j', 'dd', 'gg') + go_in() + type_keys('P') + go_out() + type_keys('j', 'yy', 'p', 'C', 'file-a') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'dir/', 'dir/file-a', 'file-a', 'file-b' }) + validate_file_content(join_path(temp_dir, 'file-a'), { 'File B' }) + validate_file_content(join_path(temp_dir, 'file-b'), { 'File B' }) + validate_file_content(join_path(temp_dir, 'dir', 'file-a'), { 'File A' }) +end + +T['File manipulation']['special cases']['freed path']['move and create'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'file-a' }) + child.fn.writefile({ 'File A' }, join_path(temp_dir, 'file-a')) + open(temp_dir) + type_keys('j', 'dd', 'k') + go_in() + type_keys('P') + go_out() + type_keys('o', 'file-a') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'dir/', 'dir/file-a', 'file-a' }) + validate_file_content(join_path(temp_dir, 'file-a'), {}) + validate_file_content(join_path(temp_dir, 'dir', 'file-a'), { 'File A' }) +end + +T['File manipulation']['special cases']['freed path']['rename and move other'] = function() + -- NOTE: Unfortunately, this doesn't work as "move" is done before "rename". + -- Accounting for this seems involve even more tweaks than is currently done, + -- like fully computing the proper order of overlapping actions (which might + -- not be fully possibly due to "cyclic renames/moves"). So this deliberately + -- is left unresolved with the suggestion to split steps and sync more often. + + -- local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file-a', 'file-b' }) + -- child.fn.writefile({ 'File A' }, join_path(temp_dir, 'dir', 'file-a')) + -- child.fn.writefile({ 'File B' }, join_path(temp_dir, 'file-b')) + -- open(temp_dir) + -- type_keys('G', 'C', 'file-c', '') + -- type_keys('gg') + -- go_in() + -- type_keys('dd') + -- go_out() + -- type_keys('p', 'C', 'file-b', '') + -- mock_confirm(1) + -- synchronize() + -- + -- validate_tree(temp_dir, { 'dir/', 'file-b', 'file-c' }) + -- validate_file_content(join_path(temp_dir, 'file-b'), { 'File A' }) + -- validate_file_content(join_path(temp_dir, 'file-c'), { 'File B' }) +end + +T['File manipulation']['special cases']['freed path']['rename and copy other'] = function() + local temp_dir = make_temp_dir('temp', { 'file-a', 'file-b' }) + child.fn.writefile({ 'File A' }, join_path(temp_dir, 'file-a')) + child.fn.writefile({ 'File B' }, join_path(temp_dir, 'file-b')) + open(temp_dir) + type_keys('C', 'file-c', '') + type_keys('j', 'yy', 'p', 'C', 'file-a') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file-a', 'file-b', 'file-c' }) + validate_file_content(join_path(temp_dir, 'file-a'), { 'File B' }) + validate_file_content(join_path(temp_dir, 'file-b'), { 'File B' }) + validate_file_content(join_path(temp_dir, 'file-c'), { 'File A' }) +end + +T['File manipulation']['special cases']['freed path']['rename and create'] = function() + local temp_dir = make_temp_dir('temp', { 'file' }) + child.fn.writefile({ 'File' }, join_path(temp_dir, 'file')) + open(temp_dir) + type_keys('C', 'new-file', '') + type_keys('o', 'file') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file', 'new-file' }) + validate_file_content(join_path(temp_dir, 'file'), {}) + validate_file_content(join_path(temp_dir, 'new-file'), { 'File' }) +end + +T['File manipulation']['special cases']['act on same path'] = new_set() + +T['File manipulation']['special cases']['act on same path']['copy and rename'] = function() + local temp_dir = make_temp_dir('temp', { 'file' }) + child.fn.writefile({ 'File' }, join_path(temp_dir, 'file')) + open(temp_dir) + type_keys('yy', 'p', 'C', 'file-a', '') + type_keys('k^', 'C', 'file-b', '') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file-a', 'file-b' }) + validate_file_content(join_path(temp_dir, 'file-a'), { 'File' }) + validate_file_content(join_path(temp_dir, 'file-b'), { 'File' }) +end + +T['File manipulation']['special cases']['act on same path']['copy and move'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'file' }) + child.fn.writefile({ 'File' }, join_path(temp_dir, 'file')) + open(temp_dir) + type_keys('j', 'yy', 'p', 'C', 'file-a', '') + type_keys('k', 'dd', 'k') + go_in() + type_keys('P') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'dir/', 'dir/file', 'file-a' }) + validate_file_content(join_path(temp_dir, 'file-a'), { 'File' }) + validate_file_content(join_path(temp_dir, 'dir', 'file'), { 'File' }) +end + +T['File manipulation']['special cases']['inside affected directory'] = new_set() + +T['File manipulation']['special cases']['inside affected directory']['delete in copied'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + type_keys('dd') + go_out() + type_keys('yy', 'p', 'C', 'new-dir', '') + mock_confirm(1) + synchronize() + + -- "Delete" is done before "copy", so as to "free" space. So both directories + -- don't have deleted file. + validate_tree(temp_dir, { 'dir/', 'new-dir/' }) +end + +T['File manipulation']['special cases']['inside affected directory']['delete in renamed'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + type_keys('dd') + go_out() + type_keys('C', 'new-dir', '') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'new-dir/' }) +end + +T['File manipulation']['special cases']['inside affected directory']['delete in moved'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file', 'other-dir/' }) + open(temp_dir .. '/dir') + type_keys('dd') + go_out() + type_keys('dd') + go_in() + type_keys('P') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'other-dir/', 'other-dir/dir/' }) +end + +T['File manipulation']['special cases']['inside affected directory']['move in deleted'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file', 'dir/subdir/' }) + open(temp_dir .. '/dir') + type_keys('j', 'dd') + go_in() + type_keys('p') + go_out() + go_out() + type_keys('dd') + mock_confirm(1) + synchronize() + + -- Should prefer "delete" + validate_tree(temp_dir, {}) +end + +T['File manipulation']['special cases']['inside affected directory']['move in renamed'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file', 'dir/subdir/' }) + open(temp_dir .. '/dir') + type_keys('j', 'dd') + go_in() + type_keys('p') + go_out() + go_out() + type_keys('C', 'new-dir', '') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'new-dir/', 'new-dir/subdir/', 'new-dir/subdir/file' }) +end + +T['File manipulation']['special cases']['inside affected directory']['move in copied'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file', 'dir/subdir/' }) + open(temp_dir .. '/dir') + type_keys('j', 'dd') + go_in() + type_keys('p') + go_out() + go_out() + type_keys('yy', 'p', 'C', 'new-dir') + mock_confirm(1) + synchronize() + + local ref_tree = { 'dir/', 'dir/subdir/', 'dir/subdir/file', 'new-dir/', 'new-dir/subdir/', 'new-dir/subdir/file' } + validate_tree(temp_dir, ref_tree) +end + +T['File manipulation']['special cases']['inside affected directory']['rename in deleted'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + type_keys('C', 'new-file', '') + go_out() + type_keys('dd') + mock_confirm(1) + synchronize() + + -- Should prefer "delete" + validate_tree(temp_dir, {}) +end + +T['File manipulation']['special cases']['inside affected directory']['rename in moved'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file', 'other-dir/' }) + open(temp_dir .. '/dir') + type_keys('C', 'new-file', '') + go_out() + type_keys('dd', 'G') + go_in() + type_keys('P') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'other-dir/', 'other-dir/dir/', 'other-dir/dir/new-file' }) +end + +T['File manipulation']['special cases']['inside affected directory']['rename in copied'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + type_keys('C', 'new-file', '') + go_out() + type_keys('yy', 'p', 'C', 'new-dir', '') + mock_confirm(1) + synchronize() + + -- "Rename" is done before "copy", so as to "free" space. So both directories + -- have renamed file. + validate_tree(temp_dir, { 'dir/', 'dir/new-file', 'new-dir/', 'new-dir/new-file' }) +end + +T['File manipulation']['special cases']['inside affected directory']['copy in deleted'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + type_keys('yy', 'p', 'C', 'file-a', '') + go_out() + type_keys('dd') + mock_confirm(1) + synchronize() + + -- Should prefer "delete" + validate_tree(temp_dir, {}) +end + +T['File manipulation']['special cases']['inside affected directory']['copy in moved'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file', 'other-dir/' }) + open(temp_dir .. '/dir') + type_keys('yy', 'p', 'C', 'file-a', '') + go_out() + type_keys('dd') + go_in() + type_keys('P') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'other-dir/', 'other-dir/dir/', 'other-dir/dir/file', 'other-dir/dir/file-a' }) +end + +T['File manipulation']['special cases']['inside affected directory']['copy in renamed'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + type_keys('yy', 'p', 'C', 'file-a', '') + go_out() + type_keys('C', 'new-dir', '') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'new-dir/', 'new-dir/file', 'new-dir/file-a' }) +end + +T['File manipulation']['special cases']['inside affected directory']['create in deleted'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/' }) + open(temp_dir .. '/dir') + type_keys('i', 'file', '') + go_out() + type_keys('dd') + mock_confirm(1) + synchronize() + + -- Should prefer "delete" + validate_tree(temp_dir, {}) +end + +T['File manipulation']['special cases']['inside affected directory']['create in moved'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'other-dir/' }) + open(temp_dir .. '/dir') + type_keys('i', 'file', '') + go_out() + type_keys('dd') + go_in() + type_keys('P') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'other-dir/', 'other-dir/dir/', 'other-dir/dir/file' }) +end + +T['File manipulation']['special cases']['inside affected directory']['create in renamed'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/' }) + open(temp_dir .. '/dir') + type_keys('i', 'file', '') + go_out() + type_keys('C', 'new-dir', '') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'new-dir/', 'new-dir/file' }) +end + +T['File manipulation']['special cases']['inside affected directory']['create in copied'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/' }) + open(temp_dir .. '/dir') + type_keys('i', 'file', '') + go_out() + type_keys('yy', 'p', 'C', 'new-dir', '') + mock_confirm(1) + synchronize() + + -- "Create" is done last so only in original directory. There is no special + -- reason for this choice other than grouping "move"/"rename"/"copy" seems + -- like a more organized choice. + validate_tree(temp_dir, { 'dir/', 'dir/file', 'new-dir/' }) +end + +T['File manipulation']['special cases']['from affected directory'] = new_set() + +T['File manipulation']['special cases']['from affected directory']['move from deleted'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + type_keys('dd') + go_out() + type_keys('p') + type_keys('gg', 'dd') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file' }) +end + +T['File manipulation']['special cases']['from affected directory']['move from renamed'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + type_keys('dd') + go_out() + type_keys('p') + type_keys('gg', 'C', 'new-dir') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file', 'new-dir/' }) +end + +T['File manipulation']['special cases']['from affected directory']['move from copied'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + open(temp_dir .. '/dir') + type_keys('dd') + go_out() + type_keys('p') + type_keys('gg', 'yy', 'p', 'C', 'new-dir') + mock_confirm(1) + synchronize() + + -- "Move" is done before "copy", so as to "free" space. So no directories + -- have moved file. + validate_tree(temp_dir, { 'dir/', 'file', 'new-dir/' }) +end + +T['File manipulation']['special cases']['from affected directory']['copy from deleted'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + child.fn.writefile({ 'File' }, join_path(temp_dir, 'dir', 'file')) + open(temp_dir .. '/dir') + type_keys('yy') + go_out() + type_keys('p') + type_keys('gg', 'dd') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file' }) + validate_file_content(join_path(temp_dir, 'file'), { 'File' }) +end + +T['File manipulation']['special cases']['from affected directory']['copy from moved'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file', 'other-dir/' }) + child.fn.writefile({ 'File' }, join_path(temp_dir, 'dir', 'file')) + open(temp_dir .. '/dir') + type_keys('yy') + go_out() + type_keys('p') + type_keys('gg', 'dd', 'G') + go_in() + type_keys('P') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file', 'other-dir/', 'other-dir/dir/', 'other-dir/dir/file' }) + validate_file_content(join_path(temp_dir, 'file'), { 'File' }) + validate_file_content(join_path(temp_dir, 'other-dir', 'dir', 'file'), { 'File' }) +end + +T['File manipulation']['special cases']['from affected directory']['copy from renamed'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'dir/file' }) + child.fn.writefile({ 'File' }, join_path(temp_dir, 'dir', 'file')) + open(temp_dir .. '/dir') + type_keys('yy') + go_out() + type_keys('p') + type_keys('gg', 'C', 'new-dir', '') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file', 'new-dir/', 'new-dir/file' }) + validate_file_content(join_path(temp_dir, 'file'), { 'File' }) + validate_file_content(join_path(temp_dir, 'new-dir', 'file'), { 'File' }) +end + +T['File manipulation']['special cases']['into affected directory'] = new_set() + +T['File manipulation']['special cases']['into affected directory']['move into deleted'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'file' }) + open(temp_dir) + type_keys('G', 'dd') + go_in() + type_keys('P') + go_out() + type_keys('dd') + mock_confirm(1) + synchronize() + + -- Should prefer "delete" + validate_tree(temp_dir, {}) +end + +T['File manipulation']['special cases']['into affected directory']['move into renamed'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'file' }) + open(temp_dir) + type_keys('G', 'dd') + go_in() + type_keys('P') + go_out() + type_keys('C', 'new-dir') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'new-dir/', 'new-dir/file' }) +end + +T['File manipulation']['special cases']['into affected directory']['move into copied'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'file' }) + open(temp_dir) + type_keys('G', 'dd') + go_in() + type_keys('P') + go_out() + type_keys('yy', 'p', 'C', 'new-dir') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'dir/', 'dir/file', 'new-dir/', 'new-dir/file' }) +end + +T['File manipulation']['special cases']['into affected directory']['copy into deleted'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'file' }) + open(temp_dir) + type_keys('G', 'yy', 'gg') + go_in() + type_keys('P') + go_out() + type_keys('dd') + mock_confirm(1) + synchronize() + + -- Should prefer "delete" + validate_tree(temp_dir, { 'file' }) +end + +T['File manipulation']['special cases']['into affected directory']['copy into moved'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'other-dir/', 'file' }) + open(temp_dir) + type_keys('G', 'yy', 'gg') + go_in() + type_keys('P') + go_out() + type_keys('dd') + go_in() + type_keys('P') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file', 'other-dir/', 'other-dir/dir/', 'other-dir/dir/file' }) +end + +T['File manipulation']['special cases']['into affected directory']['copy into renamed'] = function() + local temp_dir = make_temp_dir('temp', { 'dir/', 'file' }) + open(temp_dir) + type_keys('G', 'yy', 'gg') + go_in() + type_keys('P') + go_out() + type_keys('C', 'new-dir', '') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'file', 'new-dir/', 'new-dir/file' }) +end + +T['File manipulation']['special cases']['nested move'] = new_set() + +T['File manipulation']['special cases']['nested move']['works'] = function() + local temp_dir = make_temp_dir('temp', { 'dir-a/', 'dir-a/dir-b/', 'dir-a/dir-b/dir-c/', 'dir-a/dir-b/dir-c/file' }) + open(temp_dir .. '/dir-a/dir-b') + type_keys('dd') + go_out() + go_out() + type_keys('p') + type_keys('gg') + go_in() + type_keys('dd') + go_out() + type_keys('p') + mock_confirm(1) + synchronize() + + validate_tree(temp_dir, { 'dir-a/', 'dir-b/', 'dir-c/', 'dir-c/file' }) +end + T['Cursors'] = new_set() T['Cursors']['are preserved'] = function() @@ -3764,28 +5078,48 @@ T['Events']['`MiniFilesWindowUpdate` triggers'] = function() open(test_dir_path) local buf_id_1, win_id_1 = child.api.nvim_get_current_buf(), child.api.nvim_get_current_win() - -- Should provide both `buf_id` and `win_id` - validate_event_track({ { buf_id = buf_id_1, win_id = win_id_1 } }) + -- Triggered several times because `CursorMoved` also triggeres it. + -- Should provide both `buf_id` and `win_id`. + validate_event_track({ { buf_id = buf_id_1, win_id = win_id_1 }, { buf_id = buf_id_1, win_id = win_id_1 } }) clear_event_track() go_in() local buf_id_2, win_id_2 = child.api.nvim_get_current_buf(), child.api.nvim_get_current_win() - -- - Force order, as there is no order guarantee of event trigger -- - Both windows should be updated - validate_event_track({ { buf_id = buf_id_1, win_id = win_id_1 }, { buf_id = buf_id_2, win_id = win_id_2 } }, true) + validate_event_track( + { + { buf_id = buf_id_1, win_id = win_id_1 }, + { buf_id = buf_id_1, win_id = win_id_1 }, + { buf_id = buf_id_2, win_id = win_id_2 }, + { buf_id = buf_id_2, win_id = win_id_2 }, + }, + -- - Force order, as there is no order guarantee of event trigger + true + ) end -T['Events']['`MiniFilesWindowUpdate` is not triggered for cursor move'] = function() +T['Events']['`MiniFilesWindowUpdate` is triggered after every possible window config update'] = function() track_event('MiniFilesWindowUpdate') open(test_dir_path) clear_event_track() - type_keys('j') - type_keys('') - type_keys('i', '') - validate_event_track({}) + -- Windows have to adjust configs on every cursor move if preview is set + child.lua('MiniFiles.config.windows.preview = true') + + local validate = function(keys) + clear_event_track() + type_keys(keys) + eq(#get_event_track() > 0, true) + end + + validate('j') + validate('') + validate({ 'i', '' }) + + -- NOTE: Currently this event also is triggered on every cursor move even if + -- preview is not enabled. This is to simplify code. end T['Events']['`MiniFilesWindowUpdate` is triggered after current buffer is set'] = function() @@ -3793,7 +5127,66 @@ T['Events']['`MiniFilesWindowUpdate` is triggered after current buffer is set'] open(test_dir_path) clear_event_track() go_out() - validate_event_track({ { buf_id = 2, win_id = 1004 }, { buf_id = 3, win_id = 1003 } }, true) + validate_event_track({ + { buf_id = 2, win_id = 1004 }, + { buf_id = 2, win_id = 1004 }, + { buf_id = 3, win_id = 1003 }, + { buf_id = 3, win_id = 1003 }, + }, true) +end + +T['Events']['`MiniFilesWindowUpdate` can customize internally set window config parts'] = function() + if child.fn.has('nvim-0.10') == 0 then MiniTest.skip('Screenshots are generated for Neovim>=0.9') end + child.set_size(15, 80) + + load_module({ + windows = { + preview = true, + width_focus = 40, + width_nofocus = 10, + width_preview = 20, + }, + }) + + child.lua([[ + vim.api.nvim_create_autocmd('User', { + pattern = 'MiniFilesWindowUpdate', + callback = function(args) + local config = vim.api.nvim_win_get_config(args.data.win_id) + -- Ensure fixed height + config.height = 5 + -- Ensure title padding + local n = #config.title + if config.title[n][1] ~= ' ' then table.insert(config.title, { ' ', 'NormalFloat' }) end + if config.title[1][1] ~= ' ' then table.insert(config.title, 1, { ' ', 'NormalFloat' }) end + vim.api.nvim_win_set_config(args.data.win_id, config) + end + }) + ]]) + + open(test_dir_path) + go_in() + child.expect_screenshot() + + -- Works in Insert mode when number of entries is less than height + type_keys('o', 'a', 'b', 'c') + child.expect_screenshot() + child.ensure_normal_mode() + + -- Works in Insert mode when number of entries is more than height + go_out() + type_keys('o', 'd', 'e', 'f') + child.expect_screenshot() + child.ensure_normal_mode() + + -- Works when modifying below last visible line + type_keys('3j', 'o', 'a') + child.expect_screenshot() + + -- Works even if completion menu (like from 'mini.completion') is triggered + child.cmd('set iskeyword+=-') + type_keys('') + child.expect_screenshot() end T['Events']['`MiniFilesActionCreate` triggers'] = function() @@ -3865,6 +5258,8 @@ end T['Events']['`MiniFilesActionDelete` triggers for `options.permanent_delete = false`'] = function() track_event('MiniFilesActionDelete') + local data_dir = mock_stdpath_data() + local trash_dir = join_path(data_dir, 'mini.files', 'trash') child.lua('MiniFiles.config.options.permanent_delete = false') local temp_dir = make_temp_dir('temp', { 'file', 'dir/', 'dir/subfile' }) open(temp_dir) @@ -3875,9 +5270,10 @@ T['Events']['`MiniFilesActionDelete` triggers for `options.permanent_delete = fa local event_track = get_event_track() table.sort(event_track, function(a, b) return a.from < b.from end) + -- Should also supply `to` field with path to trash eq(event_track, { - { action = 'delete', from = join_path(temp_dir, 'dir') }, - { action = 'delete', from = join_path(temp_dir, 'file') }, + { action = 'delete', from = join_path(temp_dir, 'dir'), to = join_path(trash_dir, 'dir') }, + { action = 'delete', from = join_path(temp_dir, 'file'), to = join_path(trash_dir, 'file') }, }) end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_git.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_git.lua index f0501a94..3bdfe9de 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_git.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_git.lua @@ -12,33 +12,44 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end local new_buf = function() return child.api.nvim_create_buf(true, false) end local new_scratch_buf = function() return child.api.nvim_create_buf(false, true) end local get_buf = function() return child.api.nvim_get_current_buf() end local set_buf = function(buf_id) child.api.nvim_set_current_buf(buf_id) end local get_win = function() return child.api.nvim_get_current_win() end -local edit = function(path) child.cmd('edit ' .. child.fn.fnameescape(path)) end --stylua: ignore end -- TODO: Remove after compatibility with Neovim=0.9 is dropped local islist = vim.fn.has('nvim-0.10') == 1 and vim.islist or vim.tbl_islist +local path_sep = package.config:sub(1, 1) local test_dir = 'tests/dir-git' -local test_dir_absolute = vim.fn.fnamemodify(test_dir, ':p'):gsub('(.)/$', '%1') -local test_file_absolute = test_dir_absolute .. '/file' +local test_dir_absolute = vim.fn.fnamemodify(test_dir, ':p'):gsub('(.)[\\/]$', '%1') +local test_file_absolute = test_dir_absolute .. path_sep .. 'file' -local git_root_dir = test_dir_absolute .. '/git-repo' -local git_repo_dir = git_root_dir .. '/.git-dir' -local git_dir_path = git_root_dir .. '/dir-in-git' -local git_file_path = git_root_dir .. '/file-in-git' +local git_root_dir = test_dir_absolute .. path_sep .. 'git-repo' +local git_repo_dir = git_root_dir .. path_sep .. '.git-dir' +local git_dir_path = git_root_dir .. path_sep .. 'dir-in-git' +local git_file_path = git_root_dir .. path_sep .. 'file-in-git' local forward_lua = function(fun_str) local lua_cmd = fun_str .. '(...)' return function(...) return child.lua_get(lua_cmd, { ... }) end end +-- Time constants +local repo_watch_delay = 50 +local small_time = helpers.get_time_const(10) +local micro_time = 1 + +-- Common wrappers +local edit = function(path) + child.cmd('edit ' .. child.fn.fnameescape(path)) + -- Slow context needs a small delay to get things up to date + if helpers.is_slow() then sleep(small_time) end +end + local log_calls = function(fun_name) --stylua: ignore local lua_cmd = string.format( @@ -66,13 +77,11 @@ local validate_minigit_name = function(buf_id, ref_name) end -- Common mocks -local small_time = 10 - -- - Git mocks local mock_change_git_index = function() local index_path = git_repo_dir .. '/index' child.fn.writefile({}, index_path .. '.lock') - sleep(1) + sleep(micro_time) child.fn.delete(index_path) child.loop.fs_rename(index_path .. '.lock', index_path) end @@ -243,7 +252,8 @@ T['show_at_cursor()']['works on commit'] = function() show_at_cursor() - local ref_git_spawn_log = { { args = { '--no-pager', 'show', 'abc1234' }, cwd = child.fn.getcwd() } } + local ref_args = { '--no-pager', 'show', '--stat', '--patch', 'abc1234' } + local ref_git_spawn_log = { { args = ref_args, cwd = child.fn.getcwd() } } validate_git_spawn_log(ref_git_spawn_log) clear_spawn_log() @@ -271,7 +281,8 @@ T['show_at_cursor()']['uses correct pattern to match commit'] = function() clear_spawn_log() show_at_cursor() - local is_commit = vim.deep_equal(get_spawn_log()[1].options.args, { '--no-pager', 'show', cword }) + local ref_args = { '--no-pager', 'show', '--stat', '--patch', cword } + local is_commit = vim.deep_equal(get_spawn_log()[1].options.args, ref_args) eq(is_commit, ref_is_commit) end @@ -295,6 +306,140 @@ T['show_at_cursor()']['uses `opts` on commit'] = function() eq(child.o.filetype, 'git') end +T['show_at_cursor()']["works in 'mini.deps' confirmation buffer"] = function() + local deps_buf_id = new_scratch_buf() + set_buf(deps_buf_id) + local lines = child.fn.readfile(test_dir_absolute .. '/deps-confirm') + set_lines(lines) + child.bo.filetype = 'minideps-confirm' + child.api.nvim_buf_set_name(0, 'mini-deps://confirm-update') + + local validate_no_show = function(l_num) + -- Assume not existing `cwd` (because it should be called during checking + -- if the buffer's directory is inside git repo, which is not) + child.lua([[vim.fn.isdirectory = function() return 0 end]]) + + -- Should not depend on column + set_cursor(l_num, l_num % 13) + show_at_cursor() + + eq(get_buf(), deps_buf_id) + eq(#child.api.nvim_list_tabpages(), 1) + + -- A spawn log as if nothing is detected at "show commit" step (entries + -- come from the next steps) + validate_git_spawn_log({}) + clear_spawn_log() + validate_notifications({ { '(mini.git) Nothing Git-related to show at cursor', 'WARN' } }) + clear_notify_log() + end + + local validate_show = function(l_num, commit, plugin_name) + -- Prepare spawn mocks data + mock_spawn() + child.lua([[_G.stdio_queue = { { { 'out', 'commit abc123456\nHello' } } }]]) + -- Assume `cwd` always exists (for easier `deps-confirm` mock text) + child.lua([[vim.fn.isdirectory = function() return 1 end]]) + + set_cursor(l_num, l_num % 13) + show_at_cursor() + + -- Should show in commit info in separate tabpage + expect.no_equality(get_buf(), deps_buf_id) + eq(child.bo.filetype, 'git') + eq(get_lines(), { 'commit abc123456', 'Hello' }) + eq(#child.api.nvim_list_tabpages(), 2) + eq(child.api.nvim_tabpage_get_number(0), 2) + eq(#child.api.nvim_tabpage_list_wins(0), 1) + + local ref_git_spawn_log = { + { + args = { '--no-pager', 'show', '--stat', '--patch', commit }, + cwd = '/home/user/.local/share/nvim/site/pack/deps/opt/' .. plugin_name, + }, + } + validate_git_spawn_log(ref_git_spawn_log) + clear_spawn_log() + validate_notifications({}) + clear_notify_log() + + -- Clean up + child.cmd('quit') + end + + for i = 1, 11 do + validate_no_show(i) + end + validate_show(12, 'aa339f6ab611da07183a7fe44daa482605392502', 'plugin_b') + validate_show(13, '093b29f2b409278e2ed69a90462fee54714b5a84', 'plugin_b') + validate_show(14, '093b29f2b409278e2ed69a90462fee54714b5a84', 'plugin_b') + validate_show(15, '093b29f2b409278e2ed69a90462fee54714b5a84', 'plugin_b') + validate_show(16, '093b29f2', 'plugin_b') + validate_show(17, '093b29f2', 'plugin_b') + validate_show(18, '093b29f2', 'plugin_b') + validate_show(19, 'bfe74a48', 'plugin_b') + validate_show(20, 'bfe74a48', 'plugin_b') + validate_show(21, 'bfe74a48', 'plugin_b') + validate_show(22, '3826d0c4', 'plugin_b') + validate_show(23, '3826d0c4', 'plugin_b') + validate_show(24, '3826d0c4', 'plugin_b') + validate_no_show(25) + validate_no_show(26) + validate_no_show(27) + validate_show(28, '3a3c6244553f13fdd92d312c82722b57ce6c4bec', 'plugin_c') + validate_show(29, 'fe3deb7f67ce0cc4ebfe2ea6c1c7ae1c7a939d73', 'plugin_c') + validate_show(30, 'fe3deb7f67ce0cc4ebfe2ea6c1c7ae1c7a939d73', 'plugin_c') + validate_show(31, 'fe3deb7f67ce0cc4ebfe2ea6c1c7ae1c7a939d73', 'plugin_c') + validate_show(32, 'fe3deb7', 'plugin_c') + validate_show(33, 'fe3deb7', 'plugin_c') + validate_show(34, 'fe3deb7', 'plugin_c') + validate_no_show(35) + validate_no_show(36) + validate_no_show(37) + validate_show(38, 'd231729b13da28fd1625c3d85f2315886ddeb05d', 'plugin_d') +end + +T['show_at_cursor()']["uses `opts` in 'mini.deps' confirmation buffer"] = function() + local deps_buf_id = new_scratch_buf() + set_buf(deps_buf_id) + local lines = child.fn.readfile(test_dir_absolute .. '/deps-confirm') + set_lines(lines) + child.bo.filetype = 'minideps-confirm' + child.api.nvim_buf_set_name(0, 'mini-deps://confirm-update') + + child.lua([[vim.fn.isdirectory = function() return 1 end]]) + child.lua([[_G.stdio_queue = { { { 'out', 'commit abc123456\nHello' } } }]]) + + local init_win_id = get_win() + set_cursor(16, 0) + show_at_cursor({ split = 'vertical' }) + + expect.no_equality(get_buf(), deps_buf_id) + eq(child.api.nvim_tabpage_get_number(0), 1) + eq(child.fn.winlayout(), { 'row', { { 'leaf', get_win() }, { 'leaf', init_win_id } } }) + eq(get_lines(), { 'commit abc123456', 'Hello' }) + eq(child.o.filetype, 'git') +end + +T['show_at_cursor()']['shows message if can not find commit'] = function() + local lines = child.fn.readfile(test_dir_absolute .. '/deps-confirm') + set_lines(lines) + set_cursor(16, 2) + + -- Commit at cursor + show_at_cursor() + validate_notifications({ { '(mini.git) Can not show commit 093b29f2 in repo ' .. child.fn.getcwd(), 'WARN' } }) + clear_notify_log() + + -- 'mini.deps' confirmation buffer + child.bo.filetype = 'minideps-confirm' + child.api.nvim_buf_set_name(0, 'mini-deps://confirm-update') + + show_at_cursor() + local path = '/home/user/.local/share/nvim/site/pack/deps/opt/plugin_b' + validate_notifications({ { '(mini.git) Can not show commit 093b29f2 in repo ' .. path, 'WARN' } }) +end + T['show_at_cursor()']['works for diff source'] = function() child.lua('MiniGit.show_diff_source = function() end') log_calls('MiniGit.show_diff_source') @@ -1157,6 +1302,7 @@ local enable = forward_lua('MiniGit.enable') T['enable()']['works'] = function() enable() + if helpers.is_slow() then sleep(small_time) end --stylua: ignore local ref_git_spawn_log = { { @@ -1261,13 +1407,16 @@ T['enable()']['properly formats buffer-local summary string'] = function() edit(git_file_path) validate('main (??)') - child.cmd('edit') + edit('') + child.poke_eventloop() validate('main-1') - child.cmd('edit') + edit('') + child.poke_eventloop() validate('main-2 (A )') - child.cmd('edit') + edit('') + child.poke_eventloop() validate('main-3 ( M)') end @@ -1430,8 +1579,7 @@ T['get_buf_data()']['works with several actions in progress'] = function() mock_spawn() child.lua('_G.stdio_queue = _G.init_track_stdio_queue') - child.cmd('edit') - sleep(small_time) + edit('') eq(get_buf_data().in_progress, 'merge,revert') end @@ -1517,7 +1665,7 @@ T['Auto enable']['works after `:edit`'] = function() log_calls('MiniGit.enable') log_calls('MiniGit.disable') - child.cmd('edit') + edit('') validate_calls({ { 'MiniGit.disable', buf_id }, { 'MiniGit.enable', buf_id } }) eq(get_buf_data(buf_id).root, git_root_dir) end @@ -1565,7 +1713,7 @@ T['Tracking']['updates all buffers from same repo on repo change'] = function() -- Make change in '.git' directory mock_change_git_index() - sleep(50 + small_time) + sleep(repo_watch_delay + small_time) eq(get_buf_data(buf_id_1).status, 'MM') eq(get_buf_data(buf_id_2).status, 'A ') @@ -1667,6 +1815,8 @@ T['Tracking']['reacts to buffer rename'] = function() -- This is the chosen way to track change in root/repo. -- Rely on manual `:edit` otherwise. local new_root, new_repo = child.fn.getcwd(), test_dir_absolute + local file_rel = 'tests' .. path_sep .. 'dir-git' .. path_sep .. 'file' + child.lua('_G.file_rel = ' .. vim.inspect(file_rel)) local new_rev_parse_track = new_repo .. '\n' .. new_root child.lua('_G.new_rev_parse_track = ' .. vim.inspect(new_rev_parse_track)) child.lua([[_G.stdio_queue = { @@ -1674,9 +1824,9 @@ T['Tracking']['reacts to buffer rename'] = function() { { 'out', 'abc1234\nmain' } }, -- First get HEAD data { { 'out', 'M file-in-git' } }, -- First get file status data - { { 'out', _G.new_rev_parse_track } }, -- Second get path to root and repo - { { 'out', 'def4321\ntmp' } }, -- Second get HEAD data - { { 'out', 'MM tests/dir-git/file' } }, -- Second get file status data + { { 'out', _G.new_rev_parse_track } }, -- Second get path to root and repo + { { 'out', 'def4321\ntmp' } }, -- Second get HEAD data + { { 'out', 'MM ' .. _G.file_rel } }, -- Second get file status data } ]]) @@ -1709,7 +1859,7 @@ T['Tracking']['reacts to buffer rename'] = function() cwd = new_root, }, { - args = { '-c', 'gc.auto=0', 'status', '--verbose', '--untracked-files=all', '--ignored', '--porcelain', '-z', '--', 'tests/dir-git/file' }, + args = { '-c', 'gc.auto=0', 'status', '--verbose', '--untracked-files=all', '--ignored', '--porcelain', '-z', '--', file_rel }, cwd = new_root, }, } @@ -1764,7 +1914,7 @@ T['Tracking']['reacts to staging'] = function() mock_change_git_index() -- - Reaction to change in '.git' directory is debouned with delay of 50 ms - sleep(50 - small_time) + sleep(repo_watch_delay - small_time) eq(get_buf_data().status, 'MM') eq(#get_spawn_log(), 3) @@ -1805,7 +1955,7 @@ T['Tracking']['reacts to change in HEAD'] = function() eq(get_buf_data().head_name, 'main') child.fn.writefile({ 'ref: refs/heads/tmp' }, git_repo_dir .. '/HEAD') - sleep(50 - small_time) + sleep(repo_watch_delay - small_time) eq(get_buf_data().head_name, 'main') eq(#get_spawn_log(), 3) @@ -1868,7 +2018,7 @@ T['Tracking']['reacts to new action in progress'] = function() for _, name in ipairs(action_files) do local path = git_repo_dir .. '/' .. name child.fn.writefile({ '' }, path) - sleep(50 + small_time) + sleep(repo_watch_delay + small_time) output_in_progress[name] = get_buf_data().in_progress summary_strings[name] = child.b.minigit_summary_string child.fn.delete(path) @@ -1899,11 +2049,12 @@ T['Tracking']['does not react to ".lock" files in repo directory'] = function() mock_init_track_stdio_queue() child.lua('_G.stdio_queue = _G.init_track_stdio_queue') edit(git_file_path) + sleep(small_time) eq(#get_spawn_log(), 3) child.fn.writefile({ '' }, git_repo_dir .. '/tmp.lock') MiniTest.finally(function() child.fn.delete(git_repo_dir .. '/tmp.lock') end) - sleep(50 + small_time) + sleep(repo_watch_delay + small_time) eq(#get_spawn_log(), 3) end @@ -1940,7 +2091,7 @@ T['Tracking']['redraws statusline when summary is updated'] = function() -- Status change mock_change_git_index() - sleep(50 + small_time) + sleep(repo_watch_delay + small_time) child.expect_screenshot() -- File content change @@ -1950,14 +2101,14 @@ T['Tracking']['redraws statusline when summary is updated'] = function() -- Branch change child.fn.writefile({ 'ref: refs/heads/tmp' }, git_repo_dir .. '/HEAD') - sleep(50 + small_time) + sleep(repo_watch_delay + small_time) child.expect_screenshot() -- "In progress" change local path = git_repo_dir .. '/BISECT_LOG' child.fn.writefile({ '' }, path) MiniTest.finally(function() child.fn.delete(path) end) - sleep(50 + small_time) + sleep(repo_watch_delay + small_time) child.expect_screenshot() end @@ -2108,19 +2259,20 @@ local validate_command_call = function(log_index, args, executable, cwd) end T[':Git']['works'] = function() + child.lua('_G.dur = ' .. (10 * small_time)) child.lua([[ -- Command stdout table.insert(_G.stdio_queue, { { 'out', 'abc1234 Hello\ndef4321 World' } }) -- Mock non-trivial command execution time - _G.process_mock_data = { [4] = { duration = 50 } } + _G.process_mock_data = { [4] = { duration = _G.dur } } ]]) -- Should execute command synchronously local start_time = vim.loop.hrtime() child.cmd('Git log --oneline') local duration = 0.000001 * (vim.loop.hrtime() - start_time) - eq(50 <= duration and duration <= 70, true) + eq(10 * small_time <= duration and duration <= 14 * small_time, true) -- Should properly gather subcommand data before executing command local spawn_log = get_spawn_log() @@ -2157,7 +2309,7 @@ T[':Git']['works asynchronously with bang modifier'] = function() -- Should in some way show the output when the process is done eq(child.bo.filetype == 'git', false) - sleep(50 - small_time) + sleep(repo_watch_delay - small_time) eq(child.bo.filetype == 'git', false) sleep(2 * small_time) eq(child.bo.filetype == 'git', true) @@ -2367,7 +2519,7 @@ T[':Git']['opens Git editor in current instance'] = new_set( child.lua('MiniGit.config.job.timeout = 5') -- Set up content of edit message file - local editmsg_path = git_repo_dir .. '/COMMIT_EDITMSG' + local editmsg_path = git_repo_dir .. path_sep .. 'COMMIT_EDITMSG' child.lua('_G.editmsg_path = ' .. vim.inspect(editmsg_path)) local cur_lines = vim.fn.readfile(editmsg_path) MiniTest.finally(function() vim.fn.writefile(cur_lines, editmsg_path) end) @@ -2403,7 +2555,7 @@ T[':Git']['opens Git editor in current instance'] = new_set( local init_win_id = get_win() child.cmd(':belowright vert Git commit --amend') - sleep(small_time) + sleep(3 * small_time) eq(child.api.nvim_buf_get_name(0), editmsg_path) eq(get_lines(), { '', '# This is a mock of Git template for its `GIT_EDITOR`' }) eq(child.fn.winlayout(), { 'row', { { 'leaf', init_win_id }, { 'leaf', get_win() } } }) @@ -2414,7 +2566,7 @@ T[':Git']['opens Git editor in current instance'] = new_set( -- Should not stop due to timeout local is_job_active = function() return child.lua_get('pcall(vim.fn.jobpid, _G.channel)') end eq(is_job_active(), true) - sleep(50) + sleep(repo_watch_delay) eq(is_job_active(), true) -- Should wait until editing is done (window is closed) @@ -2523,18 +2675,19 @@ T[':Git']['respects `job.git_executable`'] = function() end T[':Git']['respects `job.timeout`'] = function() + child.lua('_G.duration = ' .. (5 * small_time)) child.lua([[ table.insert(_G.stdio_queue, { { 'out', 'Hello' } }) - _G.process_mock_data = { [4] = { duration = 50 } } + _G.process_mock_data = { [4] = { duration = _G.duration } } ]]) - child.lua('MiniGit.config.job.timeout = 20') + child.lua('MiniGit.config.job.timeout = ' .. (2 * small_time)) local start_time = vim.loop.hrtime() child.cmd('Git log') local duration = 0.000001 * (vim.loop.hrtime() - start_time) - eq(15 <= duration and duration <= 25, true) + eq((1.5 * small_time) <= duration and duration <= (2.5 * small_time), true) local ref_notify_log = { { '(mini.git) PROCESS REACHED TIMEOUT', 'WARN' }, @@ -2907,8 +3060,8 @@ T[':Git']['event `MiniGitCommandSplit` can be used to tweak window-local options local init_win_id = get_win() child.cmd(':Git log') eq(child.api.nvim_win_get_option(init_win_id, 'scrollbind'), true) - eq(child.api.nvim_win_get_option(0, 'scrollbind'), true) - eq(child.api.nvim_win_get_option(0, 'foldlevel'), 0) + eq(child.wo.scrollbind, true) + eq(child.wo.foldlevel, 0) end return T diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_hipatterns.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_hipatterns.lua index 6012250d..cbb771ac 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_hipatterns.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_hipatterns.lua @@ -9,8 +9,7 @@ local new_set = MiniTest.new_set local load_module = function(config) child.mini_load('hipatterns', config) end local set_lines = function(...) return child.set_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child, true) end --stylua: ignore end local forward_lua = function(fun_str) @@ -51,13 +50,16 @@ end local validate_hl_group = function(name, pattern) expect.match(child.cmd_capture('hi ' .. name), pattern) end -- Data ======================================================================= +local test_lines = { 'abcd abcd', 'Abcd ABCD', 'abcdaabcd' } + +-- Time constants +local small_time = helpers.get_time_const(10) + +-- Test config local test_config = { highlighters = { abcd = { pattern = 'abcd', group = 'Error' } }, - delay = { text_change = 30, scroll = 10 }, + delay = { text_change = 5 * small_time, scroll = 2 * small_time }, } -local small_time = 5 - -local test_lines = { 'abcd abcd', 'Abcd ABCD', 'abcdaabcd' } -- Output test set ============================================================ local T = new_set({ @@ -65,6 +67,8 @@ local T = new_set({ pre_case = function() child.setup() child.set_size(10, 15) + + child.lua('_G.test_config = ' .. vim.inspect(test_config)) end, post_once = child.stop, }, @@ -121,6 +125,12 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ delay = { scroll = 'a' } }, 'delay.scroll', 'number') end +T['setup()']['ensures colors'] = function() + load_module() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniHipatternsFixme'), 'links to DiagnosticError') +end + T['Auto enable'] = new_set() T['Auto enable']['enables for normal buffers'] = function() @@ -139,11 +149,13 @@ T['Auto enable']['enables for normal buffers'] = function() set_lines({ '33abcd33' }) load_module(test_config) + sleep(small_time) -- Should enable in all proper buffers currently shown in some window child.expect_screenshot() eq(child.lua_get('MiniHipatterns.get_enabled_buffers()'), { buf_id_1, buf_id_3 }) child.api.nvim_set_current_buf(buf_id_2) + sleep(small_time) child.expect_screenshot() eq(child.lua_get('MiniHipatterns.get_enabled_buffers()'), { buf_id_1, buf_id_2, buf_id_3 }) end @@ -191,14 +203,14 @@ T['Autocommands']['resets on color scheme change'] = function() }]]) child.lua([[require('mini.hipatterns').setup({ highlighters = { aaa = _G.new_hl_group_highlighter }, - delay = { text_change = 20 }, + delay = _G.test_config.delay, })]]) set_lines({ 'aaa' }) child.cmd('wincmd v | enew') set_lines({ 'xxaaaxx' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() -- After `:hi clear` highlighting disappears as highlight group is cleared @@ -308,14 +320,15 @@ T['enable()']['reacts to buffer enter'] = function() child.api.nvim_set_current_buf(other_buf_id) -- On buffer enter it should update config and highlighting (after delay) - local lua_cmd = string.format('vim.b[%d].minihipatterns_config = { delay = { text_change = 10 } }', init_buf_id) + local lua_cmd = + string.format('vim.b[%d].minihipatterns_config = { delay = { text_change = %d } }', init_buf_id, 2 * small_time) child.lua(lua_cmd) child.api.nvim_buf_set_lines(init_buf_id, 0, -1, false, { 'abcd' }) child.api.nvim_set_current_buf(init_buf_id) child.expect_screenshot() - sleep(10 + small_time) + sleep(2 * small_time + small_time) child.expect_screenshot() end @@ -330,7 +343,7 @@ T['enable()']['reacts to filetype change'] = function() group = 'Error' }, }, - delay = { text_change = 20 }, + delay = _G.test_config.delay, }]]) set_lines({ 'xxabcdxx' }) @@ -340,13 +353,12 @@ T['enable()']['reacts to filetype change'] = function() -- Should update highlighting after delay child.cmd('set filetype=aaa') child.expect_screenshot() - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() end T['enable()']['reacts to window scroll'] = function() - local config = { highlighters = test_config.highlighters, delay = { text_change = 30, scroll = 10 } } - enable(0, config) + enable(0, test_config) -- Change same line each before `delay.text_change`. This creates a situation -- when only one line will be highlighted while others - don't (but should). @@ -356,14 +368,14 @@ T['enable()']['reacts to window scroll'] = function() type_keys('P') end - sleep(30 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() -- Scroll should update highlighting inside view with `delay.scroll` debounce type_keys('') - sleep(5) + sleep(0.5 * test_config.delay.scroll) type_keys('') - sleep(10 + 1) + sleep(test_config.delay.scroll + small_time) child.expect_screenshot() -- Update should be done only on the final view @@ -381,16 +393,16 @@ T['enable()']['reacts to delete of line with match'] = function() group = '', extmark_opts = { virt_text = { { 'Hello', 'Error' } }, virt_text_pos = 'right_align' }, } - local config = { highlighters = { abcd = hi_abcd }, delay = { text_change = 30, scroll = 10 } } + local config = { highlighters = { abcd = hi_abcd }, delay = test_config.delay } enable(0, config) - sleep(30 + small_time) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() local validate = function(line_to_delete) child.api.nvim_win_set_cursor(0, { line_to_delete, 0 }) type_keys('dd') - sleep(30 + small_time) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() end @@ -410,10 +422,10 @@ T['Highlighters']['silently skips wrong entries'] = function() group_wrong_type = { pattern = 'aaa', group = 1 }, priority_wrong_type = { pattern = 'aaa', group = 'Error', extmark_opts = 'a' }, } - enable(0, { highlighters = highlighters, delay = { text_change = 20 } }) + enable(0, { highlighters = highlighters, delay = test_config.delay }) set_lines({ 'xxabcd', 'aaa' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() end @@ -424,11 +436,11 @@ T['Highlighters']['allows submatch in `pattern`'] = function() child.lua([[require('mini.hipatterns').disable()]]) local config = { highlighters = { abcd = { pattern = pattern, group = 'Error' } }, - delay = { text_change = 20 }, + delay = test_config.delay, } enable(0, config) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() end @@ -447,12 +459,12 @@ end T['Highlighters']['allows frontier pattern in `pattern`'] = function() local config = { highlighters = { abcd = { pattern = '%f[%w]abcd%f[%W]', group = 'Error' } }, - delay = { text_change = 20 }, + delay = test_config.delay, } enable(0, config) set_lines({ 'abcd', 'xabcd', 'abcdx', 'xabcdx', ' abcd ' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() end @@ -466,14 +478,11 @@ T['Highlighters']['allows callable `pattern`'] = function() }]]) child.lua([[require('mini.hipatterns').enable( 0, - { - highlighters = { test = _G.hi_callable_pattern }, - delay = { text_change = 20 }, - } + { highlighters = { test = _G.hi_callable_pattern }, delay = _G.test_config.delay } )]]) set_lines({ 'xxabcd' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() -- Should be called with correct signature eq(child.lua_get('_G.args'), { child.api.nvim_get_current_buf() }) @@ -489,16 +498,16 @@ T['Highlighters']['allows return `nil` `pattern` to not highlight'] = function() }]]) child.lua([[require('mini.hipatterns').enable( 0, - { highlighters = { test = _G.hi_conditional_pattern }, delay = { text_change = 20 } } + { highlighters = { test = _G.hi_conditional_pattern }, delay = _G.test_config.delay } )]]) set_lines({ 'xxabcd' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() child.b.not_highlight = true set_lines({ 'xxabcd' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() end @@ -516,16 +525,16 @@ T['Highlighters']['allows array `pattern`'] = function() }]]) child.lua([[require('mini.hipatterns').enable( 0, - { highlighters = { array = _G.hi_array }, delay = { text_change = 20 } } + { highlighters = { array = _G.hi_array }, delay = _G.test_config.delay } )]]) set_lines({ 'xxabcd', 'xxefgh' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() child.b.not_highlight = true set_lines({ 'xxabcd', 'xxefgh' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() end @@ -539,14 +548,11 @@ T['Highlighters']['allows callable `group`'] = function() }]]) child.lua([[require('mini.hipatterns').enable( 0, - { - highlighters = { test = _G.hi_callable_group }, - delay = { text_change = 20 }, - } + { highlighters = { test = _G.hi_callable_group }, delay = _G.test_config.delay } )]]) set_lines({ 'xxabcd' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() -- Should be called with correct signature eq(child.lua_get('_G.args'), { 1, 'abcd', { full_match = 'abcd', line = 1, from_col = 3, to_col = 6 } }) @@ -556,7 +562,7 @@ T['Highlighters']['allows callable `group`'] = function() child.lua('_G.args = nil') child.lua('_G.hi_callable_group.pattern = ' .. vim.inspect(pattern)) set_lines({ 'abcd' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) eq(child.lua_get('_G.args'), ref_args) end @@ -578,11 +584,11 @@ T['Highlighters']['allows return `nil` `group` to not highlight'] = function() }]]) child.lua([[require('mini.hipatterns').enable( 0, - { highlighters = { test = _G.hi_conditional_group }, delay = { text_change = 20 } } + { highlighters = { test = _G.hi_conditional_group }, delay = _G.test_config.delay } )]]) set_lines({ 'xxabcd', 'xxabcd', 'xxabcd', 'xxabcd', 'xxabcd' }) - sleep(20 + 2) + sleep(test_config.delay.text_change + small_time) child.expect_screenshot() end @@ -898,11 +904,11 @@ T['get_matches()']['works'] = function() end, }, }, - delay = { text_change = 20 }, + delay = _G.test_config.delay, })]]) enable(buf_id_1) - sleep(20 + small_time) + sleep(test_config.delay.text_change + small_time) local matches = get_matches(buf_id_1) -- Order should be guaranteed (as tostring(10) is less than 'aaa') @@ -919,7 +925,7 @@ T['get_matches()']['works'] = function() -- Should return empty table if no matches enable(buf_id_2) - sleep(20 + small_time) + sleep(test_config.delay.text_change + small_time) eq(get_matches(buf_id_2), {}) end @@ -928,10 +934,10 @@ T['get_matches()']['respects `buf_id` argument'] = function() child.api.nvim_buf_set_lines(buf_id, 0, -1, false, { 'bbb aaa' }) child.lua([[require('mini.hipatterns').setup({ highlighters = { aaa = { pattern = 'aaa', group = 'Error' } }, - delay = { text_change = 20 }, + delay = _G.test_config.delay, })]]) enable(buf_id) - sleep(20 + small_time) + sleep(test_config.delay.text_change + small_time) -- Should allow both `nil` and `0` to mean current buffer local ref_output = @@ -949,10 +955,10 @@ T['get_matches()']['respects `highlighters` argument'] = function() aaa = { pattern = { 'aaa', 'AAA' }, group = 'Error' }, bbb = { pattern = 'bbb', group = 'Comment' }, }, - delay = { text_change = 20 }, + delay = _G.test_config.delay, })]]) enable(buf_id) - sleep(20 + small_time) + sleep(test_config.delay.text_change + small_time) -- Should respect order of `highlighters` in output and discard any not -- present highlighter identifiers @@ -980,6 +986,7 @@ local enable_hex_color = function(...) })]], { ... } ) + sleep(small_time) end T['gen_highlighter']['hex_color()']['works'] = function() diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_icons.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_icons.lua index b0af2fb5..37050eda 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_icons.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_icons.lua @@ -37,6 +37,9 @@ T['setup()']['creates side effects'] = function() -- Global variable eq(child.lua_get('type(_G.MiniIcons)'), 'table') + -- Autocommand group + eq(child.fn.exists('#MiniIcons'), 1) + -- Highlight groups child.cmd('hi clear') load_module() @@ -97,6 +100,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ use_file_extension = 1 }, 'use_file_extension', 'function') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniIconsAzure'), 'links to Function') +end + T['setup()']['can customize icons'] = function() -- Both override existing and provide new ones load_module({ @@ -311,8 +319,8 @@ T['get()']['respects `config.use_file_extension`'] = function() eq(get('file', '/extra.dots.yml'), { '', 'MiniIconsPurple', false }) -- - '/queries/.*%.scm' pattern should be built-in - eq(get('file', 'queries/lua.scm'), { '󰐅', 'MiniIconsGreen', false }) - eq(get('file', 'queries/extra.dots.scm'), { '󰐅', 'MiniIconsGreen', false }) + eq(get('file', './queries/lua.scm'), { '󰐅', 'MiniIconsGreen', false }) + eq(get('file', './queries/extra.dots.scm'), { '󰐅', 'MiniIconsGreen', false }) eq(get('file', 'lua.scm'), { '󰘧', 'MiniIconsGrey', false }) -- Should not be called if there is no extension @@ -521,6 +529,12 @@ T['get()']['respects `config.style`'] = function() -- - 'not-supported' is resolved to use "file" default eq(get('file', 'not-supported'), { 'F', 'MiniIconsGrey', true }) + -- Should work with full paths + eq(get('file', '/home/user/LICENSE'), { 'L', 'MiniIconsCyan', false }) + eq(get('file', '/home/user/world.lua'), { 'L', 'MiniIconsAzure', false }) + eq(get('file', '/home/user/Cargo.lock'), { 'T', 'MiniIconsOrange', false }) + eq(get('file', '/home/user/not-supported-2'), { 'F', 'MiniIconsGrey', true }) + -- Should work with all categories eq(get('default', 'lsp')[1], 'L') eq(get('directory', 'nvim')[1], 'N') diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_indentscope.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_indentscope.lua index 796f3fe2..f343e5a6 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_indentscope.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_indentscope.lua @@ -15,8 +15,7 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child, true) end --stylua: ignore end -- Data ======================================================================= @@ -50,7 +49,11 @@ local example_lines = { -- aa local example_lines_nested = { 'aa', ' aa', ' aa', ' aa', ' aa', ' aa', ' aa', ' aa', 'aa' } -local test_times = { delay = 100, animation_step = 20 } +-- Time constants +local default_draw_delay = 100 +local default_animation_step = 20 +local small_time = helpers.get_time_const(10) +local micro_time = 1 -- Output test set ============================================================ local T = new_set({ @@ -140,6 +143,11 @@ T['setup()']['properly handles `config.mappings`'] = function() eq(has_map('[i', 'indent scope'), false) end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniIndentscopeSymbol'), 'links to Delimiter') +end + T['get_scope()'] = new_set({ hooks = { pre_case = function() set_lines(example_lines) end, @@ -389,11 +397,11 @@ T['draw()']['works'] = function() -- Should be single symbol at cursor line child.expect_screenshot() - sleep(test_times.animation_step) + sleep(default_animation_step) child.expect_screenshot() - sleep(test_times.animation_step) + sleep(default_animation_step) child.expect_screenshot() - sleep(test_times.animation_step) + sleep(default_animation_step) child.expect_screenshot() end @@ -418,7 +426,7 @@ T['draw()']['uses correct highlight groups'] = new_set( set_cursor(2, 4) child.lua('MiniIndentscope.draw()') - sleep(test_times.animation_step) + sleep(default_animation_step) validate_hl_group(hl_group) end, @@ -432,23 +440,26 @@ T['draw()']['respects `config.draw.animation`'] = function() set_cursor(5, 4) child.lua('MiniIndentscope.draw()') - sleep(duration - 10) + sleep(duration - small_time) -- Should still be one symbol child.expect_screenshot() - sleep(10 + 1) + sleep(small_time + small_time) -- Should be two symbols child.expect_screenshot() end - local duration = 2.5 * test_times.animation_step + local duration = 2 * small_time local command = string.format('MiniIndentscope.config.draw.animation = function() return %d end', duration) child.lua(command) validate(duration) -- Should also use buffer local config set_cursor(1, 0) - child.lua('vim.b.miniindentscope_config = { draw = { animation = function() return 30 end } }') - validate(30) + local other_duration = 3 * small_time + local other_command = + string.format('vim.b.miniindentscope_config = { draw = { animation = function() return %d end } }', other_duration) + child.lua(other_command) + validate(other_duration) end T['draw()']['respects `config.draw.priority`'] = function() @@ -459,14 +470,14 @@ T['draw()']['respects `config.draw.priority`'] = function() set_cursor(5, 0) child.lua('MiniIndentscope.draw()') - sleep(test_times.animation_step) + sleep(default_animation_step) child.expect_screenshot() child.lua('MiniIndentscope.undraw()') child.lua('MiniIndentscope.config.draw.priority = 6') child.lua('MiniIndentscope.draw()') - sleep(test_times.animation_step) + sleep(default_animation_step) child.expect_screenshot() end @@ -499,13 +510,16 @@ T['draw()']["does not overshadow 'listchars'"] = function() end T['draw()']['does not round time of every animation step'] = function() - child.lua('MiniIndentscope.config.draw.animation = function() return 2.99 end') + helpers.skip_if_slow() + + local fractional_step = 0.99 * default_animation_step + child.lua('_G.fractional_step = ' .. fractional_step) + child.lua('MiniIndentscope.config.draw.animation = function() return _G.fractional_step end') set_cursor(6, 0) child.lua('MiniIndentscope.draw()') - -- Should be single symbol at cursor line - sleep(2 * 3) + sleep(2 * fractional_step) child.expect_screenshot() end @@ -531,6 +545,12 @@ T['draw()']['shows symbols on wrapped lines without overlapping'] = function() child.wo.breakindent = true child.wo.breakindentopt = 'min:0' validate() + + -- Should try to not overlap 'showbreak' + child.wo.breakindent = true + child.wo.breakindentopt = 'sbr' + child.wo.showbreak = 'x' + validate() end T['undraw()'] = new_set({ @@ -568,16 +588,15 @@ T['Auto drawing']['works in Normal mode'] = function() mark_flaky() set_cursor(5, 4) - - sleep(test_times.delay - 10) + sleep(default_draw_delay - small_time) -- Nothing should yet be shown child.expect_screenshot() - sleep(10) + sleep(small_time) -- Symbol at cursor line should be drawn immediately child.expect_screenshot() - sleep(test_times.animation_step) + sleep(default_animation_step) child.expect_screenshot() end @@ -589,10 +608,10 @@ T['Auto drawing']['respects common events'] = new_set({ set_cursor(5, 4) child.lua('MiniIndentscope.undraw()') - sleep(10) + sleep(small_time) child.cmd('doautocmd ' .. event_name) - sleep(test_times.delay + test_times.animation_step * 1 + 1) + sleep(default_draw_delay + default_animation_step + small_time) child.expect_screenshot() end, }) @@ -612,42 +631,42 @@ T['Auto drawing']['respects ModeChanged event'] = function() child.lua([[require('mini.indentscope').setup({ draw = { delay = 0, animation = function() return 0 end } })]]) set_cursor(5, 4) - sleep(10) + sleep(small_time) child.expect_screenshot() type_keys('i') - sleep(10) + sleep(small_time) child.expect_screenshot() type_keys('') - sleep(10) + sleep(small_time) child.expect_screenshot() end T['Auto drawing']['respects `config.draw.delay`'] = function() - child.lua('MiniIndentscope.config.draw.delay = ' .. 0.5 * test_times.delay) + child.lua('MiniIndentscope.config.draw.delay = ' .. (0.5 * default_draw_delay)) set_cursor(5, 4) - sleep(0.5 * test_times.delay) + sleep(0.5 * default_draw_delay) child.expect_screenshot() -- Should also use buffer local config set_cursor(1, 0) - child.b.miniindentscope_config = { draw = { delay = 30 } } + child.b.miniindentscope_config = { draw = { delay = 2 * default_draw_delay } } set_cursor(5, 4) - sleep(30) + sleep(2 * default_draw_delay) child.expect_screenshot() end T['Auto drawing']['implements debounce-style delay'] = function() set_cursor(5, 4) - sleep(test_times.delay - 10) + sleep(default_draw_delay - small_time) set_cursor(2, 0) - sleep(test_times.delay - 10) + sleep(default_draw_delay - small_time) -- Should draw nothing child.expect_screenshot() - sleep(10) + sleep(small_time) -- Should start drawing child.expect_screenshot() end @@ -675,15 +694,15 @@ T['Auto drawing']['works in Insert mode'] = function() set_cursor(5, 4) type_keys('i') - sleep(test_times.delay - 10) + sleep(default_draw_delay - small_time) -- Nothing yet should be shown child.expect_screenshot() - sleep(10) + sleep(small_time) -- Show only on cursor line child.expect_screenshot() - sleep(test_times.animation_step) + sleep(default_animation_step) -- One new step should be drawn child.expect_screenshot() end @@ -692,7 +711,7 @@ T['Auto drawing']['updates immediately when scopes intersect'] = function() child.set_size(15, 15) set_cursor(5, 4) - sleep(test_times.delay + test_times.animation_step + 10) + sleep(default_draw_delay + default_animation_step + small_time) -- Full scope should be shown child.expect_screenshot() diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_jump.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_jump.lua index 877fc44e..7a38fb87 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_jump.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_jump.lua @@ -14,8 +14,7 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child, true) end --stylua: ignore end -- Data ======================================================================= @@ -26,7 +25,10 @@ local example_lines = { '`!@#$%^&*()_+=.,1234567890', } -local test_times = { highlight = 250 } +-- Time constants +local default_highlight_delay = 250 +local helper_message_delay = 1000 +local small_time = helpers.get_time_const(10) -- Output test set ============================================================ local T = new_set({ @@ -98,6 +100,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ silent = 1 }, 'silent', 'boolean') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniJump'), 'links to SpellRare') +end + T['setup()']['properly handles `config.mappings`'] = function() local has_map = function(lhs, pattern) return child.cmd_capture('nmap ' .. lhs):find(pattern) ~= nil end eq(has_map('f', 'Jump'), true) @@ -315,7 +322,7 @@ T['smart_jump()'] = new_set({ T['smart_jump()']['works'] = function() child.lua_notify('MiniJump.smart_jump()') - poke_eventloop() + child.poke_eventloop() type_keys('m') eq(get_cursor(), { 1, 4 }) end @@ -660,11 +667,11 @@ T['Jumping with f/t/F/T']['shows helper message after one idle second'] = functi set_lines(example_lines) set_cursor(1, 0) type_keys('f', 'e') - sleep(200) + sleep(0.5 * helper_message_delay) -- Start another jump type_keys('h', 'f') - sleep(1000) + sleep(helper_message_delay + small_time) -- Should show colored helper message without adding it to `:messages` and -- causing hit-enter-prompt child.expect_screenshot() @@ -733,7 +740,7 @@ T['Jumping with f/t/F/T']['respects `config.silent`'] = function() set_lines({ '1e2e3e4e' }) set_cursor(1, 0) type_keys('f') - sleep(1000 + 15) + sleep(helper_message_delay + small_time) -- Should not show helper message child.expect_screenshot() @@ -938,10 +945,10 @@ T['Delayed highlighting']['works'] = new_set( set_cursor(1, key == key:lower() and 0 or 3) type_keys(key, 'e') - sleep(test_times.highlight - 10) + sleep(default_highlight_delay - small_time) -- Nothing should yet be shown child.expect_screenshot() - sleep(10) + sleep(small_time) -- Everything should be shown child.expect_screenshot() end, @@ -955,15 +962,16 @@ T['Delayed highlighting']['respects `config.delay.highlight`'] = new_set( local key = vim.endswith(direction, '_till') and 't' or 'f' key = vim.startswith(direction, 'backward') and key:upper() or key - child.lua('MiniJump.config.delay.highlight = 100') + local new_highlight_delay = 5 * small_time + child.lua('MiniJump.config.delay.highlight = ' .. new_highlight_delay) set_cursor(1, key == key:lower() and 0 or 3) type_keys(key, 'e') - sleep(100 - 10) + sleep(new_highlight_delay - small_time) -- Nothing should yet be shown child.expect_screenshot() - sleep(10) + sleep(small_time) -- Everything should be shown child.expect_screenshot() end, @@ -971,16 +979,17 @@ T['Delayed highlighting']['respects `config.delay.highlight`'] = new_set( ) T['Delayed highlighting']['respects `vim.b.minijump_config`'] = function() - child.lua('MiniJump.config.delay.highlight = 100') - child.b.minijump_config = { delay = { highlight = 50 } } + child.lua('MiniJump.config.delay.highlight = ' .. (5 * small_time)) + local new_highlight_delay = 3 * small_time + child.b.minijump_config = { delay = { highlight = new_highlight_delay } } set_cursor(1, 0) type_keys('f', 'e') - sleep(50 - 10) + sleep(new_highlight_delay - small_time) -- Nothing should yet be shown child.expect_screenshot() - sleep(10) + sleep(small_time) -- Everything should be shown child.expect_screenshot() end @@ -990,23 +999,23 @@ T['Delayed highlighting']['implements debounce-style delay'] = function() set_cursor(1, 0) type_keys('f', 'e') - sleep(test_times.highlight - 10) + sleep(default_highlight_delay - small_time) -- Nothing should yet be shown child.expect_screenshot() type_keys('f') - sleep(test_times.highlight - 10) + sleep(default_highlight_delay - small_time) -- Nothing should yet be shown (because debounce-style) child.expect_screenshot() - sleep(10) + sleep(small_time) -- Nothing should yet be shown child.expect_screenshot() end T['Delayed highlighting']['stops immediately when not jumping'] = function() type_keys('f', 'e') - sleep(test_times.highlight) + sleep(default_highlight_delay) -- Should be highlighted child.expect_screenshot() @@ -1021,7 +1030,7 @@ T['Delayed highlighting']['updates immediately within same jumping'] = function( set_cursor(1, 0) type_keys('f', 'e') - sleep(test_times.highlight) + sleep(default_highlight_delay) child.expect_screenshot() type_keys('t') child.expect_screenshot() @@ -1038,11 +1047,11 @@ T['Delayed highlighting']['never highlights in Insert mode'] = function() set_cursor(1, 0) type_keys('f', 'e') - sleep(test_times.highlight) + sleep(default_highlight_delay) child.expect_screenshot() type_keys('ct', 'f') - sleep(test_times.highlight + 10) + sleep(default_highlight_delay + small_time) -- Shouldn't start highlighting child.expect_screenshot() end @@ -1054,7 +1063,7 @@ T['Delayed highlighting']["respects 'ignorecase'"] = function() set_cursor(1, 0) type_keys('f', 'e') - sleep(test_times.highlight) + sleep(default_highlight_delay) -- Should highlight both 'e'and 'E' child.expect_screenshot() end @@ -1067,17 +1076,15 @@ T['Delayed highlighting']["respects 'smartcase'"] = function() set_cursor(1, 0) type_keys('f', 'E') - sleep(test_times.highlight) + sleep(default_highlight_delay) -- Should highlight only 'E' child.expect_screenshot() end -local delay = test_times.highlight + 25 - T['Stop jumping after idle'] = new_set({ hooks = { pre_case = function() - child.lua('MiniJump.config.delay.idle_stop = ' .. delay) + child.lua('MiniJump.config.delay.idle_stop = ' .. (default_highlight_delay + 2 * small_time)) set_lines({ '1e2e3e4e', 'ff' }) set_cursor(1, 0) child.set_size(5, 12) @@ -1086,18 +1093,19 @@ T['Stop jumping after idle'] = new_set({ }) T['Stop jumping after idle']['works'] = function() + local idle_stop_delay = child.lua_get('MiniJump.config.delay.idle_stop') type_keys('f', 'e') eq(get_cursor(), { 1, 1 }) -- It works - sleep(delay - 10) + sleep(idle_stop_delay - small_time) type_keys('f') eq(get_cursor(), { 1, 3 }) - -- Should highlight + -- Should highlight (as idle delay is bigger than highlight delay) child.expect_screenshot() -- It implements debounce-style delay - sleep(delay + 1) + sleep(idle_stop_delay + small_time) -- It should have stopped jumping and this should initiate new jump type_keys('f', 'f') eq(get_cursor(), { 2, 0 }) @@ -1106,19 +1114,21 @@ T['Stop jumping after idle']['works'] = function() end T['Stop jumping after idle']['works if should be done before target highlighting'] = function() - child.lua('MiniJump.config.delay.idle_stop = ' .. test_times.highlight - 50) + child.lua('MiniJump.config.delay.idle_stop = ' .. (default_highlight_delay - small_time)) type_keys('f', 'e') eq(get_cursor(), { 1, 1 }) - sleep(test_times.highlight + 1) + sleep(default_highlight_delay + small_time) -- Should also not trigger highlighting child.expect_screenshot() end T['Stop jumping after idle']['respects `vim.b.minijump_config`'] = function() - child.b.minijump_config = { delay = { idle_stop = 50 } } + local idle_stop_delay = child.lua_get('MiniJump.config.delay.idle_stop') + local new_idle_stop_delay = idle_stop_delay - 2 * small_time + child.b.minijump_config = { delay = { idle_stop = new_idle_stop_delay } } type_keys('f', 'e') - sleep(50) + sleep(new_idle_stop_delay) -- It should have stopped jumping and this should initiate new jump type_keys('f', 'f') diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_jump2d.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_jump2d.lua index 9c4fd856..a47bec2b 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_jump2d.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_jump2d.lua @@ -13,8 +13,7 @@ local set_cursor = function(...) return child.set_cursor(...) end local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end local get_latest_message = function() return child.cmd_capture('1messages') end --stylua: ignore end @@ -81,6 +80,10 @@ local setup_two_windows = function() return wins end +-- Time constants +local helper_message_delay = 1000 +local small_time = helpers.get_time_const(10) + -- Output test set ============================================================ local T = new_set({ hooks = { @@ -174,6 +177,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ silent = 'a' }, 'silent', 'boolean') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniJump2dSpot'), 'gui=bold,nocombine guifg=[Ww]hite guibg=[Bb]lack') +end + T['setup()']['applies `config.mappings`'] = function() child.set_size(5, 12) set_lines({ 'xxxx', 'xxxx' }) @@ -210,11 +218,6 @@ T['setup()']['resets mapping in command-line window'] = function() eq(child.get_lines(), { 'Hello', '' }) end -T['setup()']['defines non-linked default highlighting on `ColorScheme`'] = function() - child.cmd('colorscheme blue') - expect.match(child.cmd_capture('hi MiniJump2dSpot'), 'gui=bold,nocombine guifg=[Ww]hite guibg=[Bb]lack') -end - T['start()'] = new_set({ hooks = { pre_case = function() @@ -230,7 +233,7 @@ T['start()'] = new_set({ local start = function(...) child.lua('MiniJump2d.start(...)', { ... }) - poke_eventloop() + child.poke_eventloop() end T['start()']['works'] = function() @@ -355,7 +358,7 @@ T['start()']['prompts helper message after one idle second'] = function() child.lua([[MiniJump2d.config.labels = 'jk']]) start() - sleep(1000 + 10) + sleep(helper_message_delay + small_time) -- Should show helper message without adding it to `:messages` and causing -- hit-enter-prompt @@ -364,11 +367,11 @@ T['start()']['prompts helper message after one idle second'] = function() -- Should clean afterwards type_keys('j') - sleep(10) + sleep(small_time) child.expect_screenshot() -- Should show message for every key in sequence - sleep(1000 + 10) + sleep(helper_message_delay + small_time) child.expect_screenshot() end @@ -856,7 +859,7 @@ T['start()']['respects `config.silent`'] = function() child.set_size(10, 20) start() - sleep(1000 + 15) + sleep(helper_message_delay + small_time) -- Should not show helper message child.expect_screenshot() @@ -1142,9 +1145,9 @@ T['builtin_opts.single_character']['prompts helper message after one idle second start_single_char() eq(get_latest_message(), '') - sleep(1000 - 10) + sleep(helper_message_delay - small_time) eq(get_latest_message(), '') - sleep(10 + 1) + sleep(small_time + small_time) -- Should show helper message without adding it to `:messages` and causing -- hit-enter-prompt diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_map.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_map.lua index 8afa1fc0..047f73aa 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_map.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_map.lua @@ -241,6 +241,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ window = { zindex = 'a' } }, 'window.zindex', 'number') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniMapNormal'), 'links to NormalFloat') +end + local encode_strings = function(strings, opts) local cmd = string.format('MiniMap.encode_strings(%s, %s)', vim.inspect(strings), vim.inspect(opts)) return child.lua_get(cmd) @@ -1215,17 +1220,16 @@ T['gen_integration']['diff()']['updates when appropriate'] = function() mock_diff() child.lua([[ - MiniMap.current.opts.integrations = { MiniMap.gen_integration.diff() } - _G.log = {} local refresh_orig = MiniMap.refresh MiniMap.refresh = function(...) - table.insert(_G.log, { ... }) + _G.n = (_G.n or 0) + 1 refresh_orig(...) end ]]) - eq(child.lua_get('#_G.log'), 0) + child.lua('MiniMap.current.opts.integrations = { MiniMap.gen_integration.diff() }') + child.lua('_G.n = 0') child.cmd('doautocmd User MiniDiffUpdated') - eq(child.lua_get('#_G.log'), 1) + eq(child.lua_get('_G.n'), 1) end T['gen_integration']['diff()']['works if no diff data is found'] = function() diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_misc.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_misc.lua index f3053db7..adac0424 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_misc.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_misc.lua @@ -4,9 +4,17 @@ local child = helpers.new_child_neovim() local expect, eq = helpers.expect, helpers.expect.equality local new_set = MiniTest.new_set -local path_sep = package.config:sub(1, 1) -local project_root = vim.fn.fnamemodify(vim.fn.getcwd(), ':p') -local dir_misc_path = project_root .. 'tests/dir-misc/' +local fs_normalize = vim.fs.normalize +if vim.fn.has('nvim-0.9') == 0 then + fs_normalize = function(...) return vim.fs.normalize(...):gsub('(.)/+$', '%1') end +end + +local skip_if_no_010 = function() + if child.fn.has('nvim-0.10') == 0 then MiniTest.skip('`setup_termbg_sync()` works only on Neovim>=0.10') end +end + +local project_root = fs_normalize(vim.fn.fnamemodify(vim.fn.getcwd(), ':p')) +local dir_misc_path = project_root .. '/tests/dir-misc' -- Helpers with child processes --stylua: ignore start @@ -15,14 +23,18 @@ local unload_module = function() child.mini_unload('misc') end local reload_module = function(config) unload_module(); load_module(config) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end -local make_path = function(...) return table.concat({...}, path_sep):gsub(path_sep .. path_sep, path_sep) end +local make_path = function(...) return fs_normalize(table.concat({...}, '/')) end local make_abspath = function(...) return make_path(project_root, ...) end -local getcwd = function() return child.fn.fnamemodify(child.fn.getcwd(), ':p') end +local getcwd = function() return fs_normalize(child.fn.getcwd()) end local set_cursor = function(...) return child.set_cursor(...) end local get_cursor = function(...) return child.get_cursor(...) end local edit = function(x) child.cmd('edit ' .. x) end --stylua: ignore end +-- Time constants +local small_time = helpers.get_time_const(10) +local no_term_response_delay = 1000 + -- Output test set ============================================================ local T = new_set({ hooks = { @@ -72,7 +84,10 @@ end T['bench_time()'] = new_set({ hooks = { - pre_case = function() child.lua('_G.f = function(ms) ms = ms or 10; vim.loop.sleep(ms); return ms end') end, + pre_case = function() + child.lua('_G.small_time = ' .. small_time) + child.lua('_G.f = function(ms) ms = ms or _G.small_time; vim.loop.sleep(ms); return ms end') + end, }, }) @@ -80,13 +95,15 @@ local bench_time = function(...) return unpack(child.lua_get('{ MiniMisc.bench_t -- Validate that benchmark is within tolerable error from target. This is -- needed due to random nature of benchmarks. -local validate_benchmark = function(time_tbl, target, error) - error = error or 0.2 +local validate_benchmark = function(time_tbl, target) + helpers.skip_if_slow() + local s, n = 0, 0 for _, x in ipairs(time_tbl) do s, n = s + x, n + 1 end + local error = 0.2 eq(n * target * (1 - error) < s, true) eq(s < target * (1 + error) * n, true) end @@ -95,23 +112,23 @@ T['bench_time()']['works'] = function() local b, res = bench_time() -- By default should run function once eq(#b, 1) - validate_benchmark(b, 0.01) + validate_benchmark(b, 0.001 * small_time) -- Second value is function output - eq(res, 10) + eq(res, small_time) end T['bench_time()']['respects `n` argument'] = function() local b, _ = bench_time(5) -- By default should run function once eq(#b, 5) - validate_benchmark(b, 0.01) + validate_benchmark(b, 0.001 * small_time) end T['bench_time()']['respects `...` as benched time arguments'] = function() - local b, res = bench_time(1, 50) - validate_benchmark(b, 0.05) + local b, res = bench_time(1, 5 * small_time) + validate_benchmark(b, 0.001 * 5 * small_time) -- Second value is function output - eq(res, 50) + eq(res, 5 * small_time) end T['get_gutter_width()'] = new_set() @@ -204,7 +221,7 @@ T['resize_window()']['works'] = function() end T['resize_window()']['correctly computes default `text_width` argument'] = function() - child.api.nvim_win_set_option(0, 'signcolumn', 'yes:2') + child.wo.signcolumn = 'yes:2' -- min(vim.o.columns, 79) < textwidth < colorcolumn child.o.columns = 160 @@ -234,15 +251,11 @@ T['resize_window()']['correctly computes default `text_width` argument'] = funct eq(child.api.nvim_win_get_width(0), 40 + 4) end -local git_repo_path = make_abspath('tests/dir-misc/mocked-git-repo/') +local git_repo_path = make_abspath('tests/dir-misc/mocked-git-repo') local git_path = make_abspath('tests/dir-misc/mocked-git-repo/.git') local test_file_makefile = make_abspath('tests/dir-misc/aaa.lua') local test_file_git = make_abspath('tests/dir-misc/mocked-git-repo/bbb.lua') -local skip_if_no_fs = function() - if child.lua_get('type(vim.fs)') == 'nil' then MiniTest.skip('No `vim.fs`.') end -end - local init_mock_git = function(git_type) if git_type == 'file' then -- File '.git' is used inside submodules @@ -259,7 +272,6 @@ T['setup_auto_root()'] = new_set({ hooks = { post_case = cleanup_mock_git } }) local setup_auto_root = function(...) child.lua('MiniMisc.setup_auto_root(...)', { ... }) end T['setup_auto_root()']['works'] = function() - skip_if_no_fs() eq(getcwd(), project_root) child.o.autochdir = true @@ -285,15 +297,12 @@ T['setup_auto_root()']['works'] = function() end T['setup_auto_root()']['validates input'] = function() - skip_if_no_fs() - expect.error(function() setup_auto_root('a') end, '`names`.*array') expect.error(function() setup_auto_root({ 1 }) end, '`names`.*string') expect.error(function() setup_auto_root({ '.git' }, 1) end, '`fallback`.*callable') end T['setup_auto_root()']['respects `names` argument'] = function() - skip_if_no_fs() init_mock_git('directory') setup_auto_root({ 'Makefile' }) @@ -303,7 +312,6 @@ T['setup_auto_root()']['respects `names` argument'] = function() end T['setup_auto_root()']['allows callable `names`'] = function() - skip_if_no_fs() init_mock_git('directory') child.lua([[_G.find_aaa = function(x) return x == 'aaa.lua' end]]) child.lua('MiniMisc.setup_auto_root(_G.find_aaa)') @@ -315,8 +323,6 @@ T['setup_auto_root()']['allows callable `names`'] = function() end T['setup_auto_root()']['respects `fallback` argument'] = function() - skip_if_no_fs() - -- Should return and cache fallback result if not found root by going up -- NOTE: More tests are done in `find_root()` local lua_cmd = string.format( @@ -326,13 +332,11 @@ T['setup_auto_root()']['respects `fallback` argument'] = function() child.lua(lua_cmd) child.cmd('edit ' .. test_file_git) - eq(child.lua_get('_G.path_arg'), child.api.nvim_buf_get_name(0)) + eq(child.lua_get('_G.path_arg'), fs_normalize(child.api.nvim_buf_get_name(0))) eq(getcwd(), dir_misc_path) end T['setup_auto_root()']['works in buffers without path'] = function() - skip_if_no_fs() - setup_auto_root() local scratch_buf_id = child.api.nvim_create_buf(false, true) @@ -347,8 +351,6 @@ T['find_root()'] = new_set({ hooks = { post_case = cleanup_mock_git } }) local find_root = function(...) return child.lua_get('MiniMisc.find_root(...)', { ... }) end T['find_root()']['works'] = function() - skip_if_no_fs() - -- Respects 'Makefile' child.cmd('edit ' .. test_file_makefile) eq(find_root(), dir_misc_path) @@ -365,8 +367,6 @@ T['find_root()']['works'] = function() end T['find_root()']['validates arguments'] = function() - skip_if_no_fs() - expect.error(function() find_root('a') end, '`buf_id`.*number') expect.error(function() find_root(0, 1) end, '`names`.*string') expect.error(function() find_root(0, '.git') end, '`names`.*array') @@ -374,7 +374,6 @@ T['find_root()']['validates arguments'] = function() end T['find_root()']['respects `buf_id` argument'] = function() - skip_if_no_fs() init_mock_git('directory') child.cmd('edit ' .. test_file_makefile) @@ -386,7 +385,6 @@ T['find_root()']['respects `buf_id` argument'] = function() end T['find_root()']['respects `names` argument'] = function() - skip_if_no_fs() init_mock_git('directory') -- Should not stop on git repo directory, but continue going up @@ -395,7 +393,6 @@ T['find_root()']['respects `names` argument'] = function() end T['find_root()']['allows callable `names`'] = function() - skip_if_no_fs() init_mock_git('directory') child.cmd('edit ' .. test_file_git) @@ -404,8 +401,6 @@ T['find_root()']['allows callable `names`'] = function() end T['find_root()']['respects `fallback` argument'] = function() - skip_if_no_fs() - local validate = function(fallback_output, ref) local lua_cmd = string.format( [[MiniMisc.find_root( @@ -418,7 +413,7 @@ T['find_root()']['respects `fallback` argument'] = function() eq(child.lua_get(lua_cmd), ref) -- Fallback should be called with buffer path - eq(child.lua_get('_G.path_arg'), child.api.nvim_buf_get_name(0)) + eq(child.lua_get('_G.path_arg'), fs_normalize(child.api.nvim_buf_get_name(0))) -- Cleanup child.lua('_G.path_arg = nil') @@ -440,16 +435,12 @@ T['find_root()']['respects `fallback` argument'] = function() end T['find_root()']['works in buffers without path'] = function() - skip_if_no_fs() - local scratch_buf_id = child.api.nvim_create_buf(false, true) child.api.nvim_set_current_buf(scratch_buf_id) eq(find_root(), vim.NIL) end T['find_root()']['uses cache'] = function() - skip_if_no_fs() - child.cmd('edit ' .. test_file_git) -- Returns root based on 'Makefile' as there is no git root eq(find_root(), dir_misc_path) @@ -463,16 +454,21 @@ end T['setup_termbg_sync()'] = new_set({ hooks = { pre_case = function() - -- Mock `io.write` used to send control sequences to terminal emulator child.lua([[ + -- Mock `io.stdout:write` used to send control sequences to terminal emulator _G.log = {} - io.write = function(...) table.insert(_G.log, { ... }) end + io.stdout = { write = function(self, ...) table.insert(_G.log, { ... }) end } + + -- Mock attached UI + vim.api.nvim_list_uis = function() return { { stdout_tty = true } } end ]]) end, }, }) T['setup_termbg_sync()']['works'] = function() + skip_if_no_010() + local eq_log = function(ref_log) eq(child.lua_get('_G.log'), ref_log) child.lua('_G.log = {}') @@ -495,12 +491,15 @@ T['setup_termbg_sync()']['works'] = function() child.api.nvim_exec_autocmds(event, {}) eq_log({ { log_entry } }) end - validate_event('UIEnter', '\027]11;#dddddd\007') + validate_event('VimResume', '\027]11;#dddddd\007') validate_event('ColorScheme', '\027]11;#dddddd\007') - validate_event('UILeave', '\027]11;#11262d\007') + validate_event('VimLeavePre', '\027]11;#11262d\007') + validate_event('VimSuspend', '\027]11;#11262d\007') end T['setup_termbg_sync()']['can be called multiple times'] = function() + skip_if_no_010() + child.cmd('hi Normal guifg=#222222 guibg=#dddddd') child.lua('MiniMisc.setup_termbg_sync()') child.api.nvim_exec_autocmds('TermResponse', { data = '\27]11;rgb:1111/2626/2d2d' }) @@ -514,11 +513,31 @@ T['setup_termbg_sync()']['can be called multiple times'] = function() child.lua('_G.log = {}') -- Should reset to the color from the very first call - child.api.nvim_exec_autocmds('UILeave', {}) + child.api.nvim_exec_autocmds('VimLeavePre', {}) eq(child.lua_get('_G.log'), { { '\27]11;#11262d\a' } }) end +T['setup_termbg_sync()']['does nothing if there is no proper stdout'] = function() + skip_if_no_010() + + local validate = function() + child.lua('MiniMisc.setup_termbg_sync()') + child.api.nvim_create_augroup('MiniMiscTermbgSync', { clear = false }) + eq(child.lua_get('#vim.api.nvim_get_autocmds({ group = "MiniMiscTermbgSync" })'), 0) + end + + -- No UI + child.lua('vim.api.nvim_list_uis = function() return {} end') + validate() + + -- UI without stdout (like GUI) + child.lua('vim.api.nvim_list_uis = function() return { { stdout_tty = false } } end') + validate() +end + T['setup_termbg_sync()']['handles no response from terminal emulator'] = function() + skip_if_no_010() + child.lua('_G.notify_log = {}; vim.notify = function(...) table.insert(_G.notify_log, { ... }) end') child.lua('MiniMisc.setup_termbg_sync()') local validate_n_autocmds = function(ref_n) @@ -527,7 +546,7 @@ T['setup_termbg_sync()']['handles no response from terminal emulator'] = functio validate_n_autocmds(1) -- If there is no response from terminal emulator for 1s, delete autocmd - vim.loop.sleep(1000 + 10) + vim.loop.sleep(no_term_response_delay + small_time) validate_n_autocmds(0) -- Should show informative notification @@ -539,6 +558,8 @@ T['setup_termbg_sync()']['handles no response from terminal emulator'] = functio end T['setup_termbg_sync()']['handles bad response from terminal emulator'] = function() + skip_if_no_010() + child.lua('_G.notify_log = {}; vim.notify = function(...) table.insert(_G.notify_log, { ... }) end') child.lua('MiniMisc.setup_termbg_sync()') child.api.nvim_exec_autocmds('TermResponse', { data = 'something-bad' }) @@ -555,6 +576,8 @@ T['setup_termbg_sync()']['handles bad response from terminal emulator'] = functi end T['setup_termbg_sync()']['handles different color formats'] = function() + skip_if_no_010() + local validate = function(term_response_color, ref_color) -- Mock clean start to overcome that color is parsed only once per session child.lua('package.loaded["mini.misc"] = nil') @@ -563,7 +586,7 @@ T['setup_termbg_sync()']['handles different color formats'] = function() -- Should properly parse initial background and use it to reset on exit child.lua('_G.log = {}') - child.api.nvim_exec_autocmds('UILeave', {}) + child.api.nvim_exec_autocmds('VimLeavePre', {}) eq(child.lua_get('_G.log'), { { '\027]11;' .. ref_color .. '\007' } }) -- Clean up @@ -770,15 +793,15 @@ T['use_nested_comments()'] = new_set({ }) T['use_nested_comments()']['works'] = function() - child.api.nvim_buf_set_option(0, 'commentstring', '# %s') + child.bo.commentstring = '# %s' child.lua('MiniMisc.use_nested_comments()') - eq(child.api.nvim_buf_get_option(0, 'comments'), 'n:#,' .. comments_option) + eq(child.bo.comments, 'n:#,' .. comments_option) end T['use_nested_comments()']["ignores 'commentstring' with two parts"] = function() - child.api.nvim_buf_set_option(0, 'commentstring', '/*%s*/') + child.bo.commentstring = '/*%s*/' child.lua('MiniMisc.use_nested_comments()') - eq(child.api.nvim_buf_get_option(0, 'comments'), comments_option) + eq(child.bo.comments, comments_option) end T['use_nested_comments()']['respects `buf_id` argument'] = function() @@ -787,7 +810,7 @@ T['use_nested_comments()']['respects `buf_id` argument'] = function() child.lua('MiniMisc.use_nested_comments(...)', { new_buf_id }) - eq(child.api.nvim_buf_get_option(0, 'comments'), comments_option) + eq(child.bo.comments, comments_option) eq(child.api.nvim_buf_get_option(new_buf_id, 'comments'), 'n:#,' .. comments_option) end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_move.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_move.lua index 7264f04d..39e9c158 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_move.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_move.lua @@ -18,6 +18,27 @@ local type_keys = function(...) return child.type_keys(...) end local get_fold_range = function(line_num) return { child.fn.foldclosed(line_num), child.fn.foldclosedend(line_num) } end +local setup_registers = function() + local reginfo_arr = { + { reg = '0', info = { regcontents = { '0', '0', '0' }, regtype = '\0221' } }, + { reg = '1', info = { regcontents = { '111', '111' }, regtype = 'V' } }, + { reg = '2', info = { regcontents = { '222', '222' }, regtype = 'V' } }, + { reg = '9', info = { regcontents = { '999', '999' }, regtype = 'V' } }, + { reg = '-', info = { regcontents = { '---' }, regtype = 'v' } }, + { reg = 'z', info = { regcontents = { 'zzz' }, regtype = 'v' } }, + { reg = '"', info = { points_to = 'z' } }, + } + local ref = {} + for _, data in ipairs(reginfo_arr) do + child.fn.setreg(data.reg, data.info) + ref[data.reg] = child.fn.getreginfo(data.reg) + end + -- Make sure that 'z' register has proper `isunnamed` field + ref['z'] = child.fn.getreginfo('z') + + return ref +end + local validate_state = function(lines, selection) eq(get_lines(), lines) eq({ { child.fn.line('v'), child.fn.col('v') }, { child.fn.line('.'), child.fn.col('.') } }, selection) @@ -736,17 +757,44 @@ T['move_selection()']['works with multibyte characters'] = function() validate_state({ 'ыыы', '', 'ыыXXыыы' }, { { 3, 5 }, { 3, 6 } }) end +T['move_selection()']['works in small buffers'] = function() + local validate = function(line_before, vis_mode, direction, line_after) + child.ensure_normal_mode() + set_lines({ line_before }) + set_cursor(1, 1) + type_keys(vis_mode) + move(direction) + eq(get_lines(), { line_after or line_before }) + end + + -- Should do nothing in empty buffer + for _, vis_mode in ipairs({ 'v', 'V', '' }) do + for _, direction in ipairs({ 'up', 'down', 'left', 'right' }) do + validate('', vis_mode, direction) + end + end + + -- Should work only horizontally in single line buffer + validate('abc', 'v', 'up', 'abc') + validate('abc', 'v', 'down', 'abc') + validate('abc', 'V', 'up', 'abc') + validate('abc', 'V', 'down', 'abc') + validate('abc', '', 'up', 'abc') + validate('abc', '', 'down', 'abc') + + validate('abc', 'v', 'left', 'bac') + validate('abc', 'v', 'right', 'acb') + validate('\tabc', 'V', 'left', 'abc') + validate('abc', 'V', 'right', '\tabc') + validate('abc', '', 'left', 'bac') + validate('abc', '', 'right', 'acb') +end + T['move_selection()']['has no side effects'] = function() - set_lines({ 'abXcd' }) + set_lines({ 'aaa', 'bbb' }) - -- Shouldn't modify used `z` or unnamed registers - set_cursor(1, 0) - type_keys('"zyl') - eq(child.fn.getreg('z'), 'a') - - set_cursor(1, 1) - type_keys('yl') - eq(child.fn.getreg('"'), 'b') + -- Shouldn't modify any possibly affected registers + local reginfo_ref = setup_registers() -- Shouldn't modify 'virtualedit' child.o.virtualedit = 'block,insert' @@ -754,18 +802,29 @@ T['move_selection()']['has no side effects'] = function() -- Shouldn't affect yank history from 'mini.bracketed' child.cmd('au TextYankPost * lua if not vim.b.minibracketed_disable then _G.been_here = true end') - -- Perform move - set_cursor(1, 2) - type_keys('v') - move('right') - validate_state1d('abcXd', { 4, 4 }) + local validate = function() + for reg, info in pairs(reginfo_ref) do + eq(child.fn.getreginfo(reg), info) + end + eq(child.o.virtualedit, 'block,insert') + eq(child.lua_get('_G.been_here'), vim.NIL) + eq(child.lua_get('vim.b.minibracketed_disable'), vim.NIL) + end - -- Check - eq(child.fn.getreg('z'), 'a') - eq(child.fn.getreg('"'), 'b') - eq(child.o.virtualedit, 'block,insert') - eq(child.lua_get('_G.been_here'), vim.NIL) - eq(child.lua_get('vim.b.minibracketed_disable'), vim.NIL) + -- Perform linewise move + set_cursor(1, 0) + type_keys('V') + move('down') + validate_state({ 'bbb', 'aaa' }, { { 2, 1 }, { 2, 1 } }) + validate() + child.ensure_normal_mode() + + -- Perform charwise move + set_cursor(1, 1) + type_keys('v') + move('down') + validate_state({ 'bb', 'abaa' }, { { 2, 2 }, { 2, 2 } }) + validate() end T['move_selection()']['works with `virtualedit=all`'] = function() @@ -1061,17 +1120,32 @@ T['move_line()']['respects `opts.n_times` horizontally'] = function() validate_line_state({ '\taa' }, { 1, 1 }) end +T['move_line()']['works in small buffers'] = function() + local validate = function(line_before, direction, line_after) + set_lines({ line_before }) + set_cursor(1, 0) + move_line(direction) + eq(get_lines(), { line_after or line_before }) + end + + -- Should do nothing in empty buffer + validate('', 'up', '') + validate('', 'down', '') + validate('', 'left', '') + validate('', 'right', '') + + -- Should work only horizontally in single line buffer + validate('abc', 'up', 'abc') + validate('abc', 'down', 'abc') + validate('\tabc', 'left', 'abc') + validate('abc', 'right', '\tabc') +end + T['move_line()']['has no side effects'] = function() set_lines({ 'aaa', 'bbb' }) - -- Shouldn't modify used `z` and unnamed registers - set_cursor(1, 0) - type_keys('"zyl') - eq(child.fn.getreg('z'), 'a') - - set_cursor(2, 0) - type_keys('yl') - eq(child.fn.getreg('"'), 'b') + -- Shouldn't modify any possibly affected registers + local reginfo_ref = setup_registers() -- Shouldn't affect yank history from 'mini.bracketed' child.cmd('au TextYankPost * lua if not vim.b.minibracketed_disable then _G.been_here = true end') @@ -1082,8 +1156,9 @@ T['move_line()']['has no side effects'] = function() validate_line_state({ 'bbb', 'aaa' }, { 2, 0 }) -- Check - eq(child.fn.getreg('z'), 'a') - eq(child.fn.getreg('"'), 'b') + for reg, info in pairs(reginfo_ref) do + eq(child.fn.getreginfo(reg), info) + end eq(child.lua_get('_G.been_here'), vim.NIL) eq(child.lua_get('vim.b.minibracketed_disable'), vim.NIL) end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_notify.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_notify.lua index 06ebbfa7..0de696fd 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_notify.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_notify.lua @@ -8,8 +8,7 @@ local new_set = MiniTest.new_set --stylua: ignore start local load_module = function(config) child.mini_load('notify', config) end local unload_module = function() child.mini_unload('notify') end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end -- Common test helpers @@ -35,13 +34,13 @@ local get = forward_lua('MiniNotify.get') local get_all = forward_lua('MiniNotify.get_all') -- Common mocks -local ref_seconds, ref_microseconds = 1703673296, 0.123456 +local ref_seconds, ref_microseconds = 1703680496, 0.123456 local mock_gettimeofday = function() -- Ensure reproducibility of `vim.fn.strftime` - child.lua([[ - vim.loop.os_setenv('TZ', 'Europe/Kiev') - vim.cmd('language time en_US.utf8') - ]]) + child.loop.os_setenv('TZ', 'Etc/UTC') + child.loop.os_setenv('_TZ', 'Etc/UTC') + child.cmd('language time en_US.UTF-8') + local lua_cmd = string.format( [[local start, n = %d, -1 vim.loop.gettimeofday = function() @@ -54,6 +53,10 @@ local mock_gettimeofday = function() child.lua(lua_cmd) end +-- Time constants +local default_duration_last = 1000 +local small_time = helpers.get_time_const(10) + -- Output test set ============================================================ local T = new_set({ hooks = { @@ -137,6 +140,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ window = { winblend = 'a' } }, 'window.winblend', 'number') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniNotifyBorder'), 'links to FloatBorder') +end + T['make_notify()'] = new_set() local notify = forward_lua('vim.notify') @@ -145,14 +153,16 @@ T['make_notify()']['works'] = function() child.set_size(10, 45) mock_gettimeofday() + local test_duration = 5 * small_time + child.lua('_G.dur = ' .. test_duration) child.lua([[ local level_opts = { - ERROR = { duration = 300 }, - WARN = { duration = 250 }, - INFO = { duration = 200 }, - DEBUG = { duration = 150 }, - TRACE = { duration = 100 }, - OFF = { duration = 50 }, + ERROR = { duration = 6 * _G.dur }, + WARN = { duration = 5 * _G.dur }, + INFO = { duration = 4 * _G.dur }, + DEBUG = { duration = 3 * _G.dur }, + TRACE = { duration = 2 * _G.dur }, + OFF = { duration = 1 * _G.dur }, } vim.notify = MiniNotify.make_notify(level_opts) ]]) @@ -190,17 +200,17 @@ T['make_notify()']['works'] = function() -- Should make notifications disappear after configured duration validate_active({ 'error', 'warn', 'info', 'debug', 'trace', 'off' }) - sleep(50 + 10) + sleep(test_duration + small_time) validate_active({ 'error', 'warn', 'info', 'debug', 'trace' }) - sleep(50) + sleep(test_duration) validate_active({ 'error', 'warn', 'info', 'debug' }) - sleep(50) + sleep(test_duration) validate_active({ 'error', 'warn', 'info' }) - sleep(50) + sleep(test_duration) validate_active({ 'error', 'warn' }) - sleep(50) + sleep(test_duration) validate_active({ 'error' }) - sleep(50) + sleep(test_duration) validate_active({}) end @@ -248,12 +258,13 @@ T['make_notify()']['validates arguments'] = function() end T['make_notify()']['has output working in `libuv` callbacks'] = function() + child.lua('_G.dur = ' .. small_time) child.lua([[ vim.notify = MiniNotify.make_notify() local timer = vim.loop.new_timer() - timer:start(1, 0, function() vim.notify('Hello', vim.log.levels.INFO) end) + timer:start(_G.dur, 0, function() vim.notify('Hello', vim.log.levels.INFO) end) ]]) - sleep(1 + 1) + sleep(small_time + small_time) eq(child.cmd_capture('messages'), '') eq(get_all()[1].msg, 'Hello') end @@ -474,6 +485,7 @@ T['clear()']['affects only active notifications'] = function() eq(type(ts_remove_1), 'number') eq(get(id_2).ts_remove, nil) + sleep(small_time) clear() eq(get(id_1).ts_remove, ts_remove_1) local ts_remove_2 = get(id_2).ts_remove @@ -971,9 +983,9 @@ T['LSP progress']['works'] = function() child.expect_screenshot() -- Should wait some time and then hide notifications - sleep(child.lua_get('MiniNotify.config.lsp_progress.duration_last') - 10) + sleep(default_duration_last - small_time) child.expect_screenshot() - sleep(10 + 10) + sleep(small_time + small_time) child.expect_screenshot() -- Should update single notification (and not remove/add new ones) @@ -1033,12 +1045,13 @@ T['LSP progress']['respects `lsp_progress.duration_last`'] = function() result.value.kind, result.value.message, result.value.percentage = 'report', '1/1', 100 call_handler(result, ctx) - child.lua('MiniNotify.config.lsp_progress.duration_last = 50') + local new_duration_last = 6 * small_time + child.lua('MiniNotify.config.lsp_progress.duration_last = ' .. new_duration_last) result.value.kind, result.value.message, result.value.percentage = 'end', 'done', nil call_handler(result, ctx) - sleep(50 - 10) + sleep(new_duration_last - 2 * small_time) child.expect_screenshot() - sleep(10 + 10) + sleep(2 * small_time + small_time) child.expect_screenshot() end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_operators.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_operators.lua index f7efa5b5..632b9837 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_operators.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_operators.lua @@ -57,6 +57,9 @@ T['setup()']['creates side effects'] = function() -- Global variable eq(child.lua_get('type(_G.MiniOperators)'), 'table') + -- Autocommand group + eq(child.fn.exists('#MiniOperators'), 1) + -- Highlight groups child.cmd('hi clear') load_module() @@ -121,6 +124,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ sort = { func = 'a' } }, 'sort.func', 'function') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniOperatorsExchangeFrom'), 'links to IncSearch') +end + T['setup()']['removes built-in LSP mappings'] = function() eq(child.fn.maparg('gra'), '') eq(child.fn.maparg('grn'), '') @@ -441,9 +449,43 @@ T['Evaluate']['works in Visual mode'] = function() validate_edit({ '1 + 1', '1 + 2' }, { 1, 0 }, { 'j$', 'g=' }, { '2', '3' }, { 1, 0 }) end -T['Evaluate']['works blockwise in Visual mode with `virtualedit=block`'] = function() +T['Evaluate']['works with different `virtualedit`'] = function() + local validate = function() + -- Charwise + validate_edit1d('1+1=x', 0, { 'g=', '3l' }, '2=x', 0) + validate_edit1d('x=1+1=x', 2, { 'g=', '3l' }, 'x=2=x', 2) + validate_edit1d('x=1+1', 2, { 'g=', '3l' }, 'x=2', 2) + + validate_edit1d('1+1=x', 0, { 'v2l', 'g=' }, '2=x', 0) + validate_edit1d('x=1+1=x', 2, { 'v2l', 'g=' }, 'x=2=x', 2) + validate_edit1d('x=1+1', 2, { 'v2l', 'g=' }, 'x=2', 2) + + -- Linewise + validate_edit({ '0+1', '0+2', '0+3' }, { 1, 0 }, { 'g==' }, { '1', '0+2', '0+3' }, { 1, 0 }) + validate_edit({ '0+1', '0+2', '0+3' }, { 2, 0 }, { 'g==' }, { '0+1', '2', '0+3' }, { 2, 0 }) + validate_edit({ '0+1', '0+2', '0+3' }, { 3, 0 }, { 'g==' }, { '0+1', '0+2', '3' }, { 3, 0 }) + + validate_edit({ '0+1', '0+2', '0+3' }, { 1, 0 }, { 'V', 'g=' }, { '1', '0+2', '0+3' }, { 1, 0 }) + validate_edit({ '0+1', '0+2', '0+3' }, { 2, 0 }, { 'V', 'g=' }, { '0+1', '2', '0+3' }, { 2, 0 }) + validate_edit({ '0+1', '0+2', '0+3' }, { 3, 0 }, { 'V', 'g=' }, { '0+1', '0+2', '3' }, { 3, 0 }) + + -- Blockwise + child.lua([[vim.keymap.set('o', 'iL', function() vim.cmd('normal! \22jll') end)]]) + validate_edit({ '1+1=x', '1+2=y' }, { 1, 0 }, { 'g=', 'iL' }, { '2 =x', '3 =y' }, { 1, 0 }) + validate_edit({ 'x=1+1=x', 'y=1+2=y' }, { 1, 2 }, { 'g=', 'iL' }, { 'x=2 =x', 'y=3 =y' }, { 1, 2 }) + validate_edit({ 'x=1+1', 'y=1+2' }, { 1, 2 }, { 'g=', 'iL' }, { 'x=2', 'y=3' }, { 1, 2 }) + + validate_edit({ '1+1=x', '1+2=y' }, { 1, 0 }, { 'jll', 'g=' }, { '2 =x', '3 =y' }, { 1, 0 }) + validate_edit({ 'x=1+1=x', 'y=1+2=y' }, { 1, 2 }, { 'jll', 'g=' }, { 'x=2 =x', 'y=3 =y' }, { 1, 2 }) + validate_edit({ 'x=1+1', 'y=1+2' }, { 1, 2 }, { 'jll', 'g=' }, { 'x=2', 'y=3' }, { 1, 2 }) + end + + child.o.virtualedit = 'all' + validate() + child.o.virtualedit = 'onemore' + validate() child.o.virtualedit = 'block' - validate_edit({ 'x=1+1=x', 'y=1+2=y' }, { 1, 2 }, { 'j2l', 'g=' }, { 'x=2 =x', 'y=3 =y' }, { 1, 2 }) + validate() end T['Evaluate']['respects `config.evaluate.func`'] = function() @@ -765,9 +807,44 @@ T['Exchange']['works in Visual mode'] = function() validate_edit({ 'ab', 'cd' }, { 1, 1 }, { 'jgx', 'h', 'jgx' }, { 'ba', 'dc' }, { 1, 0 }) end -T['Exchange']['works blockwise in Visual mode with `virtualedit=block`'] = function() +T['Exchange']['works with different `virtualedit`'] = function() + local validate = function() + -- Charwise + validate_edit1d('aa bb cc', 3, { 'gx', 'iw', 'b', 'gx', 'iw' }, 'bb aa cc', 0) + validate_edit1d('aa bb cc', 0, { 'gx', 'iw', 'w', 'gx', 'iw' }, 'bb aa cc', 3) + validate_edit1d('aa bb cc', 0, { 'gx', 'iw', '2w', 'gx', 'iw' }, 'cc bb aa', 6) + + validate_edit1d('aa bb cc', 3, { 'viw', 'gx', '2b', 'viw', 'gx' }, 'bb aa cc', 0) + validate_edit1d('aa bb cc', 0, { 'viw', 'gx', 'w', 'viw', 'gx' }, 'bb aa cc', 3) + validate_edit1d('aa bb cc', 0, { 'viw', 'gx', '2w', 'viw', 'gx' }, 'cc bb aa', 6) + + -- Linewise + validate_edit({ 'aa', 'bb', 'cc' }, { 1, 0 }, { 'gxx', 'j', 'gxx' }, { 'bb', 'aa', 'cc' }, { 2, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 2, 0 }, { 'gxx', 'j', 'gxx' }, { 'aa', 'cc', 'bb' }, { 3, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 3, 0 }, { 'gxx', 'k', 'gxx' }, { 'aa', 'cc', 'bb' }, { 2, 0 }) + + validate_edit({ 'aa', 'bb', 'cc' }, { 1, 0 }, { 'V', 'gx', 'j', 'V', 'gx' }, { 'bb', 'aa', 'cc' }, { 2, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 2, 0 }, { 'V', 'gx', 'j', 'V', 'gx' }, { 'aa', 'cc', 'bb' }, { 3, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 3, 0 }, { 'V', 'gx', 'k', 'V', 'gx' }, { 'aa', 'cc', 'bb' }, { 2, 0 }) + + -- Blockwise + if child.fn.has('nvim-0.9') == 0 then MiniTest.skip('Blockwise selection has core issues on Neovim<0.9.') end + child.lua([[vim.keymap.set('o', 'ie', function() vim.cmd('normal! \22j') end)]]) + validate_edit({ 'abc', 'def' }, { 1, 0 }, { 'gx', 'ie', 'l', 'gx', 'ie' }, { 'bac', 'edf' }, { 1, 1 }) + validate_edit({ 'abc', 'def' }, { 1, 1 }, { 'gx', 'ie', 'l', 'gx', 'ie' }, { 'acb', 'dfe' }, { 1, 2 }) + validate_edit({ 'abc', 'def' }, { 1, 2 }, { 'gx', 'ie', 'h', 'gx', 'ie' }, { 'acb', 'dfe' }, { 1, 1 }) + + validate_edit({ 'abc', 'def' }, { 1, 0 }, { 'jgx', 'l', 'jgx' }, { 'bac', 'edf' }, { 1, 1 }) + validate_edit({ 'abc', 'def' }, { 1, 1 }, { 'jgx', 'l', 'jgx' }, { 'acb', 'dfe' }, { 1, 2 }) + validate_edit({ 'abc', 'def' }, { 1, 2 }, { 'jgx', 'h', 'jgx' }, { 'acb', 'dfe' }, { 1, 1 }) + end + + child.o.virtualedit = 'all' + validate() + child.o.virtualedit = 'onemore' + validate() child.o.virtualedit = 'block' - validate_edit({ 'ab', 'cd' }, { 1, 0 }, { 'jgx', 'l', 'jgx' }, { 'ba', 'dc' }, { 1, 1 }) + validate() end T['Exchange']['works when regions are made in different modes'] = function() @@ -1270,10 +1347,44 @@ T['Multiply']['works with `[count]` in Visual mode'] = function() validate_edit(lines, { 2, 1 }, { 'kh', '2gm' }, ref_lines, ref_cursor) end -T['Multiply']['works blockwise in Visual mode with `virtualedit=block`'] = function() - if child.fn.has('nvim-0.9') == 0 then MiniTest.skip('Blockwise selection has core issues on Neovim<0.9.') end +T['Multiply']['works with different `virtualedit`'] = function() + local validate = function() + -- Charwise + validate_edit1d('aa bb cc', 0, { 'gm', 'iw' }, 'aaaa bb cc', 2) + validate_edit1d('aa bb cc', 3, { 'gm', 'iw' }, 'aa bbbb cc', 5) + validate_edit1d('aa bb cc', 6, { 'gm', 'iw' }, 'aa bb cccc', 8) + + validate_edit1d('aa bb cc', 0, { 'viw', 'gm' }, 'aaaa bb cc', 2) + validate_edit1d('aa bb cc', 3, { 'viw', 'gm' }, 'aa bbbb cc', 5) + validate_edit1d('aa bb cc', 6, { 'viw', 'gm' }, 'aa bb cccc', 8) + + -- Linewise + validate_edit({ 'aa', 'bb', 'cc' }, { 1, 0 }, { 'gmm' }, { 'aa', 'aa', 'bb', 'cc' }, { 2, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 2, 0 }, { 'gmm' }, { 'aa', 'bb', 'bb', 'cc' }, { 3, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 3, 0 }, { 'gmm' }, { 'aa', 'bb', 'cc', 'cc' }, { 4, 0 }) + + validate_edit({ 'aa', 'bb', 'cc' }, { 1, 0 }, { 'V', 'gm' }, { 'aa', 'aa', 'bb', 'cc' }, { 2, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 2, 0 }, { 'V', 'gm' }, { 'aa', 'bb', 'bb', 'cc' }, { 3, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 3, 0 }, { 'V', 'gm' }, { 'aa', 'bb', 'cc', 'cc' }, { 4, 0 }) + + -- Blockwise + if child.fn.has('nvim-0.9') == 0 then MiniTest.skip('Blockwise selection has core issues on Neovim<0.9.') end + child.lua([[vim.keymap.set('o', 'ie', function() vim.cmd('normal! \22j') end)]]) + validate_edit({ 'abc', 'def' }, { 1, 0 }, { 'gm', 'ie' }, { 'aabc', 'ddef' }, { 1, 1 }) + validate_edit({ 'abc', 'def' }, { 1, 1 }, { 'gm', 'ie' }, { 'abbc', 'deef' }, { 1, 2 }) + validate_edit({ 'abc', 'def' }, { 1, 2 }, { 'gm', 'ie' }, { 'abcc', 'deff' }, { 1, 3 }) + + validate_edit({ 'abc', 'def' }, { 1, 0 }, { 'j', 'gm' }, { 'aabc', 'ddef' }, { 1, 1 }) + validate_edit({ 'abc', 'def' }, { 1, 1 }, { 'j', 'gm' }, { 'abbc', 'deef' }, { 1, 2 }) + validate_edit({ 'abc', 'def' }, { 1, 2 }, { 'j', 'gm' }, { 'abcc', 'deff' }, { 1, 3 }) + end + + child.o.virtualedit = 'all' + validate() + child.o.virtualedit = 'onemore' + validate() child.o.virtualedit = 'block' - validate_edit({ 'xab rs', 'xcd uv' }, { 1, 1 }, { 'jl', 'gm' }, { 'xabab rs', 'xcdcd uv' }, { 1, 3 }) + validate() end T['Multiply']['works with multibyte characters'] = function() @@ -1629,9 +1740,43 @@ T['Replace']['works in Visual mode'] = function() validate_edit({ 'a b', 'a b' }, { 1, 0 }, { 'yj', 'w', 'j', 'gr' }, { 'a a', 'a a' }, { 1, 2 }) end -T['Replace']['works blockwise in Visual mode with `virtualedit=block`'] = function() +T['Replace']['works with different `virtualedit`'] = function() + local validate = function() + -- Charwise + validate_edit1d('aa bb cc', 3, { 'yiw', 'b', 'gr', 'iw' }, 'bb bb cc', 0) + validate_edit1d('aa bb cc', 0, { 'yiw', 'w', 'gr', 'iw' }, 'aa aa cc', 3) + validate_edit1d('aa bb cc', 0, { 'yiw', '2w', 'gr', 'iw' }, 'aa bb aa', 6) + + validate_edit1d('aa bb cc', 3, { 'yiw', 'b', 'viw', 'gr' }, 'bb bb cc', 0) + validate_edit1d('aa bb cc', 0, { 'yiw', 'w', 'viw', 'gr' }, 'aa aa cc', 3) + validate_edit1d('aa bb cc', 0, { 'yiw', '2w', 'viw', 'gr' }, 'aa bb aa', 6) + + -- Linewise + validate_edit({ 'aa', 'bb', 'cc' }, { 1, 0 }, { 'yy', 'j', 'grr' }, { 'aa', 'aa', 'cc' }, { 2, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 2, 0 }, { 'yy', 'j', 'grr' }, { 'aa', 'bb', 'bb' }, { 3, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 3, 0 }, { 'yy', 'k', 'grr' }, { 'aa', 'cc', 'cc' }, { 2, 0 }) + + validate_edit({ 'aa', 'bb', 'cc' }, { 1, 0 }, { 'yy', 'j', 'V', 'gr' }, { 'aa', 'aa', 'cc' }, { 2, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 2, 0 }, { 'yy', 'j', 'V', 'gr' }, { 'aa', 'bb', 'bb' }, { 3, 0 }) + validate_edit({ 'aa', 'bb', 'cc' }, { 3, 0 }, { 'yy', 'k', 'V', 'gr' }, { 'aa', 'cc', 'cc' }, { 2, 0 }) + + -- Blockwise + child.lua([[vim.keymap.set('o', 'ie', function() vim.cmd('normal! \22j') end)]]) + validate_edit({ 'abc', 'def' }, { 1, 0 }, { 'y', 'ie', 'l', 'gr', 'ie' }, { 'aac', 'ddf' }, { 1, 1 }) + validate_edit({ 'abc', 'def' }, { 1, 1 }, { 'y', 'ie', 'l', 'gr', 'ie' }, { 'abb', 'dee' }, { 1, 2 }) + validate_edit({ 'abc', 'def' }, { 1, 2 }, { 'y', 'ie', 'h', 'gr', 'ie' }, { 'acc', 'dff' }, { 1, 1 }) + + validate_edit({ 'abc', 'def' }, { 1, 0 }, { 'y', 'ie', 'l', 'j', 'gr' }, { 'aac', 'ddf' }, { 1, 1 }) + validate_edit({ 'abc', 'def' }, { 1, 1 }, { 'y', 'ie', 'l', 'j', 'gr' }, { 'abb', 'dee' }, { 1, 2 }) + validate_edit({ 'abc', 'def' }, { 1, 2 }, { 'y', 'ie', 'h', 'j', 'gr' }, { 'acc', 'dff' }, { 1, 1 }) + end + + child.o.virtualedit = 'all' + validate() + child.o.virtualedit = 'onemore' + validate() child.o.virtualedit = 'block' - validate_edit({ 'xab', 'xcd' }, { 1, 0 }, { 'yj', 'l', 'j', 'gr' }, { 'xxb', 'xxd' }, { 1, 1 }) + validate() end T['Replace']['correctly reindents linewise in Visual mode'] = function() @@ -1924,9 +2069,44 @@ T['Sort']['works in Visual mode'] = function() validate_edit({ 'cxb', 'bxa', 'axc' }, { 1, 1 }, { 'jl', 'gs' }, { 'cxa', 'bxb', 'axc' }, { 1, 1 }) end -T['Sort']['works blockwise in Visual mode with `virtualedit=block`'] = function() +T['Sort']['works with different `virtualedit`'] = function() + local validate = function() + -- Charwise + validate_edit1d('cc bb aa', 0, { 'gs', '2e' }, 'bb cc aa', 0) + validate_edit1d('cc bb aa', 3, { 'gs', '2e' }, 'cc aa bb', 3) + validate_edit1d('cc bb aa', 0, { 'gs', '3e' }, 'aa bb cc', 0) + + validate_edit1d('cc bb aa', 0, { 'v2e', 'gs' }, 'bb cc aa', 0) + validate_edit1d('cc bb aa', 3, { 'v2e', 'gs' }, 'cc aa bb', 3) + validate_edit1d('cc bb aa', 0, { 'v3e', 'gs' }, 'aa bb cc', 0) + + -- Linewise + validate_edit({ 'cc', 'bb', 'aa' }, { 1, 0 }, { 'gs', 'j' }, { 'bb', 'cc', 'aa' }, { 1, 0 }) + validate_edit({ 'cc', 'bb', 'aa' }, { 2, 0 }, { 'gs', 'j' }, { 'cc', 'aa', 'bb' }, { 2, 0 }) + validate_edit({ 'cc', 'bb', 'aa' }, { 1, 0 }, { 'gs', '2j' }, { 'aa', 'bb', 'cc' }, { 1, 0 }) + + validate_edit({ 'cc', 'bb', 'aa' }, { 1, 0 }, { 'Vj', 'gs' }, { 'bb', 'cc', 'aa' }, { 1, 0 }) + validate_edit({ 'cc', 'bb', 'aa' }, { 2, 0 }, { 'Vj', 'gs' }, { 'cc', 'aa', 'bb' }, { 2, 0 }) + validate_edit({ 'cc', 'bb', 'aa' }, { 1, 0 }, { 'V2j', 'gs' }, { 'aa', 'bb', 'cc' }, { 1, 0 }) + + -- Blockwise + if child.fn.has('nvim-0.9') == 0 then MiniTest.skip('Blockwise selection has core issues on Neovim<0.9.') end + child.lua([[vim.keymap.set('o', 'iE', function() vim.cmd('normal! \22jj') end)]]) + validate_edit({ 'cba', 'bac', 'acb' }, { 1, 0 }, { 'gs', 'iE' }, { 'aba', 'bac', 'ccb' }, { 1, 0 }) + validate_edit({ 'cba', 'bac', 'acb' }, { 1, 1 }, { 'gs', 'iE' }, { 'caa', 'bbc', 'acb' }, { 1, 1 }) + validate_edit({ 'cba', 'bac', 'acb' }, { 1, 2 }, { 'gs', 'iE' }, { 'cba', 'bab', 'acc' }, { 1, 2 }) + + validate_edit({ 'cba', 'bac', 'acb' }, { 1, 0 }, { 'jj', 'gs' }, { 'aba', 'bac', 'ccb' }, { 1, 0 }) + validate_edit({ 'cba', 'bac', 'acb' }, { 1, 1 }, { 'jj', 'gs' }, { 'caa', 'bbc', 'acb' }, { 1, 1 }) + validate_edit({ 'cba', 'bac', 'acb' }, { 1, 2 }, { 'jj', 'gs' }, { 'cba', 'bab', 'acc' }, { 1, 2 }) + end + + child.o.virtualedit = 'all' + validate() + child.o.virtualedit = 'onemore' + validate() child.o.virtualedit = 'block' - validate_edit({ 'cbx', 'bax', 'acx' }, { 1, 1 }, { '2j', 'gs' }, { 'cax', 'bbx', 'acx' }, { 1, 1 }) + validate() end T['Sort']['respects `config.sort.func`'] = function() diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_pairs.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_pairs.lua index a02b6268..67d3f40b 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_pairs.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_pairs.lua @@ -14,8 +14,7 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end -- Make helpers @@ -24,6 +23,9 @@ local get_term_channel = function() return term_chans[1]['id'] end +-- Time constants +local term_mode_wait = helpers.get_time_const(50) + --- Make simple test on empty entity ---@private local validate_action = function(mode, test) @@ -53,10 +55,13 @@ local validate_action = function(mode, test) -- Cleanup type_keys('') elseif mode == 't' then + helpers.skip_on_windows('Terminal emulator testing is not robust/easy on Windows') + helpers.skip_on_macos('Terminal emulator testing is not robust/easy on MacOS') + -- Setup child.cmd('terminal! bash --noprofile --norc') -- Wait for terminal to get active - sleep(50) + sleep(term_mode_wait) child.cmd('startinsert') -- Test @@ -114,15 +119,14 @@ local validate_close = function(mode, key, pair) eq(child.fn.getcmdpos(), 3) end, t = function() - -- Need to wait after each keystroke to allow shell to process it - local wait = 50 local term_channel = get_term_channel() -- Jumps over right hand side of `pair` if it is next child.fn.chansend(term_channel, pair) - sleep(wait) - type_keys(wait, '') - type_keys(wait, key) + -- Need to wait after each keystroke to allow shell to process it + sleep(term_mode_wait) + type_keys(term_mode_wait, '') + type_keys(term_mode_wait, key) local pair_pattern = vim.pesc(pair) .. '$' expect.match(get_lines()[1], pair_pattern) @@ -149,14 +153,13 @@ local validate_bs = function(mode, pair) eq(child.fn.getcmdpos(), 1) end, t = function() - -- Need to wait after each keystroke to allow shell to process it - local wait = 50 local term_channel = get_term_channel() child.fn.chansend(term_channel, pair) - sleep(wait) - type_keys(wait, '') - type_keys(wait, '') + -- Need to wait after each keystroke to allow shell to process it + sleep(term_mode_wait) + type_keys(term_mode_wait, '') + type_keys(term_mode_wait, '') local pair_pattern = vim.pesc(pair) .. '$' expect.no_match(get_lines()[1], pair_pattern) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_pick.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_pick.lua index b5fc5592..4630f996 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_pick.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_pick.lua @@ -11,8 +11,7 @@ local unload_module = function() child.mini_unload('pick') end local set_cursor = function(...) return child.set_cursor(...) end local get_cursor = function(...) return child.get_cursor(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end -- Tweak `expect_screenshot()` to test only on Neovim>=0.10 (as it has floating @@ -34,10 +33,7 @@ local real_files_dir = 'tests/dir-pick/real-files' local join_path = function(...) return table.concat({ ... }, '/') end -local full_path = function(x) - local res = vim.fn.fnamemodify(x, ':p'):gsub('/$', '') - return res -end +local full_path = function(x) return (vim.fn.fnamemodify(x, ':p'):gsub('[\\/]$', '')) end local real_file = function(basename) return join_path(real_files_dir, basename) end @@ -90,7 +86,7 @@ end local validate_buf_name = function(buf_id, name) buf_id = buf_id or child.api.nvim_get_current_buf() name = name ~= '' and full_path(name) or '' - name = name:gsub('/+$', '') + name = name:gsub('[\\/]+$', '') eq(child.api.nvim_buf_get_name(buf_id), name) end @@ -205,6 +201,12 @@ for i = 1, 1000000 do many_items[3 * i] = 'bb' end +-- Time constants +local default_busy_delay = 50 +local track_lost_focus_delay = 1000 +local small_time = helpers.get_time_const(10) +local micro_time = 1 + -- Output test set ============================================================ local T = new_set({ hooks = { @@ -212,9 +214,9 @@ local T = new_set({ child.setup() -- Make more comfortable screenshots - child.set_size(15, 40) child.o.laststatus = 0 child.o.ruler = false + child.set_size(15, 40) load_module() @@ -247,6 +249,7 @@ T['setup()']['creates side effects'] = function() validate_hl_group('MiniPickBorder', 'links to FloatBorder') validate_hl_group('MiniPickBorderBusy', 'links to DiagnosticFloatingWarn') validate_hl_group('MiniPickBorderText', 'links to FloatTitle') + validate_hl_group('MiniPickCursor', 'nocombine.*blend=100') validate_hl_group('MiniPickIconDirectory', 'links to Directory') validate_hl_group('MiniPickIconFile', 'links to MiniPickNormal') validate_hl_group('MiniPickHeader', 'links to DiagnosticFloatingHint') @@ -378,6 +381,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ window = { prompt_prefix = 1 } }, 'window.prompt_prefix', 'string') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniPickBorder'), 'links to FloatBorder') +end + -- This set mostly contains general function testing which doesn't fit into -- more specialized integration tests later T['start()'] = new_set() @@ -472,7 +480,7 @@ T['start()']['tracks lost focus'] = function() child.expect_screenshot() type_keys('e') -- By default it checks inside a timer with 1 second period - sleep(1000 + 50) + sleep(track_lost_focus_delay + small_time) child.expect_screenshot() end @@ -529,7 +537,7 @@ T['start()']['respects `source.items`'] = function() -- Callable setting items manually child.lua([[_G.items_callable_later = function() MiniPick.set_picker_items({ 'e', 'f' }) end]]) child.lua_notify('MiniPick.start({ source = { items = _G.items_callable_later } })') - poke_eventloop() + child.poke_eventloop() child.expect_screenshot() stop() @@ -538,7 +546,7 @@ T['start()']['respects `source.items`'] = function() vim.schedule(function() MiniPick.set_picker_items({ 'g', 'h' }) end) end]]) child.lua_notify('MiniPick.start({ source = { items = _G.items_callable_later } })') - poke_eventloop() + child.poke_eventloop() child.expect_screenshot() stop() end @@ -680,7 +688,10 @@ T['start()']['respects `source.choose_marked`'] = function() end T['start()']['respects `delay.async`'] = function() + helpers.skip_if_slow() + child.set_size(15, 15) + child.lua('_G.small_time = ' .. small_time) child.lua_notify([[ _G.buf_id, _G.n = vim.api.nvim_get_current_buf(), 0 local timer = vim.loop.new_timer() @@ -688,7 +699,7 @@ T['start()']['respects `delay.async`'] = function() _G.n = _G.n + 1 vim.fn.appendbufline(_G.buf_id, '$', { 'Line ' .. _G.n }) end) - timer:start(50, 50, f) + timer:start(5 * _G.small_time, 5 * _G.small_time, f) ]]) local validate = function(n, lines) eq(child.lua_get('_G.n'), n) @@ -696,19 +707,19 @@ T['start()']['respects `delay.async`'] = function() child.expect_screenshot({ redraw = false }) end - child.lua_notify([[MiniPick.start({ source = { items = { 'a' } }, delay = { async = 80 } })]]) + child.lua_notify([[MiniPick.start({ source = { items = { 'a' } }, delay = { async = 8 * _G.small_time } })]]) validate(0, { '' }) -- Callback should have already been executed, but not redraw - sleep(50 + 5) + sleep(5 * small_time + small_time) validate(1, { '', 'Line 1' }) -- No new callback should have been executed, but redraw should - sleep(30) + sleep(3 * small_time) validate(1, { '', 'Line 1' }) -- Test that redraw is done repeatedly - sleep(80) + sleep(8 * small_time) validate(3, { '', 'Line 1', 'Line 2', 'Line 3' }) end @@ -719,11 +730,10 @@ T['start()']['respects `delay.busy`'] = function() expect.match(child.api.nvim_win_get_option(win_id, 'winhighlight'), ref_winhl) end - local new_busy_delay = math.floor(0.5 * child.lua_get('MiniPick.config.delay.busy')) - child.lua_notify(string.format('MiniPick.start({ delay = { busy = %d } })', new_busy_delay)) + child.lua_notify(string.format('MiniPick.start({ delay = { busy = %d } })', 0.5 * default_busy_delay)) validate(false) - sleep(new_busy_delay + 10) + sleep(0.5 * default_busy_delay + small_time) validate(true) end @@ -842,7 +852,7 @@ T['start()']['stops currently active picker'] = function() start_with_items({ 'a', 'b', 'c' }) eq(is_picker_active(), true) start_with_items({ 'd', 'e', 'f' }) - sleep(2) + sleep(small_time) child.expect_screenshot() end @@ -989,6 +999,8 @@ T['default_match()']['works with active picker'] = function() end T['default_match()']['does not block query update'] = function() + helpers.skip_if_slow() + child.lua([[ _G.log = {} _G.default_match_wrapper = function(stritems, inds, query) @@ -1000,8 +1012,8 @@ T['default_match()']['does not block query update'] = function() -- Set many items and wait until it completely sets set_picker_items(many_items) - for i = 1, 50 do - sleep(100) + for _ = 1, 500 do + sleep(small_time) if child.lua_get([[type(MiniPick.get_picker_items()) == 'table']]) then break end end @@ -1012,12 +1024,13 @@ T['default_match()']['does not block query update'] = function() -- set of `match_inds` (which should be all inds as match is, hopefully, -- never finishes). type_keys('a') - sleep(1) + sleep(micro_time) type_keys('b') - sleep(1) + sleep(micro_time) type_keys('c') - sleep(1) - child.expect_screenshot() + sleep(micro_time) + eq(child.lua_get('#MiniPick.get_picker_matches()'), 0) + eq(get_picker_state().is_busy, true) eq(child.lua_get('_G.log'), { { n_match_inds = #many_items, query = {} }, { n_match_inds = #many_items, query = { 'a' } }, @@ -1274,13 +1287,27 @@ T['default_match()']['respects case'] = function() validate_match({ 'ab', 'aB', 'Ba', 'AB' }, { 'a', 'B' }, { 2 }) end -T['default_match()']['respects `do_sync` argument'] = function() +T['default_match()']['respects `opts.sync`'] = function() start_with_items({ 'aa', 'ab', 'bb' }) -- Should process synchronously and return output even if picker is active - eq(child.lua_get([[MiniPick.default_match({'xx', 'xy', 'yy'}, { 1, 2, 3 }, { 'y' }, true)]]), { 3, 2 }) + eq(child.lua_get([[MiniPick.default_match({'xx', 'xy', 'yy'}, { 1, 2, 3 }, { 'y' }, { sync = true })]]), { 3, 2 }) eq(get_picker_matches().all, { 'aa', 'ab', 'bb' }) end +T['default_match()']['respects `opts.preserve_order`'] = function() + child.lua_notify([[ + local opts = { preserve_order = true } + local match_nosort = function(stritems, inds, query) + MiniPick.default_match(stritems, inds, query, opts) + end + MiniPick.start({ source = { items = { 'axay', 'b', 'aaxy', 'ccc', 'xaa' }, match = match_nosort } }) + ]]) + type_keys('x') + eq(get_picker_matches().all_inds, { 1, 3, 5 }) + type_keys('y') + eq(get_picker_matches().all_inds, { 1, 3 }) +end + T['default_show()'] = new_set({ hooks = { pre_case = function() child.set_size(10, 20) end } }) local default_show = forward_lua('MiniPick.default_show') @@ -1496,11 +1523,18 @@ T['default_preview()']['works for file path'] = function() real_file('c.gif'), } validate_preview(items) + stop() + + -- Should work for failed to read files + child.lua('vim.loop.fs_open = function() return nil end') + validate_preview({ real_file('Makefile') }) end T['default_preview()']['works for relative file path'] = function() - local lua_cmd = - string.format([[MiniPick.start({ source = { items = { 'a.lua' }, cwd = '%s' } })]], full_path(real_files_dir)) + local lua_cmd = string.format( + [[MiniPick.start({ source = { items = { 'a.lua' }, cwd = %s } })]], + vim.inspect(full_path(real_files_dir)) + ) child.lua_notify(lua_cmd) type_keys('') child.expect_screenshot() @@ -1516,7 +1550,7 @@ T['default_preview()']['works for file path with tilde'] = function() end T['default_preview()']['works for URI path'] = function() - local items = { { text = real_file('LICENSE'), path = 'file:' .. full_path(real_file('LICENSE')) } } + local items = { { text = real_file('LICENSE'), path = 'file:/' .. full_path(real_file('LICENSE')) } } validate_preview(items) end @@ -1723,7 +1757,8 @@ T['default_preview()']['respects `opts.line_position`'] = new_set({ }) T['default_preview()']['respects `source.cwd`'] = function() - local lua_cmd = string.format([[MiniPick.start({ source = { items = { 'b.txt' }, cwd = '%s' } })]], real_files_dir) + local lua_cmd = + string.format([[MiniPick.start({ source = { items = { 'b.txt' }, cwd = %s } })]], vim.inspect(real_files_dir)) child.lua_notify(lua_cmd) type_keys('') child.expect_screenshot() @@ -1806,18 +1841,18 @@ end T['default_choose()']['works for relative file path'] = function() local lua_cmd = - string.format([[MiniPick.start({ source = { items = { 'a.lua' }, cwd = '%s' } })]], full_path(real_files_dir)) + string.format([[MiniPick.start({ source = { items = { 'a.lua' }, cwd = %s } })]], vim.inspect(real_files_dir)) child.lua_notify(lua_cmd) type_keys('') validate_buf_name(0, real_file('a.lua')) -- Should open with relative path to have better view in `:buffers` - expect.match(child.cmd_capture('buffers'), '"' .. vim.pesc(real_files_dir)) + expect.match(child.cmd_capture('buffers'), '"tests[\\/]dir%-pick') end T['default_choose()']['works for URI path'] = function() local path = full_path(real_file('LICENSE')) - local item = { path = 'file:' .. path } + local item = { path = 'file:/' .. path } local win_id = child.api.nvim_get_current_win() default_choose(item) @@ -2026,7 +2061,7 @@ end T['default_choose()']['has print fallback'] = function() choose_item({ text = 'regular-table' }) - eq(child.cmd_capture('messages'), '\n{\n text = "regular-table"\n}') + eq(child.cmd_capture('messages'), '{\n text = "regular-table"\n}') end T['default_choose()']['does nothing for `nil` input'] = function() @@ -2144,7 +2179,7 @@ T['default_choose_marked()']['creates quickfix list from file/buffer positions'] { text = 'buffer', bufnr = buf_id, lnum = 7, col = 8, end_lnum = 8 }, -- URI - { path = 'file:' .. full_path(path) }, + { path = 'file:/' .. full_path(path) }, } start_with_items(items) @@ -2425,7 +2460,7 @@ T['builtin.files()']['has fallback tool'] = function() validate_picker_option('source.cwd', full_path(cwd)) -- Sleep because fallback is async - sleep(5) + sleep(small_time) eq(get_picker_items(), { 'file', 'dir1/file1-1', 'dir1/file1-2', 'dir2/file2-1' }) end @@ -2552,7 +2587,7 @@ T['builtin.grep()']['has fallback tool'] = new_set({ parametrize = { { 'default' validate_picker_option('source.cwd', full_path(cwd)) -- Sleep because fallback is async - sleep(5) + sleep(small_time) local ref_items = { 'file\0003\0001\000aaa', 'dir1/file1-1\0003\0001\000aaa', @@ -2804,7 +2839,7 @@ T['builtin.help()']['has proper preview'] = function() -- Shouldn't have side effects for search pattern and `v:hlsearch` child.api.nvim_buf_set_lines(0, 0, -1, false, { 'aa', 'bb', 'aa' }) - type_keys('/', 'aa', '') + type_keys('/', 'aa', '', ':') child.cmd('let v:hlsearch=0') builtin_help() @@ -2883,7 +2918,7 @@ T['builtin.help()']['works with `builtin.resume()`'] = function() builtin_help() set_picker_query({ ':help' }) type_keys('') - sleep(2) + sleep(small_time) child.expect_screenshot() child.cmd('close') @@ -2891,7 +2926,7 @@ T['builtin.help()']['works with `builtin.resume()`'] = function() child.lua_notify('MiniPick.builtin.resume()') type_keys('') - sleep(2) + sleep(small_time) child.expect_screenshot() end @@ -2961,7 +2996,7 @@ T['builtin.cli()']['works'] = function() child.lua_notify([[_G.cli_item = MiniPick.builtin.cli({ command = { 'echo', 'xx\nyy' } })]]) -- - Sleep as items are set inside `schedule_wrap`ed function - sleep(1) + sleep(small_time) eq(get_picker_items(), { 'aa', 'bb' }) -- Should set correct name @@ -2976,7 +3011,7 @@ T['builtin.cli()']['respects `local_opts.postprocess`'] = function() mock_cli_return({ 'aa', 'bb' }) child.lua([[_G.postprocess = function(...) _G.args = { ... }; return { 'x', 'y', 'z' } end]]) child.lua_notify([[MiniPick.builtin.cli({ command = { 'echo', 'xx\nyy' }, postprocess = postprocess })]]) - sleep(1) + sleep(small_time) eq(child.lua_get('_G.args'), { { 'aa', 'bb' } }) eq(get_picker_items(), { 'x', 'y', 'z' }) end @@ -3026,6 +3061,10 @@ T['builtin.resume()']['works'] = function() eq(get_picker_matches().all, { 'b', 'bb' }) type_keys('') + -- Default choose prints item + eq(child.cmd_capture('messages'), '"b"') + type_keys(':') + make_event_log() child.cmd('au User MiniPickStart lua _G.track_event()') @@ -3158,22 +3197,16 @@ T['builtin.resume()']['can be called consecutively'] = function() type_keys('') end -T['builtin.resume()']["restores 'cmdheight'"] = function() +T['builtin.resume()']["restores 'guicursor'"] = function() start_with_items({ 'a' }, 'My name') type_keys('') - local validate = function(cmdheight) - child.o.cmdheight = cmdheight - builtin_resume() - -- Should *temporarily* force 'cmdheight=1' to both have place where to hide - -- cursor (in case of `cmdheight=0`) and increase available space for picker - eq(child.o.cmdheight, 1) - type_keys('') - eq(child.o.cmdheight, cmdheight) - end - - validate(3) - validate(0) + child.o.guicursor = 'n-v-c:block' + builtin_resume() + -- Should *temporarily* force custom 'guicursor' to hide cursor + eq(child.o.guicursor, 'a:MiniPickCursor') + type_keys('') + eq(child.o.guicursor, 'n-v-c:block') end T['builtin.resume()']['validates if no picker was previously called'] = function() @@ -3491,7 +3524,7 @@ T['get_picker_state()']['properly detects when picker is busy'] = function() -- Between starting match and displaying its results type_keys('a') eq(get_picker_state().is_busy, true) - sleep(10 + 10) + sleep(small_time) eq(get_picker_state().is_busy, false) end @@ -3610,7 +3643,7 @@ end T['set_picker_items()']['respects `opts.querytick`'] = function() -- Should check every `delay.async` milliseconds if global querytick is the -- same as supplied. If not - abort without setting items. - child.lua('MiniPick.config.delay.async = 1') + child.lua('MiniPick.config.delay.async = ' .. micro_time) start_with_items() set_picker_items(many_items, { querytick = -1 }) @@ -3618,6 +3651,8 @@ T['set_picker_items()']['respects `opts.querytick`'] = function() end T['set_picker_items()']['does not block picker'] = function() + helpers.skip_if_slow() + child.lua([[ _G.log = {} _G.log_func = function() @@ -3632,7 +3667,7 @@ T['set_picker_items()']['does not block picker'] = function() -- processed right away even though there is an items preprocessing is going. set_picker_items(many_items) type_keys('l') - sleep(1) + sleep(small_time) stop() eq(child.lua_get('_G.log'), { { is_busy = true, items_type = 'nil' } }) end @@ -3648,7 +3683,7 @@ local set_picker_items_from_cli = function(...) -- Work around tuples and callables being not transferrable through RPC local tuple = child.lua( [[local process, pid = MiniPick.set_picker_items_from_cli(...) - local process_keys = vim.tbl_keys(process) + local process_keys = vim.tbl_filter(function(x) return x:sub(1, 1) ~= '_' end, vim.tbl_keys(process)) table.sort(process_keys) return { process_keys, pid }]], { ... } @@ -3673,7 +3708,7 @@ T['set_picker_items_from_cli()']['works'] = function() eq(get_process_log(), { 'Stdout Stdout_1 was closed.', 'Process Pid_1 was closed.' }) -- Should return proper data - eq(process_keys, { 'close', 'pid' }) + eq(process_keys, { 'close', 'is_active', 'pid' }) eq(pid, 'Pid_1') end @@ -3705,6 +3740,40 @@ T['set_picker_items_from_cli()']['correctly detects error in stdout feed'] = fun expect.error(function() set_picker_items_from_cli(test_command) end, 'Test stdout error') end +T['set_picker_items_from_cli()']['stops process if picker is stopped'] = function() + local delay = 3 * small_time + child.lua('_G.delay = ' .. delay) + child.lua([[ + local is_active_indicator = true + vim.loop.spawn = function(path, options, on_exit) + vim.defer_fn(on_exit, _G.delay) + + local process = { + pid = 'Pid_1', + is_active = function() return is_active_indicator end, + close = function(_) table.insert(_G.process_log, 'Process Pid_1 was closed.') end, + } + return process, pid + end + vim.loop.process_kill = function(process) + -- Killing process also means it stops being active + is_active_indicator = false + table.insert(_G.process_log, 'Process Pid_1 was killed.') + end + ]]) + + start_with_items() + set_picker_items_from_cli({ 'sleep', '10' }) + sleep(small_time) + type_keys('') + sleep(delay) + -- Should kill the process without later calling `process:close()` + eq(get_process_log(), { 'Stdout Stdout_1 was closed.', 'Process Pid_1 was killed.' }) + + -- Should clean possible helper autocommands + eq(child.cmd_capture('au User'), '--- Autocommands ---') +end + T['set_picker_items_from_cli()']['has default postprocess'] = function() -- Should remove all trailing empty lines start_with_items() @@ -4222,19 +4291,30 @@ T['Overall view']["respects tabline, statusline, 'cmdheight'"] = function() validate() end -T['Overall view']["respects 'cmdheight'"] = function() - local validate = function(cmdheight) - child.o.cmdheight = cmdheight +T['Overall view']["respects 'guicursor'"] = function() + local validate = function(keys, init_guicursor) + init_guicursor = init_guicursor or 'n-v-c:block' + child.o.guicursor = init_guicursor + type_keys(keys) start_with_items({ 'a' }, 'My name') - -- Should *temporarily* force 'cmdheight=1' to both have place where to hide - -- cursor (in case of `cmdheight=0`) and increase available space for picker - eq(child.o.cmdheight, 1) + -- Should *temporarily* force custom 'guicursor' to hide cursor + eq(child.o.guicursor, 'a:MiniPickCursor') type_keys('') - eq(child.o.cmdheight, cmdheight) + eq(child.o.guicursor, init_guicursor) + child.ensure_normal_mode() end - validate(3) - validate(0) + -- Should work in all modes + validate('') + validate('i') + validate('v') + validate(':') + + -- Should work with empty guicursor. Should also work around empty string + -- 'guicursor' by first setting to some other "neutral" value and redrawing. + child.cmd('au OptionSet guicursor lua _G.n = (_G.n or 0) + 1') + validate('', '') + eq(child.lua_get('_G.n'), 4) end T['Overall view']['allows very large dimensions'] = function() @@ -4246,7 +4326,7 @@ end T['Overall view']['uses dedicated highlight groups'] = function() start_with_items(nil, 'My name') local win_id = get_picker_state().windows.main - sleep(child.lua_get('MiniPick.config.delay.busy') + 5) + sleep(default_busy_delay + small_time) -- Busy picker eq(get_picker_state().is_busy, true) @@ -4883,9 +4963,9 @@ T['Key query process']['respects mouse click'] = function() -- Should stop picker if outside of main window local validate_press_outside = function(button, row, col) start_with_items({ 'a' }) - sleep(10) + sleep(small_time) child.api.nvim_input_mouse(button, 'press', '', 0, row, col) - sleep(10) + sleep(small_time) eq(is_picker_active(), false) end @@ -5227,7 +5307,10 @@ T['Paste']['does not error on non-existing register label'] = function() end T['Paste']['respects `delay.async` when waiting for register label'] = function() + helpers.skip_if_slow() + child.set_size(15, 15) + child.lua('_G.small_time = ' .. small_time) child.lua_notify([[ _G.buf_id, _G.n = vim.api.nvim_get_current_buf(), 0 local timer = vim.loop.new_timer() @@ -5235,7 +5318,7 @@ T['Paste']['respects `delay.async` when waiting for register label'] = function( _G.n = _G.n + 1 vim.fn.appendbufline(_G.buf_id, '$', { 'Line ' .. _G.n }) end) - timer:start(50, 50, f) + timer:start(5 * _G.small_time, 5 * _G.small_time, f) ]]) local validate = function(n, lines) eq(child.lua_get('_G.n'), n) @@ -5243,20 +5326,20 @@ T['Paste']['respects `delay.async` when waiting for register label'] = function( child.expect_screenshot({ redraw = false }) end - child.lua_notify([[MiniPick.start({ source = { items = { 'a' } }, delay = { async = 80 } })]]) + child.lua_notify([[MiniPick.start({ source = { items = { 'a' } }, delay = { async = 8 * _G.small_time } })]]) validate(0, { '' }) type_keys('') -- Callback should have already been executed, but not redraw - sleep(50 + 5) + sleep(5 * small_time + small_time) validate(1, { '', 'Line 1' }) -- No new callback should have been executed, but redraw should - sleep(30) + sleep(3 * small_time) validate(1, { '', 'Line 1' }) -- Test that redraw is done repeatedly - sleep(80) + sleep(8 * small_time) validate(3, { '', 'Line 1', 'Line 2', 'Line 3' }) end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_sessions.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_sessions.lua index 0b31de50..b097abf4 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_sessions.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_sessions.lua @@ -10,10 +10,14 @@ local child = helpers.new_child_neovim() local expect, eq = helpers.expect, helpers.expect.equality local new_set = MiniTest.new_set -local path_sep = package.config:sub(1, 1) -local project_root = vim.fn.getcwd() +local fs_normalize = vim.fs.normalize +if vim.fn.has('nvim-0.9') == 0 then + fs_normalize = function(...) return vim.fs.normalize(...):gsub('(.)/+$', '%1') end +end + +local project_root = fs_normalize(vim.fn.getcwd()) local empty_dir_relpath = 'tests/dir-sessions/empty' -local empty_dir_path = vim.fn.fnamemodify(empty_dir_relpath, ':p') +local empty_dir_path = project_root .. '/' .. empty_dir_relpath -- Helpers with child processes --stylua: ignore start @@ -22,10 +26,9 @@ local unload_module = function() child.mini_unload('sessions') end local reload_module = function(config) unload_module(); load_module(config) end local reload_from_strconfig = function(strconfig) unload_module(); child.mini_load_strconfig('sessions', strconfig) end local set_lines = function(...) return child.set_lines(...) end -local make_path = function(...) local res = table.concat({...}, path_sep):gsub(path_sep .. path_sep, path_sep); return res end +local make_path = function(...) return fs_normalize(table.concat({...}, '/')) end local cd = function(...) child.cmd('cd ' .. make_path(...)) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end -- Make helpers @@ -129,6 +132,10 @@ local validate_executed_hook = function(pre_post, action, value) eq(vim.tbl_map(function(x) return type(data[x]) end, keys), { 'number', 'string', 'string', 'string' }) end +-- Time constants +local one_second_delay = 1000 +local small_time = helpers.get_time_const(10) + -- Output test set ============================================================ local T = new_set({ hooks = { @@ -180,7 +187,7 @@ T['setup()']['creates `config` field'] = function() expect_config('autoread', false) expect_config('autowrite', true) - expect_config('directory', ('%s%ssession'):format(child.fn.stdpath('data'), path_sep)) + expect_config('directory', child.fn.stdpath('data') .. '/session') expect_config('file', 'Session.vim') expect_config('force', { read = false, write = true, delete = false }) expect_config('hooks.pre', { read = nil, write = nil, delete = nil }) @@ -262,7 +269,7 @@ T['setup()']['prefers local session file over global'] = function() reload_module({ directory = 'global' }) local detected = child.lua_get('MiniSessions.detected') - local expected_path = vim.fn.fnamemodify('.', ':p') .. 'tests/dir-sessions/Session.vim' + local expected_path = project_root .. '/tests/dir-sessions/Session.vim' eq(detected['Session.vim'].path, expected_path) end @@ -402,7 +409,7 @@ T['read()']['uses by default local session'] = function() end T['read()']['uses by default latest global session'] = function() - local session_dir = populate_sessions(1000) + local session_dir = populate_sessions(one_second_delay + small_time) reload_module({ autowrite = false, directory = session_dir }) child.lua('MiniSessions.read()') @@ -473,11 +480,13 @@ T['read()']['does not stop on source error'] = function() eq(#buffers, 2) child.api.nvim_set_current_buf(buffers[1]) - expect.match(child.api.nvim_buf_get_name(0), vim.pesc(folded_file)) + local buf_name_1 = fs_normalize(child.api.nvim_buf_get_name(0)) + eq(vim.endswith(buf_name_1, '/' .. folded_file), true) eq(child.api.nvim_buf_get_lines(0, 0, -1, true), { 'No folds in this file' }) child.api.nvim_set_current_buf(buffers[2]) - expect.match(child.api.nvim_buf_get_name(0), vim.pesc(extra_file)) + local buf_name_2 = fs_normalize(child.api.nvim_buf_get_name(0)) + eq(vim.endswith(buf_name_2, '/' .. extra_file), true) eq(child.api.nvim_buf_get_lines(0, 0, -1, true), { 'This should be preserved in session' }) end @@ -589,11 +598,11 @@ T['write()']['updates `MiniSessions.detected` with new session'] = function() end T['write()']['updates `MiniSessions.detected` for present session'] = function() - local session_dir = populate_sessions(1000) + local session_dir = populate_sessions(one_second_delay + small_time) reload_module({ directory = session_dir }) child.lua([[MiniSessions.read('session_a')]]) - sleep(1000) + sleep(one_second_delay + small_time) child.lua([[MiniSessions.write('session_a')]]) local detected = child.lua_get('MiniSessions.detected') @@ -940,7 +949,7 @@ T['select()']['makes detected sessions up to date'] = function() -- Remove 'session_a' manually which should be shown in `select()` output local directory = child.lua_get('MiniSessions.config.directory') - child.fn.delete(make_path(directory, 'session_a')) + child.fn.delete(make_path(directory, 'session_a'), 'rf') child.lua('MiniSessions.select()') eq(child.lua_get('_G.ui_select_args[1]'), { 'Session.vim', 'session_b' }) @@ -984,7 +993,7 @@ end T['get_latest()'] = new_set() T['get_latest()']['works'] = function() - local dir = populate_sessions(1000) + local dir = populate_sessions(one_second_delay + small_time) reload_module({ directory = dir }) eq(child.lua_get('MiniSessions.get_latest()'), 'session_b') end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_starter.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_starter.lua index 0f8df7b2..bd3a3d44 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_starter.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_starter.lua @@ -19,7 +19,7 @@ local type_keys = function(...) return child.type_keys(...) end --stylua: ignore end -- Make helpers -local is_starter_shown = function() return child.api.nvim_buf_get_option(0, 'filetype') == 'ministarter' end +local is_starter_shown = function() return child.bo.filetype == 'ministarter' end local validate_starter_shown = function() eq(is_starter_shown(), true) end @@ -151,6 +151,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ silent = 1 }, 'silent', 'boolean') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniStarterCurrent'), 'links to MiniStarterItem') +end + -- Work with Starter buffer --------------------------------------------------- T['open()'] = new_set() @@ -160,7 +165,7 @@ T['open()']['works'] = function() child.lua('MiniStarter.open()') expect.no_equality(child.api.nvim_get_current_buf(), init_buf_id) - eq(child.api.nvim_buf_get_name(0), child.fn.getcwd() .. '/Starter') + eq(child.api.nvim_buf_get_name(0), child.fn.getcwd() .. package.config:sub(1, 1) .. 'Starter') validate_starter_shown() expect.match(table.concat(get_lines(), '\n'), 'Builtin actions') @@ -910,16 +915,17 @@ T['sections']['recent_files()'] = new_set() T['sections']['recent_files()']['correctly identifies files from current directory'] = function() local dir, dir_similar = 'tests/dir-starter/aaa', 'tests/dir-starter/aaabbb' + local file = dir_similar .. '/file' child.fn.mkdir(dir) child.fn.mkdir(dir_similar) MiniTest.finally(function() - vim.fn.delete(dir, 'rf') - vim.fn.delete(dir_similar, 'rf') + vim.loop.fs_rmdir(dir) + vim.loop.fs_unlink(file) + vim.loop.fs_rmdir(dir_similar) end) -- Make recent file with absolute path having current directory as substring -- but not inside current directory - local file = dir_similar .. '/file' child.fn.writefile({ '' }, file) child.v.oldfiles = { child.fn.fnamemodify(file, ':p') } child.cmd('cd ' .. dir) @@ -933,22 +939,28 @@ end T['sections']['recent_files()']['respects files in subdirectories'] = function() local dir = 'tests/dir-starter/aaa' - local dir_nested = 'tests/dir-starter/aaa/bbb' - child.fn.mkdir(dir) - child.fn.mkdir(dir_nested) + local dir_nested = dir .. '/bbb' + local file, file_nested = dir .. '/file1', dir_nested .. '/file2' + + child.fn.mkdir(dir_nested, 'p') + child.fn.writefile({ '' }, file) + child.fn.writefile({ '' }, file_nested) MiniTest.finally(function() - vim.fn.delete(dir, 'rf') - vim.fn.delete(dir_nested, 'rf') + vim.loop.fs_unlink(file_nested) + vim.loop.fs_rmdir(dir_nested) + vim.loop.fs_unlink(file) + vim.loop.fs_rmdir(dir) end) - local file1 = dir .. '/file1' - child.fn.writefile({ '' }, file1) - local file2 = dir_nested .. '/file2' - child.fn.writefile({ '' }, file2) - - child.v.oldfiles = { child.fn.fnamemodify(file1, ':p'), child.fn.fnamemodify(file2, ':p') } + child.v.oldfiles = { child.fn.fnamemodify(file, ':p'), child.fn.fnamemodify(file_nested, ':p') } child.cmd('cd ' .. dir) + -- Mock forward slash for more robust screenshot testing + child.lua([[ + local fnamemodify_orig = vim.fn.fnamemodify + vim.fn.fnamemodify = function(...) return fnamemodify_orig(...):gsub('\\', '/') end + ]]) + -- Set up to show files only in current directory child.lua('MiniStarter.config.items = { MiniStarter.sections.recent_files(5, true, true) }') child.lua('MiniStarter.open()') @@ -959,7 +971,7 @@ end T['sections']['recent_files()']['respects `show_path`'] = function() local test_file = 'tests/dir-starter/aaa.txt' child.fn.writefile({ '' }, test_file) - MiniTest.finally(function() vim.fn.delete(test_file, 'rf') end) + MiniTest.finally(function() vim.loop.fs_unlink(test_file) end) child.v.oldfiles = { child.fn.fnamemodify(test_file, ':p') } diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_statusline.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_statusline.lua index 8aa49c34..e210b96e 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_statusline.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_statusline.lua @@ -59,6 +59,9 @@ end local unmock_file = function() pcall(vim.fn.delete, mocked_filepath) end +-- Time constants +local term_mode_wait = helpers.get_time_const(50) + -- Output test set ============================================================ local T = new_set({ hooks = { @@ -135,6 +138,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ use_icons = 'a' }, 'use_icons', 'boolean') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniStatuslineModeNormal'), 'links to Cursor') +end + T['setup()']['sets proper autocommands'] = function() local validate = function(win_id, field) eq(child.api.nvim_win_get_option(win_id, 'statusline'), '%{%v:lua.MiniStatusline.' .. field .. '()%}') @@ -151,8 +159,16 @@ T['setup()']['sets proper autocommands'] = function() end T['setup()']['respects `config.set_vim_settings`'] = function() - reload_module({ set_vim_settings = true }) - eq(child.o.laststatus, 2) + local validate = function(init_laststatus, ref_laststatus) + child.o.laststatus = init_laststatus + reload_module({ set_vim_settings = true }) + eq(child.o.laststatus, ref_laststatus) + end + + validate(0, 2) + validate(1, 2) + validate(2, 2) + validate(3, 3) end T['setup()']['disables built-in statusline in quickfix window'] = function() @@ -161,16 +177,18 @@ T['setup()']['disables built-in statusline in quickfix window'] = function() end T['setup()']['ensures content when working with built-in terminal'] = function() + helpers.skip_on_windows('Terminal emulator testing is not robust/easy on Windows') + local init_buf_id = child.api.nvim_get_current_buf() child.cmd('terminal! bash --noprofile --norc') -- Wait for terminal to get active - child.loop.sleep(50) + vim.loop.sleep(term_mode_wait) expect.match(child.wo.statusline, 'MiniStatusline%.active') eq(child.api.nvim_get_current_buf() == init_buf_id, false) type_keys('i', 'exit', '') - child.loop.sleep(50) + vim.loop.sleep(term_mode_wait) type_keys('') expect.match(child.wo.statusline, 'MiniStatusline%.active') eq(child.api.nvim_get_current_buf() == init_buf_id, true) @@ -774,7 +792,9 @@ T['Default content']['active'] = new_set({ parametrize = { { 120 }, { 75 }, { 40 }, { 39 } }, }, { test = function(window_width) - eq(child.api.nvim_win_get_option(0, 'statusline'), '%{%v:lua.MiniStatusline.active()%}') + helpers.skip_on_windows('Windows has different default path separator') + + eq(child.wo.statusline, '%{%v:lua.MiniStatusline.active()%}') set_width(window_width) child.expect_screenshot() end, diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_surround.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_surround.lua index fbab2ac7..914660f4 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_surround.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_surround.lua @@ -14,8 +14,7 @@ local get_cursor = function(...) return child.get_cursor(...) end local set_lines = function(...) return child.set_lines(...) end local get_lines = function(...) return child.get_lines(...) end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child) end --stylua: ignore end -- Make helpers @@ -76,6 +75,11 @@ local mock_treesitter_builtin = function() child.cmd('source tests/dir-surround/ local mock_treesitter_plugin = function() child.cmd('set rtp+=tests/dir-surround') end +-- Time constants +local default_highlight_duraion = 500 +local helper_message_delay = 1000 +local small_time = helpers.get_time_const(10) + -- Output test set ============================================================ local T = new_set({ hooks = { @@ -97,6 +101,9 @@ T['setup()']['creates side effects'] = function() -- Global variable eq(child.lua_get('type(_G.MiniSurround)'), 'table') + -- Autocommand group + eq(child.fn.exists('#MiniSurround'), 1) + -- Highlight groups child.cmd('hi clear') load_module() @@ -159,6 +166,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ silent = 1 }, 'silent', 'boolean') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniSurround'), 'links to IncSearch') +end + T['setup()']['properly handles `config.mappings`'] = function() local has_map = function(lhs, pattern) return child.cmd_capture('nmap ' .. lhs):find(pattern) ~= nil end @@ -248,7 +260,7 @@ T['gen_spec']['input']['treesitter()']['works with empty region'] = function() set_lines(lines) set_cursor(1, 0) type_keys('sh', 'o') - poke_eventloop() + child.poke_eventloop() -- It highlights `local` differently from other places if child.fn.has('nvim-0.10') == 1 then child.expect_screenshot() end @@ -514,10 +526,10 @@ T['Add surrounding']['prompts helper message after one idle second'] = function( -- Execute one time to test if 'needs help message' flag is set per call type_keys('sa', 'iw', ')') - sleep(200) + sleep(0.1 * helper_message_delay) type_keys('sa', 'iw') - sleep(1000) + sleep(helper_message_delay + small_time) -- Should show helper message without adding it to `:messages` and causing -- hit-enter-prompt @@ -663,7 +675,7 @@ T['Add surrounding']['respects `config.silent`'] = function() -- It should not show helper message after one idle second type_keys('sa', 'iw') - sleep(1000 + 15) + sleep(helper_message_delay + small_time) child.expect_screenshot() end @@ -793,15 +805,15 @@ T['Delete surrounding']['prompts helper message after one idle second'] = functi -- Mapping is applied only after `timeoutlen` milliseconds, because -- there are `sdn`/`sdl` mappings. Wait 1000 seconds after that. - child.o.timeoutlen = 50 - local total_wait_time = 1000 + child.o.timeoutlen + child.o.timeoutlen = 5 * small_time + local total_wait_time = helper_message_delay + child.o.timeoutlen + small_time set_lines({ '((aaa))' }) set_cursor(1, 1) -- Execute one time to test if 'needs help message' flag is set per call type_keys('sd', ')') - sleep(200) + sleep(0.1 * helper_message_delay) type_keys('sd') sleep(total_wait_time) @@ -917,15 +929,15 @@ T['Delete surrounding']['respects `config.silent`'] = function() child.lua('MiniSurround.config.silent = true') child.set_size(10, 20) - child.o.timeoutlen = 50 - local total_wait_time = 1000 + child.o.timeoutlen + child.o.timeoutlen = 5 * small_time + local total_wait_time = helper_message_delay + child.o.timeoutlen + small_time set_lines({ '' }) set_cursor(1, 1) -- It should not show helper message after one idle second type_keys('sd') - sleep(total_wait_time + 15) + sleep(total_wait_time) child.expect_screenshot() -- It should not show message about "No surrounding found" @@ -1024,15 +1036,15 @@ T['Replace surrounding']['prompts helper message after one idle second'] = funct -- Mapping is applied only after `timeoutlen` milliseconds, because -- there are `srn`/`srl` mappings. Wait 1000 seconds after that. - child.o.timeoutlen = 50 - local total_wait_time = 1000 + child.o.timeoutlen + child.o.timeoutlen = 5 * small_time + local total_wait_time = helper_message_delay + child.o.timeoutlen + small_time set_lines({ '((aaa))' }) set_cursor(1, 1) -- Execute one time to test if 'needs help message' flag is set per call type_keys('sr', ')', '>') - sleep(200) + sleep(0.1 * helper_message_delay) type_keys('sr') sleep(total_wait_time) @@ -1046,7 +1058,7 @@ T['Replace surrounding']['prompts helper message after one idle second'] = funct type_keys(')') -- Here mapping collision doesn't matter any more - sleep(1000) + sleep(helper_message_delay + small_time) eq(get_latest_message(), '') child.expect_screenshot() @@ -1170,15 +1182,15 @@ T['Replace surrounding']['respects `config.silent`'] = function() child.lua('MiniSurround.config.silent = true') child.set_size(10, 20) - child.o.timeoutlen = 50 - local total_wait_time = 1000 + child.o.timeoutlen + child.o.timeoutlen = 5 * small_time + local total_wait_time = helper_message_delay + child.o.timeoutlen + small_time set_lines({ '' }) set_cursor(1, 1) -- It should not show helper message after one idle second type_keys('sr') - sleep(total_wait_time + 15) + sleep(total_wait_time) child.expect_screenshot() -- It should not show message about "No surrounding found" @@ -1316,15 +1328,15 @@ T['Find surrounding']['prompts helper message after one idle second'] = function -- Mapping is applied only after `timeoutlen` milliseconds, because -- there are `sfn`/`sfl` mappings. Wait 1000 seconds after that. - child.o.timeoutlen = 50 - local total_wait_time = 1000 + child.o.timeoutlen + child.o.timeoutlen = 5 * small_time + local total_wait_time = helper_message_delay + child.o.timeoutlen + small_time set_lines({ '(aaa)' }) set_cursor(1, 2) -- Execute one time to test if 'needs help message' flag is set per call type_keys('sf', ')') - sleep(200) + sleep(0.1 * helper_message_delay) type_keys('sf') sleep(total_wait_time) @@ -1454,7 +1466,7 @@ T['Highlight surrounding'] = new_set({ hooks = { pre_case = function() -- Reduce default highlight duration to speed up tests execution - child.lua('MiniSurround.config.highlight_duration = 50') + child.lua('MiniSurround.config.highlight_duration = ' .. (5 * small_time)) child.set_size(5, 12) child.o.cmdheight = 1 end, @@ -1463,7 +1475,7 @@ T['Highlight surrounding'] = new_set({ local activate_highlighting = function() type_keys('sh)') - poke_eventloop() + child.poke_eventloop() end T['Highlight surrounding']['works with dot-repeat'] = function() @@ -1476,11 +1488,11 @@ T['Highlight surrounding']['works with dot-repeat'] = function() child.expect_screenshot() -- Should still highlight - sleep(test_duration - 10) + sleep(test_duration - 2 * small_time) child.expect_screenshot() -- Should stop highlighting - sleep(10) + sleep(2 * small_time + small_time) child.expect_screenshot() -- Should highlight with dot-repeat @@ -1488,7 +1500,7 @@ T['Highlight surrounding']['works with dot-repeat'] = function() child.expect_screenshot() -- Should stop highlighting - sleep(test_duration) + sleep(test_duration + small_time) child.expect_screenshot() -- Should allow not immediate dot-repeat @@ -1504,22 +1516,22 @@ T['Highlight surrounding']['works in extended mappings'] = function() set_cursor(1, 1) type_keys('shn', ')') - poke_eventloop() + child.poke_eventloop() child.expect_screenshot() - sleep(test_duration + 1) + sleep(test_duration + small_time) set_cursor(1, 12) type_keys('shl', ')') - poke_eventloop() + child.poke_eventloop() child.expect_screenshot() - sleep(test_duration + 1) + sleep(test_duration + small_time) -- Dot-repeat set_cursor(1, 1) type_keys('shn', ')') - sleep(test_duration + 1) + sleep(test_duration + small_time) type_keys('.') - poke_eventloop() + child.poke_eventloop() child.expect_screenshot() end @@ -1542,7 +1554,7 @@ T['Highlight surrounding']['respects `config.n_lines`'] = function() end T['Highlight surrounding']['works with multiline input surroundings'] = function() - child.lua('MiniSurround.config.highlight_duration = 5') + child.lua('MiniSurround.config.highlight_duration = ' .. small_time) child.lua([[MiniSurround.config.custom_surroundings = { a = { input = { '%(\na().-()a\n%)' } }, b = { input = { '%(\n().-()\n%)' } }, @@ -1554,15 +1566,15 @@ T['Highlight surrounding']['works with multiline input surroundings'] = function type_keys('sh', 'a') child.expect_screenshot() - sleep(10) + sleep(small_time + small_time) type_keys('sh', 'b') child.expect_screenshot() - sleep(10) + sleep(small_time + small_time) type_keys('sh', 'c') child.expect_screenshot() - sleep(10) + sleep(small_time + small_time) type_keys('sh', 'd') child.expect_screenshot() @@ -1581,12 +1593,12 @@ T['Highlight surrounding']['removes highlighting in correct buffer'] = function( child.cmd('vsplit current') set_lines({ '(bbb)' }) set_cursor(1, 2) - sleep(0.5 * test_duration) + sleep(0.5 * test_duration + small_time) activate_highlighting() -- Highlighting should be removed only in previous buffer child.expect_screenshot() - sleep(0.5 * test_duration + 2) + sleep(0.5 * test_duration + small_time) child.expect_screenshot() end @@ -1607,11 +1619,11 @@ T['Highlight surrounding']['removes highlighting per line'] = function() child.expect_screenshot() -- Should highlight only in second line - sleep(half_duration + 1) + sleep(half_duration + small_time) child.expect_screenshot() -- Should stop highlighting at all - sleep(half_duration + 1) + sleep(half_duration + small_time) child.expect_screenshot() end @@ -1640,7 +1652,7 @@ T['Highlight surrounding']['respects `vim.{g,b}.minisurround_disable`'] = new_se set_lines({ '(aaa)', 'bbb' }) set_cursor(1, 2) type_keys('sh', ')') - poke_eventloop() + child.poke_eventloop() -- Shouldn't highlight anything (instead moves cursor with `)` motion) child.expect_screenshot() @@ -1650,18 +1662,18 @@ T['Highlight surrounding']['respects `vim.{g,b}.minisurround_disable`'] = new_se T['Highlight surrounding']['respects `vim.b.minisurround_config`'] = function() child.b.minisurround_config = { custom_surroundings = { ['<'] = { input = { '>().-()<' } } }, - highlight_duration = 50, + highlight_duration = 5 * small_time, } validate_edit({ '>aaa<' }, { 1, 2 }, { 'aaa' }, { 1, 0 }, type_keys, 'sd', '<') set_lines({ '>aaa<', 'bbb' }) set_cursor(1, 2) type_keys('sh', '<') - poke_eventloop() + child.poke_eventloop() child.expect_screenshot() -- Should stop highlighting after duration from local config - sleep(50) + sleep(5 * small_time + small_time) child.expect_screenshot() end diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_tabline.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_tabline.lua index 7133b3e0..4cc1d9c6 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_tabline.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_tabline.lua @@ -10,7 +10,6 @@ local load_module = function(config) child.mini_load('tabline', config) end local unload_module = function() child.mini_unload('tabline') end local reload_module = function(config) unload_module(); load_module(config) end local set_lines = function(...) return child.set_lines(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end --stylua: ignore end -- Make helpers @@ -20,9 +19,14 @@ local edit = function(name) child.cmd('edit ' .. name) end local edit_path = function(rel_path) child.cmd('edit tests/dir-tabline/' .. rel_path) end +local path_sep = package.config:sub(1, 1) + local eval_tabline = function(show_hl, show_action) local res = child.lua_get('MiniTabline.make_tabline_string()') + -- Unify path separator for more robust testing + res = res:gsub(path_sep, '/') + if not show_hl then res = res:gsub('%%#%w+#', '') end if not show_action then @@ -51,6 +55,9 @@ T['setup()']['creates side effects'] = function() -- Global variable eq(child.lua_get('type(_G.MiniTabline)'), 'table') + -- Autocommand group + eq(child.fn.exists('#MiniTabline'), 1) + -- Highlight groups child.cmd('hi clear') load_module() @@ -97,6 +104,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ tabpage_section = 1 }, 'tabpage_section', 'string') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniTablineCurrent'), 'links to TabLineSel') +end + T['setup()']["sets proper 'tabline' option"] = function() eq(child.api.nvim_get_option('tabline'), '%!v:lua.MiniTabline.make_tabline_string()') child.cmd('tabedit') @@ -189,7 +201,7 @@ T['make_tabline_string()']['respects `config.tabpage_section`'] = function() -- Should also use buffer local config child.b.minitabline_config = { tabpage_section = 'right' } - poke_eventloop() + child.poke_eventloop() eq( eval_tabline(true), '%#MiniTablineHidden# aaa %#MiniTablineCurrent# bbb %#MiniTablineFill#%=%#MiniTablineTabpagesection# Tab 2/2 ' @@ -257,7 +269,7 @@ T['make_tabline_string()']['respects `config.show_icons`'] = function() -- Should also use buffer local config child.b.minitabline_config = { show_icons = true } - poke_eventloop() + child.poke_eventloop() eq(eval_tabline(true), '%#MiniTablineCurrent#  LICENSE %#MiniTablineHidden#  init.lua %#MiniTablineFill#') -- Should prefer 'mini.icons' even if 'nvim-web-devicons' is present @@ -287,7 +299,7 @@ T['make_tabline_string()']['respects `config.format`'] = function() '%#MiniTablineHidden#[1] |dir1/aaa| %#MiniTablineCurrent#[2] |dir2/aaa| %#MiniTablineHidden#[3] |!(2)| %#MiniTablineFill#' ) local log = child.lua_get('_G.log') - eq({ log[1], log[2], log[3] }, { 'dir1/aaa', 'dir2/aaa', '!(2)' }) + eq({ log[1], log[2], log[3] }, { 'dir1' .. path_sep .. 'aaa', 'dir2' .. path_sep .. 'aaa', '!(2)' }) -- Should also use buffer local config child.lua([[vim.b.minitabline_config = { diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_test.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_test.lua index c5f716f6..fb98a713 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_test.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_test.lua @@ -71,6 +71,9 @@ local expect_all_state = function(cases, state) eq(res, true) end +-- Time constants +local terminal_wait = helpers.get_time_const(500) + -- Output test set local T = new_set({ hooks = { @@ -91,6 +94,9 @@ T['setup()']['creates side effects'] = function() -- Global variable eq(child.lua_get('type(_G.MiniTest)'), 'table') + -- Autocommand group + eq(child.fn.exists('#MiniTest'), 1) + -- Highlight groups child.cmd('hi clear') load_module() @@ -140,8 +146,8 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ silent = 1 }, 'silent', 'boolean') end -T['setup()']['defines non-linked default highlighting on `ColorScheme`'] = function() - child.cmd('colorscheme blue') +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') expect.match(child.cmd_capture('hi MiniTestFail'), 'gui=bold') expect.match(child.cmd_capture('hi MiniTestPass'), 'gui=bold') expect.match(child.cmd_capture('hi MiniTestEmphasis'), 'gui=bold') @@ -330,7 +336,7 @@ end T['run_file()']['normalizes input path'] = function() child.lua('MiniTest.run_file(...)', { './' .. get_ref_path('testref_run.lua') }) - eq(child.lua_get('MiniTest.current.all_cases[1].desc[1]'), 'tests/dir-test/testref_run.lua') + eq(child.lua_get('MiniTest.current.all_cases[1].desc[1]'):gsub('\\', '/'), 'tests/dir-test/testref_run.lua') end T['run_at_location()'] = new_set() @@ -355,7 +361,9 @@ T['run_at_location()']['uses cursor position by default'] = function() local all_cases = get_current_all_cases() eq(#all_cases, 1) - eq(all_cases[1].desc, { path, 'run_at_location()' }) + local desc = all_cases[1].desc + eq(desc[1]:gsub('\\', '/'), path) + eq(desc[2], 'run_at_location()') end local collect_general = function() @@ -1083,11 +1091,12 @@ T['child']['type_keys()']['throws error explicitly'] = function() end T['child']['type_keys()']['respects `wait` argument'] = function() + local delay = helpers.get_time_const(100) local start_time = vim.loop.hrtime() - child.type_keys(100, 'i', 'Hello', { 'w', 'o' }, 'rld') + child.type_keys(delay, 'i', 'Hello', { 'w', 'o' }, 'rld') local end_time = vim.loop.hrtime() local duration = (end_time - start_time) * 0.000001 - eq(0.9 * 500 <= duration and duration <= 1.1 * 500, true) + eq(0.9 * 5 * delay <= duration and duration <= 1.1 * 5 * delay, true) end T['child']['cmd()'] = function() @@ -1347,6 +1356,16 @@ T['gen_reporter']['buffer'] = new_set({ local execute_command = string.format([[MiniTest.run_file('%s', { execute = { reporter = _G.reporter } })]], path) child.lua(execute_command) + + -- Unify path separator for more robust testing. Rely on search and replace + -- to preserve extmark highlighting. + if package.config:sub(1, 1) == '\\' then + local cur_pos = child.api.nvim_win_get_cursor(0) + child.cmd([[silent! %s^\S\zs\\^/^g]]) + child.cmd('silent! nohlsearch') + set_cursor(unpack(cur_pos)) + end + child.expect_screenshot() -- Should be able to run several times @@ -1366,6 +1385,7 @@ T['gen_reporter']['stdout'] = new_set({ parametrize = { { '' }, { 'TEST_GROUP_DEPTH=2' }, { 'TEST_QUIT_ON_FINISH=false' } }, }, { test = function(env_var) + helpers.skip_on_windows('Terminal tests are designed for Unix') mark_flaky() -- Testing "in dynamic" is left for manual approach @@ -1373,7 +1393,7 @@ T['gen_reporter']['stdout'] = new_set({ local command = string.format([[%s %s --headless --clean -n -u %s]], env_var, vim.v.progpath, vim.inspect(path)) child.fn.termopen(command) -- Wait until check is done and possible process is ended - vim.loop.sleep(500) + vim.loop.sleep(terminal_wait) child.expect_screenshot() end, }) diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_trailspace.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_trailspace.lua index ab2032f6..fbd3582f 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_trailspace.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_trailspace.lua @@ -76,6 +76,11 @@ T['setup()']['validates `config` argument'] = function() expect_config_error({ only_in_normal_buffers = 'a' }, 'only_in_normal_buffers', 'boolean') end +T['setup()']['ensures colors'] = function() + child.cmd('colorscheme default') + expect.match(child.cmd_capture('hi MiniTrailspace'), 'links to Error') +end + T['highlight()'] = new_set({ hooks = { pre_case = ensure_no_highlighting } }) T['highlight()']['works'] = function() diff --git a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_visits.lua b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_visits.lua index ae3efe01..a658971f 100644 --- a/config/neovim/store/lazy-plugins/mini.nvim/tests/test_visits.lua +++ b/config/neovim/store/lazy-plugins/mini.nvim/tests/test_visits.lua @@ -9,27 +9,28 @@ local new_set = MiniTest.new_set local load_module = function(config) child.mini_load('visits', config) end local unload_module = function() child.mini_unload('visits') end local type_keys = function(...) return child.type_keys(...) end -local poke_eventloop = function() child.api.nvim_eval('1') end -local sleep = function(ms) vim.loop.sleep(ms); poke_eventloop() end +local sleep = function(ms) helpers.sleep(ms, child, true) end local edit = function(path) child.cmd('edit ' .. child.fn.fnameescape(path)) end +local child_time = function() return child.lua_get('os.time()') end --stylua: ignore end -- Test paths helpers local join_path = function(...) return table.concat({ ... }, '/') end -local full_path = function(x) - local res = child.fn.fnamemodify(x, ':p'):gsub('(.)/$', '%1') - return res -end +local full_path = function(x) return (child.fn.fnamemodify(x, ':p'):gsub('\\', '/'):gsub('/+', '/'):gsub('(.)/$', '%1')) end local test_dir = 'tests/dir-visits' -local test_dir_absolute = vim.fn.fnamemodify(test_dir, ':p'):gsub('(.)/$', '%1') +local test_dir_absolute = vim.fn.fnamemodify(test_dir, ':p'):gsub('\\', '/'):gsub('(.)/$', '%1') +local xdg_data_home = test_dir_absolute +local data_std_path = xdg_data_home .. (helpers.is_windows() and '/nvim-data' or '/nvim') local make_testpath = function(...) return join_path(test_dir_absolute, ...) end -local cleanup_dirs = function() - -- Clean up any possible side effects in `XDG_DATA_HOME` directory - vim.fn.delete(join_path(test_dir_absolute, 'nvim'), 'rf') +local cleanup_index_file = function() + -- Clean up possibly written index file as it affects multiple test cases + local default_index_path = data_std_path .. '/mini-visits-index' + if vim.fn.filereadable(default_index_path) == 0 then return end + vim.fn.delete(default_index_path) end -- Common test wrappers @@ -41,12 +42,14 @@ end local get_index = forward_lua('MiniVisits.get_index') local set_index = forward_lua('MiniVisits.set_index') +local getcwd = function() return (child.fn.getcwd():gsub('\\', '/')) end + -- Common test helpers local validate_buf_name = function(buf_id, name) buf_id = buf_id or child.api.nvim_get_current_buf() name = name ~= '' and full_path(name) or '' name = name:gsub('/+$', '') - eq(child.api.nvim_buf_get_name(buf_id), name) + eq(child.api.nvim_buf_get_name(buf_id):gsub('\\', '/'), name) end local validate_partial_equal_arr = function(test_arr, ref_arr) @@ -130,15 +133,20 @@ end local get_ui_select_log = function() return child.lua_get('_G.ui_select_log') end +-- Time constants +local default_track_delay = 1000 +local small_time = helpers.get_time_const(10) +local test_track_delay = 2 * small_time + -- Output test set ============================================================ local T = new_set({ hooks = { pre_case = function() child.setup() - cleanup_dirs() + cleanup_index_file() -- Make `stdpath('data')` point to test directory - local lua_cmd = string.format([[vim.loop.os_setenv('XDG_DATA_HOME', %s)]], vim.inspect(test_dir_absolute)) + local lua_cmd = string.format([[vim.loop.os_setenv('XDG_DATA_HOME', %s)]], vim.inspect(xdg_data_home)) child.lua(lua_cmd) -- Load module @@ -151,7 +159,8 @@ local T = new_set({ end, post_once = function() child.stop() - cleanup_dirs() + cleanup_index_file() + vim.fn.delete(data_std_path, 'rf') end, }, }) @@ -229,14 +238,14 @@ T['register_visit()']['works'] = function() -- entries (relative to current directory in this case) eq(get_index(), {}) register_visit('file', 'dir') - eq(get_index(), { [dir_full] = { [file_full] = { count = 1, latest = os.time() } } }) + eq(get_index(), { [dir_full] = { [file_full] = { count = 1, latest = child_time() } } }) register_visit('file', 'dir') - local latest_1 = os.time() + local latest_1 = child_time() eq(get_index(), { [dir_full] = { [file_full] = { count = 2, latest = latest_1 } } }) register_visit('dir/file-2', 'dir') - local latest_2 = os.time() + local latest_2 = child_time() eq(get_index(), { [dir_full] = { [file_full] = { count = 2, latest = latest_1 }, @@ -251,7 +260,7 @@ T['register_visit()']['works'] = function() [file_2_full] = { count = 1, latest = latest_2 }, }, [dir_2_full] = { - [file_full] = { count = 1, latest = os.time() }, + [file_full] = { count = 1, latest = child_time() }, }, }) end @@ -260,15 +269,15 @@ T['register_visit()']['uses current data as defaults'] = function() local path = make_testpath('file') edit(path) register_visit() - eq(get_index(), { [child.fn.getcwd()] = { [path] = { count = 1, latest = os.time() } } }) + eq(get_index(), { [getcwd()] = { [path] = { count = 1, latest = child_time() } } }) end T['register_visit()']['handles paths with "~" for home directory'] = function() register_visit('~/file', '~/dir') - local home_dir = child.loop.os_homedir() + local home_dir = child.loop.os_homedir():gsub('\\', '/') eq( get_index(), - { [join_path(home_dir, 'dir')] = { [join_path(home_dir, 'file')] = { count = 1, latest = os.time() } } } + { [join_path(home_dir, 'dir')] = { [join_path(home_dir, 'file')] = { count = 1, latest = child_time() } } } ) end @@ -276,7 +285,7 @@ T['register_visit()']['does not affect other stored data'] = function() local path, cwd = make_testpath('file'), test_dir_absolute set_index({ [cwd] = { [path] = { count = 0, latest = 0, aaa = { bbb = true } } } }) register_visit(path, cwd) - eq(get_index(), { [cwd] = { [path] = { count = 1, latest = os.time(), aaa = { bbb = true } } } }) + eq(get_index(), { [cwd] = { [path] = { count = 1, latest = child_time(), aaa = { bbb = true } } } }) end T['register_visit()']['validates arguments'] = function() @@ -346,7 +355,7 @@ T['add_path()']['uses current data as defaults'] = function() local path = make_testpath('file') edit(path) add_path() - eq(get_index(), { [child.fn.getcwd()] = { [path] = { count = 0, latest = 0 } } }) + eq(get_index(), { [getcwd()] = { [path] = { count = 0, latest = 0 } } }) end T['add_path()']['does not affect other stored data'] = function() @@ -384,7 +393,7 @@ T['add_label()']['works'] = function() register_visit('file', 'dir') add_label('ccc', 'file', 'dir') eq(get_index(), { - [dir_full] = { [file_full] = { count = 1, labels = { aaa = true, bbb = true, ccc = true }, latest = os.time() } }, + [dir_full] = { [file_full] = { count = 1, labels = { aaa = true, bbb = true, ccc = true }, latest = child_time() } }, }) end @@ -441,7 +450,7 @@ T['add_label()']['uses current data as defaults for path and cwd'] = function() local path = make_testpath('file') edit(path) add_label('aaa') - eq(get_index(), { [child.fn.getcwd()] = { [path] = { count = 0, labels = { aaa = true }, latest = 0 } } }) + eq(get_index(), { [getcwd()] = { [path] = { count = 0, labels = { aaa = true }, latest = 0 } } }) end T['add_label()']['asks user for label if it is not supplied'] = function() @@ -550,7 +559,7 @@ T['remove_path()']['uses current data as defaults'] = function() local path = make_testpath('file') edit(path) add_path() - eq(get_index(), { [child.fn.getcwd()] = { [path] = { count = 0, latest = 0 } } }) + eq(get_index(), { [getcwd()] = { [path] = { count = 0, latest = 0 } } }) remove_path() eq(get_index(), {}) @@ -584,7 +593,7 @@ T['remove_label()']['works'] = function() add_label('ccc', 'file', 'dir') remove_label('bbb', 'file', 'dir') eq(get_index(), { - [dir_full] = { [file_full] = { count = 1, labels = { ccc = true }, latest = os.time() } }, + [dir_full] = { [file_full] = { count = 1, labels = { ccc = true }, latest = child_time() } }, }) end @@ -648,10 +657,10 @@ T['remove_label()']['uses current data as defaults for path and cwd'] = function local path = make_testpath('file') edit(path) add_label('aaa') - eq(get_index(), { [child.fn.getcwd()] = { [path] = { count = 0, labels = { aaa = true }, latest = 0 } } }) + eq(get_index(), { [getcwd()] = { [path] = { count = 0, labels = { aaa = true }, latest = 0 } } }) remove_label('aaa') - eq(get_index(), { [child.fn.getcwd()] = { [path] = { count = 0, latest = 0 } } }) + eq(get_index(), { [getcwd()] = { [path] = { count = 0, latest = 0 } } }) end T['remove_label()']['asks user for label if it is not supplied'] = function() @@ -713,14 +722,15 @@ T['list_paths()'] = new_set() local list_paths = forward_lua('MiniVisits.list_paths') T['list_paths()']['works'] = function() + local cur_time = child_time() local ref_index = { dir_1 = { - ['dir_1/file_1-1'] = { count = 2, latest = os.time() - 3 }, - ['dir_1/file_1-2'] = { count = 1, latest = os.time() - 4 }, + ['dir_1/file_1-1'] = { count = 2, latest = cur_time - 3 }, + ['dir_1/file_1-2'] = { count = 1, latest = cur_time - 4 }, }, dir_2 = { - ['dir_2/file_2-1'] = { count = 3, latest = os.time() - 2 }, - ['dir_1/file_1-2'] = { count = 4, latest = os.time() - 1 }, + ['dir_2/file_2-1'] = { count = 3, latest = cur_time - 2 }, + ['dir_1/file_1-2'] = { count = 4, latest = cur_time - 1 }, }, } set_index_from_ref(ref_index) @@ -1070,7 +1080,17 @@ T['list_labels()']['validates arguments'] = function() expect.error(function() list_labels('file', 1) end, '`cwd`.*string') end -T['select_path()'] = new_set() +T['select_path()'] = new_set({ + hooks = { + pre_case = function() + -- Ensure consistent path separator + child.lua([[ + local getcwd_orig = vim.fn.getcwd + vim.fn.getcwd = function() return (getcwd_orig():gsub('\\', '/')) end + ]]) + end, + }, +}) local select_path = forward_lua('MiniVisits.select_path') @@ -1100,7 +1120,7 @@ T['select_path()']['works'] = function() end T['select_path()']['properly shortens paths'] = function() - local home_dir = child.lua_get('vim.loop.os_homedir()') + local home_dir = child.loop.os_homedir() local dir_path = make_testpath('dir_1') child.fn.chdir(dir_path) @@ -1190,7 +1210,7 @@ T['select_label()']['works'] = function() edit('file') mock_ui_select(1) - select_label('', child.fn.getcwd()) + select_label('', getcwd()) eq(get_ui_select_log(), { { items = { 'bbb', 'xxx', 'aaa' }, prompt = 'Visited labels' }, { @@ -1263,7 +1283,7 @@ end local validate_iterate = function(init_path, direction, opts, ref_path) if init_path ~= nil then edit(init_path) end - iterate_paths(direction, child.fn.getcwd(), opts) + iterate_paths(direction, getcwd(), opts) validate_buf_name(0, ref_path) end @@ -1326,10 +1346,10 @@ end T['iterate_paths()']['reuses current buffer when opening path'] = function() setup_index_for_iterate() - edit(join_path(child.fn.getcwd(), 'file_1-1')) + edit(join_path(getcwd(), 'file_1-1')) local file_buf_id = child.api.nvim_get_current_buf() - edit(join_path(child.fn.getcwd(), 'file_1-2')) + edit(join_path(getcwd(), 'file_1-2')) child.api.nvim_buf_set_option(file_buf_id, 'buflisted', false) iterate_paths('first') @@ -1340,18 +1360,18 @@ T['iterate_paths()']['reuses current buffer when opening path'] = function() end T['iterate_paths()']['does not track visit'] = function() - child.lua('MiniVisits.config.track.delay = 10') + child.lua('MiniVisits.config.track.delay = ' .. test_track_delay) setup_index_for_iterate() local init_index = get_index() iterate_paths('first') - sleep(10 + 5) + sleep(test_track_delay + small_time) iterate_paths('forward') - sleep(10 + 5) + sleep(test_track_delay + small_time) iterate_paths('backward') - sleep(10 + 5) + sleep(test_track_delay + small_time) iterate_paths('last') - sleep(10 + 5) + sleep(test_track_delay + small_time) eq(get_index(), init_index) @@ -1423,15 +1443,13 @@ end T['get_index()'] = new_set() T['get_index()']['works'] = function() - child.lua('MiniVisits.config.track.delay = 10') + child.lua('MiniVisits.config.track.delay = ' .. test_track_delay) eq(get_index(), {}) local path = make_testpath('file') edit(path) - sleep(10) - local latest = os.time() - sleep(5) - eq(get_index(), { [child.fn.getcwd()] = { [path] = { count = 1, latest = latest } } }) + sleep(test_track_delay) + eq(get_index(), { [getcwd()] = { [path] = { count = 1, latest = child_time() } } }) -- Should return table copy local is_ok = child.lua([[ @@ -1446,12 +1464,12 @@ end T['set_index()'] = new_set() T['set_index()']['works'] = function() - child.lua('MiniVisits.config.track.delay = 10') + child.lua('MiniVisits.config.track.delay = ' .. test_track_delay) - local path, cwd = make_testpath('file'), child.fn.getcwd() + local path, cwd = make_testpath('file'), getcwd() child.lua(string.format('_G.path, _G.cwd = %s, %s', vim.inspect(path), vim.inspect(cwd))) child.lua([[ - _G.index_ref = { [vim.fn.getcwd()] = { [_G.path] = { count = 1, latest = 10 } } } + _G.index_ref = { [vim.fn.getcwd():gsub('\\', '/')] = { [_G.path] = { count = 1, latest = 10 } } } MiniVisits.set_index(_G.index_ref) ]]) @@ -1459,10 +1477,8 @@ T['set_index()']['works'] = function() -- Should set table copy edit(path) - sleep(10) - local latest = os.time() - sleep(5) - eq(get_index(), { [cwd] = { [path] = { count = 2, latest = latest } } }) + sleep(test_track_delay) + eq(get_index(), { [cwd] = { [path] = { count = 2, latest = child_time() } } }) eq(child.lua_get('_G.index_ref'), { [cwd] = { [path] = { count = 1, latest = 10 } } }) end @@ -1474,11 +1490,9 @@ T['set_index()']['treats set index as whole history and not only current session child.lua('MiniVisits.config.track.delay = 10') child.lua('MiniVisits.config.store.path = ' .. vim.inspect(store_path)) - local path, cwd = make_testpath('file'), child.fn.getcwd() - set_index({ [cwd] = { [path] = { count = 1, latest = os.time() } } }) + local path, cwd = make_testpath('file'), getcwd() + set_index({ [cwd] = { [path] = { count = 1, latest = child_time() } } }) eq(list_paths(''), { path }) - - child.lua([[MiniVisits.config.store.path = vim.fn.stdpath('data') .. '/mini-visits-index']]) end T['set_index()']['validates arguments'] = function() @@ -1507,16 +1521,16 @@ T['reset_index()']['works'] = function() child.fn.mkdir(vim.fn.fnamemodify(store_path, ':h'), 'p') child.fn.writefile({ 'return { aaa = { bbb = { count = 10, latest = 10 } } }' }, store_path) - local path, cwd = make_testpath('file'), child.fn.getcwd() - set_index({ [cwd] = { [path] = { count = 1, latest = os.time() } } }) + local path, cwd = make_testpath('file'), getcwd() + set_index({ [cwd] = { [path] = { count = 1, latest = child_time() } } }) child.lua('MiniVisits.reset_index()') eq(get_index(), { aaa = { bbb = { count = 10, latest = 10 } } }) end -T['reset_index()']['does nothing if feading index failed'] = function() +T['reset_index()']['does nothing if reading index failed'] = function() -- No index file - local index = { [child.fn.getcwd()] = { [make_testpath('file')] = { count = 1, latest = 10 } } } + local index = { [getcwd()] = { [make_testpath('file')] = { count = 1, latest = 10 } } } set_index(index) reset_index() @@ -1536,8 +1550,8 @@ T['normalize_index()'] = new_set() local normalize_index = forward_lua('MiniVisits.normalize_index') T['normalize_index()']['works'] = function() - local path, cwd = make_testpath('file'), child.fn.getcwd() - local index = { [cwd] = { [path] = { count = 1, labels = { aaa = true }, latest = os.time() } } } + local path, cwd = make_testpath('file'), getcwd() + local index = { [cwd] = { [path] = { count = 1, labels = { aaa = true }, latest = child_time() } } } set_index(index) -- Should return the output of `MiniVisits.gen_normalize.default` by default @@ -1557,8 +1571,8 @@ T['normalize_index()']['works'] = function() end T['normalize_index()']['respects `config.store.normalize`'] = function() - local path, cwd = make_testpath('file'), child.fn.getcwd() - local index = { [cwd] = { [path] = { count = 1, labels = { aaa = true }, latest = os.time() } } } + local path, cwd = make_testpath('file'), getcwd() + local index = { [cwd] = { [path] = { count = 1, labels = { aaa = true }, latest = child_time() } } } set_index(index) -- Should return the output of `MiniVisits.gen_normalize.default` by default @@ -1621,8 +1635,8 @@ T['write_index()'] = new_set() local write_index = forward_lua('MiniVisits.write_index') T['write_index()']['works'] = function() - local path, cwd = make_testpath('file'), child.fn.getcwd() - local index = { [cwd] = { [path] = { count = 1, latest = os.time() } } } + local path, cwd = make_testpath('file'), getcwd() + local index = { [cwd] = { [path] = { count = 1, latest = child_time() } } } set_index(index) -- Should call `normalize_index` and write its output @@ -1645,8 +1659,8 @@ T['write_index()']['respects arguments'] = function() -- Should create non-existing parent directories local store_path = make_testpath('nondir/subdir/test-index') MiniTest.finally(function() vim.fn.delete(store_path) end) - local path, cwd = make_testpath('file'), child.fn.getcwd() - local index = { [cwd] = { [path] = { count = 1, latest = os.time() } } } + local path, cwd = make_testpath('file'), getcwd() + local index = { [cwd] = { [path] = { count = 1, latest = child_time() } } } write_index(store_path, index) eq(table.concat(vim.fn.readfile(store_path), '\n'), 'return ' .. vim.inspect(index)) @@ -1810,7 +1824,7 @@ end T['gen_sort']['z()'] = new_set() T['gen_sort']['z()']['works'] = function() - local cur_time = os.time() + local cur_time = child_time() local path_data_arr = { { path = 'aaa', count = 2, latest = cur_time - 1 }, { path = 'bbb', count = 3, latest = cur_time - 10000 }, @@ -1833,7 +1847,7 @@ end T['gen_normalize']['default()']['works'] = function() local path, path_2, path_3 = make_testpath('file'), make_testpath('dir_1', 'file_1-1'), make_testpath('dir_1', 'file_1-2') - local cwd, cwd_2 = child.fn.getcwd(), test_dir_absolute + local cwd, cwd_2 = getcwd(), test_dir_absolute validate_default_normalize({}, { [cwd] = { @@ -1877,7 +1891,7 @@ end T['gen_normalize']['default()']['prunes before and after decay'] = function() local path, path_2 = make_testpath('file'), make_testpath('dir_1', 'file_1-1') - local cwd = child.fn.getcwd() + local cwd = getcwd() -- Before decay validate_default_normalize({}, { @@ -1909,14 +1923,14 @@ T['gen_normalize']['default()']['prunes before and after decay'] = function() end T['gen_normalize']['default()']['does not prune if visit has label'] = function() - local path, cwd = make_testpath('file'), child.fn.getcwd() + local path, cwd = make_testpath('file'), getcwd() local index = { [cwd] = { [path] = { count = 0, labels = { aaa = true }, latest = 0 } } } validate_default_normalize({}, index, index) end T['gen_normalize']['default()']['respects `opts.decay_threshold`'] = function() local path, path_2 = make_testpath('file'), make_testpath('dir_1', 'file_1-1') - local cwd = child.fn.getcwd() + local cwd = getcwd() local index = { [cwd] = { @@ -1937,7 +1951,7 @@ end T['gen_normalize']['default()']['respects `opts.decay_target`'] = function() local path, path_2 = make_testpath('file'), make_testpath('dir_1', 'file_1-1') - local cwd = child.fn.getcwd() + local cwd = getcwd() local index = { [cwd] = { @@ -1963,7 +1977,7 @@ end T['gen_normalize']['default()']['respects `opts.prune_threshold`'] = function() local path, path_2 = make_testpath('file'), make_testpath('dir_1', 'file_1-1') - local cwd = child.fn.getcwd() + local cwd = getcwd() local index = { [cwd] = { @@ -1980,7 +1994,7 @@ end T['gen_normalize']['default()']['respects `opts.prune_paths`'] = function() local path, path_2 = make_testpath('file'), make_testpath('dir_1', 'file_1-1') - local cwd, cwd_2 = child.fn.getcwd(), test_dir_absolute + local cwd, cwd_2 = getcwd(), test_dir_absolute local index = { [cwd] = { @@ -2014,78 +2028,74 @@ T['Tracking']['works'] = function() edit(path) eq(get_index(), {}) - sleep(980) + sleep(default_track_delay - 2 * small_time) eq(get_index(), {}) -- Should implement debounce style delay edit(path_2) - sleep(980) + sleep(default_track_delay - 2 * small_time) eq(get_index(), {}) - sleep(20) -- - "Latest" time should use time of actual registration - local latest = os.time() - - -- Sleep small time to reduce flakiness - sleep(5) - eq(get_index(), { [child.fn.getcwd()] = { [path_2] = { count = 1, latest = latest } } }) + sleep(2 * small_time) + eq(get_index(), { [getcwd()] = { [path_2] = { count = 1, latest = child_time() } } }) end T['Tracking']['registers only normal buffers'] = function() - child.lua('MiniVisits.config.track.delay = 10') + child.lua('MiniVisits.config.track.delay = ' .. test_track_delay) -- Scratch buffer local buf_id = child.api.nvim_create_buf(false, true) child.api.nvim_set_current_buf(buf_id) - sleep(10 + 5) + sleep(test_track_delay + small_time) eq(get_index(), {}) -- Help buffer child.cmd('help') - sleep(10 + 5) + sleep(test_track_delay + small_time) eq(get_index(), {}) end T['Tracking']['can register directories'] = function() - child.lua('MiniVisits.config.track.delay = 10') + child.lua('MiniVisits.config.track.delay = ' .. test_track_delay) local path = make_testpath('dir1') edit(path) - sleep(10 + 5) + sleep(test_track_delay + small_time) validate_index_entry('', path, { count = 1 }) end T['Tracking']['does not register same path twice in a row'] = function() - child.lua('MiniVisits.config.track.delay = 10') + child.lua('MiniVisits.config.track.delay = ' .. test_track_delay) local path = make_testpath('file') edit(path) - sleep(10 + 5) + sleep(test_track_delay + small_time) validate_index_entry('', path, { count = 1 }) child.cmd('help') - sleep(10 + 5) + sleep(test_track_delay + small_time) validate_index_entry('', path, { count = 1 }) edit(path) - sleep(10 + 5) + sleep(test_track_delay + small_time) validate_index_entry('', path, { count = 1 }) end T['Tracking']['is done on `BufEnter` by default'] = function() - child.lua('MiniVisits.config.track.delay = 10') + child.lua('MiniVisits.config.track.delay = ' .. test_track_delay) local path, path_2 = make_testpath('file'), make_testpath('dir1', 'file1-1') edit(path) - sleep(10 + 5) + sleep(test_track_delay + small_time) child.cmd('vertical split | edit ' .. child.fn.fnameescape(path_2)) - sleep(10 + 5) + sleep(test_track_delay + small_time) -- Going back and forth should count as visits child.cmd('wincmd w') - sleep(10 + 5) + sleep(test_track_delay + small_time) child.cmd('wincmd w') - sleep(10 + 5) + sleep(test_track_delay + small_time) validate_index_entry('', path, { count = 2 }) validate_index_entry('', path_2, { count = 2 }) @@ -2093,26 +2103,26 @@ end T['Tracking']['respects `config.track.event`'] = function() child.cmd('autocmd! MiniVisits') - load_module({ track = { event = 'BufHidden', delay = 10 } }) + load_module({ track = { event = 'BufHidden', delay = test_track_delay } }) local path = make_testpath('file') edit(path) - sleep(10 + 5) + sleep(test_track_delay + small_time) eq(get_index(), {}) child.api.nvim_set_current_buf(child.api.nvim_create_buf(false, true)) - sleep(10 + 5) + sleep(test_track_delay + small_time) validate_index_entry('', path, { count = 1 }) end T['Tracking']['can have `config.track.event = ""` to disable tracking'] = function() child.cmd('autocmd! MiniVisits') - load_module({ track = { event = '', delay = 10 } }) + load_module({ track = { event = '', delay = test_track_delay } }) eq(child.cmd_capture('au MiniVisits'):find('BufEnter'), nil) local path = make_testpath('file') edit(path) - sleep(10 + 5) + sleep(test_track_delay + small_time) eq(get_index(), {}) end @@ -2127,19 +2137,19 @@ T['Tracking']['respects `vim.{g,b}.minivisits_disable`'] = new_set({ parametrize = { { 'g' }, { 'b' } }, }, { test = function(var_type) - child.lua('MiniVisits.config.track.delay = 10') + child.lua('MiniVisits.config.track.delay = ' .. test_track_delay) local path, path_2 = make_testpath('file'), make_testpath('dir1', 'file1-1') -- Setting variable after event but before delay expired should work edit(path) - sleep(1) + sleep(0.1 * test_track_delay) child[var_type].minivisits_disable = true - sleep(9 + 5) + sleep(0.9 * test_track_delay + small_time) eq(get_index(), {}) -- Global variable should disable globally, buffer - per buffer edit(path_2) - sleep(10 + 5) + sleep(test_track_delay + small_time) if var_type == 'g' then eq(get_index(), {}) else @@ -2148,7 +2158,7 @@ T['Tracking']['respects `vim.{g,b}.minivisits_disable`'] = new_set({ -- Buffer-local variable should still work edit(path) - sleep(10 + 5) + sleep(test_track_delay + small_time) validate_index_entry('', path, nil) end, }) @@ -2162,10 +2172,12 @@ T['Storing']['works'] = function() end T['Storing']['respects `config.store.autowrite`'] = function() + local store_path = child.lua_get('MiniVisits.config.store.path') + eq(child.fn.filereadable(store_path), 0) + -- Should be respected even if set after `setup()` child.lua('MiniVisits.config.store.autowrite = false') child.cmd('doautocmd VimLeavePre') - local store_path = child.lua_get('MiniVisits.config.store.path') eq(child.fn.filereadable(store_path), 0) end diff --git a/config/neovim/store/lazy-plugins/neo-tree.nvim/README.md b/config/neovim/store/lazy-plugins/neo-tree.nvim/README.md index ab5b4180..3ade0996 100644 --- a/config/neovim/store/lazy-plugins/neo-tree.nvim/README.md +++ b/config/neovim/store/lazy-plugins/neo-tree.nvim/README.md @@ -173,6 +173,17 @@ use { folder_closed = "", folder_open = "", folder_empty = "󰜌", + provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available + if node.type == "file" or node.type == "terminal" then + local success, web_devicons = pcall(require, "nvim-web-devicons") + local name = node.type == "terminal" and "terminal" or node.name + if success then + local devicon, hl = web_devicons.get_icon(name) + icon.text = devicon or icon.text + icon.highlight = hl or icon.highlight + end + end + end, -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there -- then these will never be used. default = "*", diff --git a/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/defaults.lua b/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/defaults.lua index 61a195f7..cbd30c77 100644 --- a/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/defaults.lua +++ b/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/defaults.lua @@ -203,7 +203,18 @@ local config = { -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there -- then these will never be used. default = "*", - highlight = "NeoTreeFileIcon" + highlight = "NeoTreeFileIcon", + provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available + if node.type == "file" or node.type == "terminal" then + local success, web_devicons = pcall(require, "nvim-web-devicons") + local name = node.type == "terminal" and "terminal" or node.name + if success then + local devicon, hl = web_devicons.get_icon(name) + icon.text = devicon or icon.text + icon.highlight = hl or icon.highlight + end + end + end }, modified = { symbol = "[+] ", diff --git a/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/sources/common/components.lua b/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/sources/common/components.lua index 05607fc9..da85b02c 100644 --- a/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/sources/common/components.lua +++ b/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/sources/common/components.lua @@ -291,33 +291,31 @@ M.filtered_by = function(config, node, state) end M.icon = function(config, node, state) - local icon = config.default or " " - local highlight = config.highlight or highlights.FILE_ICON + -- calculate default icon + local icon = + { text = config.default or " ", highlight = config.highlight or highlights.FILE_ICON } if node.type == "directory" then - highlight = highlights.DIRECTORY_ICON + icon.highlight = highlights.DIRECTORY_ICON if node.loaded and not node:has_children() then - icon = not node.empty_expanded and config.folder_empty or config.folder_empty_open + icon.text = not node.empty_expanded and config.folder_empty or config.folder_empty_open elseif node:is_expanded() then - icon = config.folder_open or "-" + icon.text = config.folder_open or "-" else - icon = config.folder_closed or "+" - end - elseif node.type == "file" or node.type == "terminal" then - local success, web_devicons = pcall(require, "nvim-web-devicons") - local name = node.type == "terminal" and "terminal" or node.name - if success then - local devicon, hl = web_devicons.get_icon(name) - icon = devicon or icon - highlight = hl or highlight + icon.text = config.folder_closed or "+" end end + -- use icon provider if available + if config.provider then + icon = config.provider(icon, node, state) or icon + end + local filtered_by = M.filtered_by(config, node, state) - return { - text = icon .. " ", - highlight = filtered_by.highlight or highlight, - } + icon.text = icon.text .. " " -- add padding + icon.highlight = filtered_by.highlight or icon.highlight -- prioritize filtered highlighting + + return icon end M.modified = function(config, node, state) diff --git a/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/sources/document_symbols/components.lua b/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/sources/document_symbols/components.lua index d97fcd2c..b6283e8c 100644 --- a/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/sources/document_symbols/components.lua +++ b/config/neovim/store/lazy-plugins/neo-tree.nvim/lua/neo-tree/sources/document_symbols/components.lua @@ -15,14 +15,18 @@ local common = require("neo-tree.sources.common.components") local M = {} -M.icon = function(config, node, state) - return { +M.kind_icon = function(config, node, state) + local icon = { text = node:get_depth() == 1 and "" or node.extra.kind.icon, - highlight = node.extra and node.extra.kind.hl or highlights.FILE_NAME, + highlight = node.extra.kind.hl, } -end -M.kind_icon = M.icon + if config.provider then + icon = config.provider(icon, node, state) or icon + end + + return icon +end M.kind_name = function(config, node, state) return { diff --git a/config/neovim/store/lazy-plugins/neo-tree.nvim/scripts/test.sh b/config/neovim/store/lazy-plugins/neo-tree.nvim/scripts/test.sh index 8d3dcb43..515b18e0 100755 --- a/config/neovim/store/lazy-plugins/neo-tree.nvim/scripts/test.sh +++ b/config/neovim/store/lazy-plugins/neo-tree.nvim/scripts/test.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash set -euo pipefail diff --git a/config/neovim/store/lazy-plugins/noice.nvim/scripts/test b/config/neovim/store/lazy-plugins/noice.nvim/scripts/test index 0bc1a330..d66f84a6 100755 --- a/config/neovim/store/lazy-plugins/noice.nvim/scripts/test +++ b/config/neovim/store/lazy-plugins/noice.nvim/scripts/test @@ -1,3 +1,3 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash nvim -l tests/minit.lua --minitest diff --git a/config/neovim/store/lazy-plugins/nui.nvim/nix-support/propagated-build-inputs b/config/neovim/store/lazy-plugins/nui.nvim/nix-support/propagated-build-inputs index 62cc882a..8766e61e 100644 --- a/config/neovim/store/lazy-plugins/nui.nvim/nix-support/propagated-build-inputs +++ b/config/neovim/store/lazy-plugins/nui.nvim/nix-support/propagated-build-inputs @@ -1 +1 @@ -/nix/store/rn8bzg423wwkayzbsbmhmvcgjmbzrq5z-lua-5.1.5 \ No newline at end of file +/nix/store/k55zni8plmbwkbv9l6ds65p981ndxk7x-lua-5.1.5 \ No newline at end of file diff --git a/config/neovim/store/lazy-plugins/nvim-autopairs/.github/FUNDING.yml b/config/neovim/store/lazy-plugins/nvim-autopairs/.github/FUNDING.yml index 81bd9605..e2ed65f2 100644 --- a/config/neovim/store/lazy-plugins/nvim-autopairs/.github/FUNDING.yml +++ b/config/neovim/store/lazy-plugins/nvim-autopairs/.github/FUNDING.yml @@ -1,2 +1,2 @@ +github: ['windwp'] custom: https://paypal.me/trieule1vn -patreon: windwp diff --git a/config/neovim/store/lazy-plugins/nvim-autopairs/.github/workflows/sponsors.yml b/config/neovim/store/lazy-plugins/nvim-autopairs/.github/workflows/sponsors.yml new file mode 100644 index 00000000..c605d0c8 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-autopairs/.github/workflows/sponsors.yml @@ -0,0 +1,25 @@ +name: Generate Sponsors README +on: + workflow_dispatch: + schedule: + - cron: 0 0 1 */3 * +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2 + + - name: Generate Sponsors 💖 + uses: JamesIves/github-sponsors-readme-action@v1 + with: + token: ${{ secrets.PAT }} + file: 'README.md' + + - name: Deploy to GitHub Pages 🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: master + folder: '.' diff --git a/config/neovim/store/lazy-plugins/nvim-autopairs/README.md b/config/neovim/store/lazy-plugins/nvim-autopairs/README.md index 2467f9cc..916d75e5 100644 --- a/config/neovim/store/lazy-plugins/nvim-autopairs/README.md +++ b/config/neovim/store/lazy-plugins/nvim-autopairs/README.md @@ -16,7 +16,7 @@ Install the plugin with your preferred package manager: event = "InsertEnter", config = true -- use opts = {} for passing setup options - -- this is equalent to setup({}) function + -- this is equivalent to setup({}) function } ``` @@ -357,6 +357,7 @@ Before Input After ``` lua require('nvim-autopairs').disable() require('nvim-autopairs').enable() + require('nvim-autopairs').toggle() require('nvim-autopairs').remove_rule('(') -- remove rule ( require('nvim-autopairs').clear_rules() -- clear all rules require('nvim-autopairs').get_rules('"') @@ -419,4 +420,5 @@ npairs.setup({ ## Sponsors Thanks to everyone who sponsors my projects and makes continued development maintenance possible! - + +george looshch diff --git a/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs.lua b/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs.lua index 69e53f74..dd76cf40 100644 --- a/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs.lua +++ b/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs.lua @@ -56,11 +56,13 @@ M.setup = function(opt) M.force_attach() local group = api.nvim_create_augroup('autopairs_buf', { clear = true }) api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, { - group = group, pattern = '*', + group = group, + pattern = '*', callback = function() M.on_attach() end }) api.nvim_create_autocmd('BufDelete', { - group = group, pattern = '*', + group = group, + pattern = '*', callback = function(data) local cur = api.nvim_get_current_buf() local bufnr = tonumber(data.buf) or 0 @@ -70,7 +72,8 @@ M.setup = function(opt) end, }) api.nvim_create_autocmd('FileType', { - group = group, pattern = '*', + group = group, + pattern = '*', callback = function() M.force_attach() end }) end @@ -140,6 +143,10 @@ M.enable = function() M.state.disabled = false end +M.toggle = function() + M.state.disabled = not M.state.disabled +end + --- force remap key to buffer M.force_attach = function(bufnr) utils.set_attach(bufnr, 0) @@ -205,6 +212,7 @@ M.set_buf_rule = function(rules, bufnr) M.state.rules[bufnr] = rules end + M.on_attach = function(bufnr) -- log.debug('on_attach' .. vim.bo.filetype) if is_disable() then @@ -643,7 +651,7 @@ M.check_break_line_char = function() return M.autopairs_cr() end -M.completion_confirm =function () +M.completion_confirm = function() if vim.fn.pumvisible() ~= 0 then return M.esc("") else @@ -656,7 +664,7 @@ M.map_cr = function() 'i', '', "v:lua.require'nvim-autopairs'.completion_confirm()", - { expr = true, noremap = true } + { expr = true, noremap = true } ) end diff --git a/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/completion/cmp.lua b/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/completion/cmp.lua index 81c7024e..790585df 100644 --- a/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/completion/cmp.lua +++ b/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/completion/cmp.lua @@ -51,7 +51,8 @@ M.filetypes = { purescript = false, sh = false, bash = false, - nix = false + nix = false, + helm = false } M.on_confirm_done = function(opts) diff --git a/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/fastwrap.lua b/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/fastwrap.lua index 332c3fcc..b63b9a7e 100644 --- a/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/fastwrap.lua +++ b/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/fastwrap.lua @@ -189,6 +189,10 @@ M.highlight_wrap = function(tbl_pos, row, col, end_col, whitespace_line) if config.use_virt_lines then local virt_lines = {} local start = 0 + local left_col = vim.fn.winsaveview().leftcol + if left_col > 0 then + vim.fn.winrestview({ leftcol = 0 }) + end for _, pos in ipairs(tbl_pos) do virt_lines[#virt_lines + 1] = { whitespace_line:sub(start + 1, pos.pos - 1), 'Normal' } virt_lines[#virt_lines + 1] = { pos.key, config.highlight } diff --git a/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/rule.lua b/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/rule.lua index 5149651b..0652ca42 100644 --- a/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/rule.lua +++ b/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/rule.lua @@ -13,7 +13,6 @@ local Cond = require('nvim-autopairs.conds') --- @field is_multibyte boolean --- @field is_endwise boolean only use on end_wise --- @field is_undo boolean add break undo sequence - local Rule = setmetatable({}, { __call = function(self, ...) return self.new(...) @@ -172,7 +171,11 @@ end ---@return Rule function Rule:with_pair(cond, pos) if self.pair_cond == nil then self.pair_cond = {} end - self.pair_cond[pos or (#self.pair_cond + 1)] = cond + if pos then + table.insert(self.pair_cond, pos, cond) + else + table.insert(self.pair_cond, cond) + end return self end diff --git a/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/rules/basic.lua b/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/rules/basic.lua index 6dff30ab..78397e0f 100644 --- a/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/rules/basic.lua +++ b/config/neovim/store/lazy-plugins/nvim-autopairs/lua/nvim-autopairs/rules/basic.lua @@ -5,6 +5,7 @@ local utils = require('nvim-autopairs.utils') local function quote_creator(opt) local quote = function(...) local move_func = opt.enable_moveright and cond.move_right or cond.none + ---@type Rule local rule = Rule(...) :with_move(move_func()) :with_pair(cond.not_add_quote_inside_quote()) diff --git a/config/neovim/store/lazy-plugins/nvim-cmp/nix-support/propagated-build-inputs b/config/neovim/store/lazy-plugins/nvim-cmp/nix-support/propagated-build-inputs index 62cc882a..8766e61e 100644 --- a/config/neovim/store/lazy-plugins/nvim-cmp/nix-support/propagated-build-inputs +++ b/config/neovim/store/lazy-plugins/nvim-cmp/nix-support/propagated-build-inputs @@ -1 +1 @@ -/nix/store/rn8bzg423wwkayzbsbmhmvcgjmbzrq5z-lua-5.1.5 \ No newline at end of file +/nix/store/k55zni8plmbwkbv9l6ds65p981ndxk7x-lua-5.1.5 \ No newline at end of file diff --git a/config/neovim/store/lazy-plugins/nvim-jdtls/lemmy.sh b/config/neovim/store/lazy-plugins/nvim-jdtls/lemmy.sh index a30587b3..05d3d73b 100755 --- a/config/neovim/store/lazy-plugins/nvim-jdtls/lemmy.sh +++ b/config/neovim/store/lazy-plugins/nvim-jdtls/lemmy.sh @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash set -Eeuo pipefail lemmy-help -f lua/jdtls.lua lua/jdtls/dap.lua lua/jdtls/tests.lua >doc/jdtls.txt diff --git a/config/neovim/store/lazy-plugins/nvim-jdtls/lua/jdtls.lua b/config/neovim/store/lazy-plugins/nvim-jdtls/lua/jdtls.lua index bc1e567e..851f8446 100644 --- a/config/neovim/store/lazy-plugins/nvim-jdtls/lua/jdtls.lua +++ b/config/neovim/store/lazy-plugins/nvim-jdtls/lua/jdtls.lua @@ -840,11 +840,16 @@ end local function make_code_action_params(from_selection) + local params if from_selection then - return vim.lsp.util.make_given_range_params() + params = vim.lsp.util.make_given_range_params() else - return vim.lsp.util.make_range_params() + params = vim.lsp.util.make_range_params() end + params.context = { + diagnostics = {} + } + return params end diff --git a/config/neovim/store/lazy-plugins/nvim-lint/.luarc.json b/config/neovim/store/lazy-plugins/nvim-lint/.luarc.json index 3c8a4b06..23fcdd80 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/.luarc.json +++ b/config/neovim/store/lazy-plugins/nvim-lint/.luarc.json @@ -6,8 +6,11 @@ "workspace": { "library": [ "$VIMRUNTIME", - "${3rd}/luv/library" + "${3rd}/luv/library", + "${3rd}/busted/library", + "${3rd}/luassert/library", + "lua" ], "checkThirdParty": false - }, + } } diff --git a/config/neovim/store/lazy-plugins/nvim-lint/README.md b/config/neovim/store/lazy-plugins/nvim-lint/README.md index e5736d70..f24636ad 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/README.md +++ b/config/neovim/store/lazy-plugins/nvim-lint/README.md @@ -104,6 +104,7 @@ Other dedicated linters that are built-in are: | [chktex][20] | `chktex` | | [clang-tidy][23] | `clangtidy` | | [clazy][30] | `clazy` | +| [clippy][clippy] | `clippy` | | [clj-kondo][24] | `clj-kondo` | | [cmakelint][cmakelint] | `cmakelint` | | [codespell][18] | `codespell` | @@ -124,6 +125,7 @@ Other dedicated linters that are built-in are: | [erb-lint][erb-lint] | `erb_lint` | | [ESLint][25] | `eslint` | | [eslint_d][37] | `eslint_d` | +| [eugene][eugene] | `eugene` | | [fennel][fennel] | `fennel` | | [fish][fish] | `fish` | | [Flake8][13] | `flake8` | @@ -134,6 +136,7 @@ Other dedicated linters that are built-in are: | [glslc][glslc] | `glslc` | | [Golangci-lint][16] | `golangcilint` | | [hadolint][28] | `hadolint` | +| [hledger][hledger] | `hledger` | | [hlint][32] | `hlint` | | [htmlhint][htmlhint] | `htmlhint` | | [HTML Tidy][12] | `tidy` | @@ -197,6 +200,7 @@ Other dedicated linters that are built-in are: | [statix check][33] | `statix` | | [stylelint][29] | `stylelint` | | [SwiftLint][swiftlint] | `swiftlint` | +| [systemd-analyze][systemd-analyze] | `systemd-analyze` | | [systemdlint][systemdlint] | `systemdlint` | | [tflint][tflint] | `tflint` | | [tfsec][tfsec] | `tfsec` | @@ -273,15 +277,26 @@ The function takes two arguments: `errorformat` and `skeleton` (optional). ### from_pattern +Creates a parser function from a pattern. + ```lua parser = require('lint.parser').from_pattern(pattern, groups, severity_map, defaults, opts) ``` -The function allows to parse the linter's output using a Lua regular expression pattern. +### pattern -- pattern: The regular expression pattern applied on each line of the output -- groups: The groups specified by the pattern +The function allows to parse the linter's output using a pattern which can be either: +- A Lua pattern. See `:help lua-patterns`. +- A LPEG pattern object. See `:help vim.lpeg`. +- A function (`fun(line: string):string[]`). It takes one parameter - a line + from the linter output and must return a string array with the matches. The + array should be empty if there was no match. + + +### groups + +The groups specify the result format of the pattern. Available groups: - `lnum` @@ -301,7 +316,11 @@ local pattern = '[^:]+:(%d+):(%d+):(%w+):(.+)' local groups = { 'lnum', 'col', 'code', 'message' } ``` -- severity: A mapping from severity codes to diagnostic codes +The captures in the pattern correspond to the group at the same position. + +### severity + +A mapping from severity codes to diagnostic codes ``` lua default_severity = { @@ -312,18 +331,22 @@ default_severity = { } ``` -- defaults: The defaults diagnostic values +### defaults + +The defaults diagnostic values ```lua defaults = {["source"] = "mylint-name"} ``` -- opts: Additional options +### opts - - `lnum_offset`: Added to `lnum`. Defaults to 0 - - `end_lnum_offset`: Added to `end_lnum`. Defaults to 0 - - `end_col_offset`: offset added to `end_col`. Defaults to `-1`, assuming - that the end-column position is exclusive. +Additional options + +- `lnum_offset`: Added to `lnum`. Defaults to 0 +- `end_lnum_offset`: Added to `end_lnum`. Defaults to 0 +- `end_col_offset`: offset added to `end_col`. Defaults to `-1`, assuming + that the end-column position is exclusive. ## Customize built-in linters @@ -537,3 +560,7 @@ busted tests/ [swiftlint]: https://github.com/realm/SwiftLint [tflint]: https://github.com/terraform-linters/tflint [ameba]: https://github.com/crystal-ameba/ameba +[eugene]: https://github.com/kaaveland/eugene +[clippy]: https://github.com/rust-lang/rust-clippy +[hledger]: https://hledger.org/ +[systemd-analyze]: https://man.archlinux.org/man/systemd-analyze.1 diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint.lua index 23a93f7e..e7db985a 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint.lua +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint.lua @@ -4,6 +4,8 @@ local notify = vim.notify_once or vim.notify local M = {} +---@alias lint.parse fun(output:string, bufnr:number, linter_cwd:string):vim.Diagnostic[] + ---@class lint.Parser ---@field on_chunk fun(chunk: string) ---@field on_done fun(publish: fun(diagnostics: vim.Diagnostic[]), bufnr: number, linter_cwd: string) @@ -19,7 +21,7 @@ local M = {} ---@field ignore_exitcode? boolean if exit code != 1 should be ignored or result in a warning. Defaults to false ---@field env? table ---@field cwd? string ----@field parser lint.Parser|fun(output:string, bufnr:number, linter_cwd:string):vim.Diagnostic[] +---@field parser lint.Parser|lint.parse ---@class lint.LintProc @@ -321,6 +323,10 @@ function M.lint(linter, opts) -- pop up shortly. detached = not iswin } + -- prevents cmd.exe taking over the tab title + if iswin then + linter_opts.hide = true + end local cmd = eval_fn_or_id(linter.cmd) assert(cmd, 'Linter definition must have a `cmd` set: ' .. vim.inspect(linter)) handle, pid_or_err = uv.spawn(cmd, linter_opts, function(code) diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/clippy.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/clippy.lua new file mode 100644 index 00000000..24f57a51 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/clippy.lua @@ -0,0 +1,52 @@ +local severities = { + note = vim.diagnostic.severity.INFO, + warning = vim.diagnostic.severity.WARN, + help = vim.diagnostic.severity.HINT, +} + +local function parse(diagnostics, file_name, item) + for _, span in ipairs(item.spans) do + if span.file_name == file_name then + local message = item.message + if span.suggested_replacement ~= vim.NIL then + message = message .. "\nSuggested replacement:\n\n" .. tostring(span.suggested_replacement) + end + + table.insert(diagnostics, { + lnum = span.line_start - 1, + end_lnum = span.line_end - 1, + col = span.column_start - 1, + end_col = span.column_end - 1, + severity = severities[item.level], + source = "clippy", + message = message + }) + end + end + + for _, child in ipairs(item.children) do + parse(diagnostics, file_name, child) + end +end + +return { + cmd = "cargo", + args = { "clippy", "--message-format=json" }, + stdin = false, + append_fname = false, + parser = function(output, bufnr) + local diagnostics = {} + local items = #output > 0 and vim.split(output, "\n") or {} + local file_name = vim.api.nvim_buf_get_name(bufnr) + file_name = vim.fn.fnamemodify(file_name, ":.") + + for _, i in ipairs(items) do + local item = i ~= "" and vim.json.decode(i) or {} + -- cargo also outputs build artifacts messages in addition to diagnostics + if item and item.reason == "compiler-message" then + parse(diagnostics, file_name, item.message) + end + end + return diagnostics + end, +} diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/codespell.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/codespell.lua index 08fd873d..fa7927ad 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/codespell.lua +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/codespell.lua @@ -1,15 +1,35 @@ -- stdout output in the form "63: resourcs ==> resources, resource" +local api = vim.api local pattern = "(%d+): (.*)" local groups = { "lnum", "message" } local severities = nil -- none provided - +local parser = require('lint.parser').from_pattern(pattern, groups, severities, { + source = 'codespell', + severity = vim.diagnostic.severity.INFO, +}) return { cmd = 'codespell', args = { '--stdin-single-line', "-" }, stdin = true, ignore_exitcode = true, - parser = require('lint.parser').from_pattern(pattern, groups, severities, { - source = 'codespell', - severity = vim.diagnostic.severity.INFO, - }), + parser = function(output, bufnr, cwd) + local result = parser(output, bufnr, cwd) + for _, d in ipairs(result) do + local start, _, capture = d.message:find("(.*) ==>") + if start then + -- lenient - lint is async and buffer can change between lint start and result parsing + local ok, lines = pcall(api.nvim_buf_get_lines, bufnr, d.lnum, d.lnum + 1, true) + if ok then + local line = lines[1] or "" + local end_ + start, end_ = line:find(vim.pesc(capture)) + if start then + d.col = start - 1 + d.end_col = end_ + end + end + end + end + return result + end, } diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/cspell.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/cspell.lua index a09d617f..a7bdf7cc 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/cspell.lua +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/cspell.lua @@ -20,7 +20,7 @@ return { local lnum = math.max(0, item.lnum - 1) local col = math.max(0, item.col - 1) local end_lnum = item.end_lnum > 0 and (item.end_lnum - 1) or lnum - local end_col = col + word:len() - 2 or col + local end_col = col + vim.fn.strdisplaywidth(word) - 2 or col local diagnostic = { lnum = lnum, col = col, diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/eugene.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/eugene.lua new file mode 100644 index 00000000..cd6cfa86 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/eugene.lua @@ -0,0 +1,26 @@ +return { + cmd = 'eugene', + args = { + 'lint', + '--format=json', + }, + stdin = false, + parser = function(output, _) + local diagnostics = {} + if #output > 0 then + local decoded = vim.json.decode(output) + for _, stmt in ipairs(decoded.statements) do + for _, tr in ipairs(stmt.triggered_rules) do + table.insert(diagnostics, { + source = 'eugene', + lnum = stmt.line_number, + col = 0, + severity = vim.diagnostic.severity.ERROR, + message = string.format('%s: %s: %s', tr.id, tr.name, tr.url), + }) + end + end + end + return diagnostics + end, +} diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/hledger.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/hledger.lua new file mode 100644 index 00000000..dbb8e2f6 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/hledger.lua @@ -0,0 +1,27 @@ +return { + cmd = "hledger", + stdin = true, + args = {"check", "-s", "-f", "-"}, + stream = "stderr", + ignore_exitcode = true, + parser = function(output) + --- hledger currently outputs at most one error. + ---@type vim.Diagnostic[] + local result = {} + local pattern = "hledger: Error: %-:(%d+)(%-?(%d*)):(.*)" + local lnum, _, end_lnum, msg = output:match(pattern) + lnum = tonumber(lnum) + end_lnum = tonumber(end_lnum) + if (lnum or 0) > 0 then + table.insert(result, { + message = msg, + col = 0, + lnum = lnum - 1, + end_lnum = end_lnum and (end_lnum - 1) or nil, + severity = vim.diagnostic.severity.ERROR, + source = "hledger" + }) + end + return result + end +} diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/mypy.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/mypy.lua index 2a05213b..7316724f 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/mypy.lua +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/mypy.lua @@ -19,6 +19,10 @@ return { '--no-color-output', '--no-error-summary', '--no-pretty', + '--python-executable', + function() + return vim.fn.exepath 'python3' or vim.fn.exepath 'python' + end }, parser = require('lint.parser').from_pattern( pattern, diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/pylint.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/pylint.lua index 65dffcc1..0ed6c721 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/pylint.lua +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/pylint.lua @@ -9,11 +9,17 @@ local severities = { return { cmd = 'pylint', - stdin = false, + stdin = true, args = { - '-f', 'json' + '-f', + 'json', + '--from-stdin', + function() + return vim.api.nvim_buf_get_name(0) + end, }, ignore_exitcode = true, + stream = 'stdout', parser = function(output, bufnr) if output == "" then return {} end local diagnostics = {} diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/sqlfluff.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/sqlfluff.lua index fded783b..240559c3 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/sqlfluff.lua +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/sqlfluff.lua @@ -33,11 +33,15 @@ return { local diagnostics = {} for _, i_filepath in ipairs(per_filepath) do for _, violation in ipairs(i_filepath.violations) do + local severity = vim.diagnostic.severity.WARN + if violation.code == "PRS" then + severity = vim.diagnostic.severity.ERROR + end table.insert(diagnostics, { source = 'sqlfluff', lnum = (violation.line_no or violation.start_line_no) - 1, col = (violation.line_pos or violation.start_line_pos) - 1, - severity = vim.diagnostic.severity.ERROR, + severity = severity, message = violation.description, user_data = {lsp = {code = violation.code}}, }) diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/systemd-analyze.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/systemd-analyze.lua new file mode 100644 index 00000000..ff0beafc --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/systemd-analyze.lua @@ -0,0 +1,11 @@ +return { + cmd = "systemd-analyze", + args = {"verify"}, + ignore_exitcode = true, + stdin = false, + stream = "stderr", + parser = require("lint.parser").from_errorformat("%f:%l:%m", { + source = "systemd", + severity = vim.diagnostic.severity.WARN + }) +} diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/tidy.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/tidy.lua index aa589c84..789f1b9a 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/tidy.lua +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/linters/tidy.lua @@ -17,6 +17,7 @@ return { cmd = 'tidy', stdin = true, stream = 'stderr', + ignore_exitcode = true, args = { '-quiet', '-errors', diff --git a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/parser.lua b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/parser.lua index a918fc64..2a327556 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/parser.lua +++ b/config/neovim/store/lazy-plugins/nvim-lint/lua/lint/parser.lua @@ -10,6 +10,9 @@ local severity_by_qftype = { -- Return a parse function that uses an errorformat to parse the output. -- See `:help errorformat` +---@param efm string +---@param skeleton table | vim.Diagnostic +---@return lint.parse function M.from_errorformat(efm, skeleton) skeleton = skeleton or {} skeleton.severity = skeleton.severity or vd.severity.ERROR @@ -17,7 +20,7 @@ function M.from_errorformat(efm, skeleton) local lines = vim.split(output, '\n') local qflist = vim.fn.getqflist({ efm = efm, lines = lines }) local result = {} - for _, item in pairs(qflist.items) do + for _, item in ipairs(qflist.items) do if item.valid == 1 and (bufnr == nil or item.bufnr == 0 or item.bufnr == bufnr) then local lnum = math.max(0, item.lnum - 1) local col = math.max(0, item.col - 1) @@ -46,19 +49,39 @@ local normalize = (vim.fs ~= nil and vim.fs.normalize ~= nil) --- Parse a linter's output using a Lua pattern --- ----@param pattern string +---@param pattern string|vim.lpeg.Pattern|fun(line: string):string[] ---@param groups string[] ---@param severity_map? table ---@param defaults? table ---@param opts? {col_offset?: integer, end_col_offset?: integer, lnum_offset?: integer, end_lnum_offset?: integer} +---@return lint.parse function M.from_pattern(pattern, groups, severity_map, defaults, opts) defaults = defaults or {} severity_map = severity_map or {} opts = opts or {} + + local type_ = type(pattern) + local matchline + if type_ == "string" then + matchline = function(line) + return { line:match(pattern) } + end + elseif type_ == "function" then + matchline = pattern + else + matchline = function(line) + return { pattern:match(line) } + end + end + + -- Like vim.diagnostic.match but also checks if a `file` group matches the buffer path -- Some linters produce diagnostics for the full project and this should only produce buffer diagnostics local match = function(linter_cwd, buffer_path, line) - local matches = { line:match(pattern) } + local ok, matches = pcall(matchline, line) + if not ok then + error(string.format("pattern match failed on line: %s with error: %q", line, matches)) + end if not next(matches) then return nil end @@ -112,7 +135,9 @@ function M.from_pattern(pattern, groups, severity_map, defaults, opts) end local result = {} local buffer_path = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(bufnr), ":p") - for _, line in ipairs(vim.fn.split(output, '\n')) do + --- bwc for 0.6 requires boolean arg instead of table + ---@diagnostic disable-next-line: param-type-mismatch + for line in vim.gsplit(output, "\n", true) do local diagnostic = match(linter_cwd, buffer_path, line) if diagnostic then table.insert(result, diagnostic) @@ -130,6 +155,11 @@ Output from linter: %s ]] + +--- Turn a parse function into a parser table +--- +---@param parse fun(output: string, bufnr: integer, cwd: string):vim.Diagnostic[] +---@return lint.Parser function M.accumulate_chunks(parse) local chunks = {} return { diff --git a/config/neovim/store/lazy-plugins/nvim-lint/tests/codespell_spec.lua b/config/neovim/store/lazy-plugins/nvim-lint/tests/codespell_spec.lua new file mode 100644 index 00000000..2396aef0 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lint/tests/codespell_spec.lua @@ -0,0 +1,21 @@ +local api = vim.api +describe("codespell", function() + it("provides end_col", function() + local parser = require("lint.linters.codespell").parser + local bufnr = api.nvim_create_buf(false, true) + api.nvim_buf_set_lines(bufnr, 0, -1, true, {' error("hello crate test")'}) + local result = parser("1: crate ==> create", bufnr) + local expected = { + { + col = 15, + end_col = 20, + end_lnum = 0, + lnum = 0, + message = 'crate ==> create', + severity = vim.diagnostic.severity.INFO, + source = 'codespell', + } + } + assert.are.same(expected, result) + end) +end) diff --git a/config/neovim/store/lazy-plugins/nvim-lint/tests/hledger_spec.lua b/config/neovim/store/lazy-plugins/nvim-lint/tests/hledger_spec.lua new file mode 100644 index 00000000..d74f5373 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lint/tests/hledger_spec.lua @@ -0,0 +1,59 @@ +describe("hledger", function() + local parser = require("lint.linters.hledger").parser + it("no diagnostics on empty output", function() + assert.are.same({}, parser("")) + end) + + it("returns error diagnostic on error output", function() + -- editorconfig-checker-disable + local msg = [[ + | 2024-08-10 * payment + | revenue:dev:customer -1.234,00 EUR +14 | assets:receivable:customer 1.234,00 EUR + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Strict account checking is enabled, and +account "assets:receivable:customer" has not been declared. +Consider adding an account directive. Examples: + +account assets:receivable:customer +account assets:receivable:customer ; type:A ; (L,E,R,X,C,V) +]] + -- editorconfig-checker-enable + local output = "hledger: Error: -:14:" .. msg + local expected = { + { + message = msg, + col = 0, + lnum = 13, + severity = vim.diagnostic.severity.ERROR, + source = "hledger" + }, + } + assert.are.same(expected, parser(output)) + end) + it("supports column-ranges", function() + -- editorconfig-checker-disable + local msg = [[ +109 | 2024-08-16 assert balance + | assets:checking 4 EUR = 68,59 EUR + +This transaction is unbalanced. +The real postings' sum should be 0 but is: 4 EUR +Consider adjusting this entry's amounts, or adding missing postings. +]] + -- editorconfig-checker-enable + local output = "hledger: Error: -:109-110:" .. msg + local expected = { + { + message = msg, + col = 0, + lnum = 108, + end_lnum = 109, + severity = vim.diagnostic.severity.ERROR, + source = "hledger" + }, + } + assert.are.same(expected, parser(output)) + end) +end) diff --git a/config/neovim/store/lazy-plugins/nvim-lint/tests/parser_spec.lua b/config/neovim/store/lazy-plugins/nvim-lint/tests/parser_spec.lua index b11b7a4c..af88c762 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/tests/parser_spec.lua +++ b/config/neovim/store/lazy-plugins/nvim-lint/tests/parser_spec.lua @@ -73,4 +73,58 @@ bar:209:14 Bigger mistake } assert.are.same(expected, result) end) + + it("supports lpeg pattern", function() + if not vim.re then + return + end + local pattern = vim.re.compile("{[0-9]+} ':' { (.*) }") + local groups = { 'lnum', 'message' } + local parser = require('lint.parser').from_pattern(pattern, groups) + local output = [[ +10:Big mistake +14:Bigger mistake +]] + local result = parser(output, 0) + local expected = { + { + message = 'Big mistake', + lnum = 9, + end_lnum = 9, + col = 0, + end_col = 0, + severity = vim.diagnostic.severity.ERROR, + }, + { + message = 'Bigger mistake', + lnum = 13, + col = 0, + end_lnum = 13, + end_col = 0, + severity = vim.diagnostic.severity.ERROR, + }, + } + assert.are.same(expected, result) + assert.are.same({}, parser("no-match", 0)) + end) + + it("supports match function", function() + local pattern = function(_) + return { 10, "hello" } + end + local groups = { 'lnum', 'message' } + local parser = require('lint.parser').from_pattern(pattern, groups) + local result = parser("foo", 0) + local expected = { + { + message = "hello", + lnum = 9, + col = 0, + end_lnum = 9, + end_col = 0, + severity = vim.diagnostic.severity.ERROR + }, + } + assert.are.same(expected, result) + end) end) diff --git a/config/neovim/store/lazy-plugins/nvim-lint/tests/sqlfluff_spec.lua b/config/neovim/store/lazy-plugins/nvim-lint/tests/sqlfluff_spec.lua index 41b207c3..1546e0c5 100644 --- a/config/neovim/store/lazy-plugins/nvim-lint/tests/sqlfluff_spec.lua +++ b/config/neovim/store/lazy-plugins/nvim-lint/tests/sqlfluff_spec.lua @@ -3,6 +3,7 @@ describe('linter.sqlfluff', function() local parser = require('lint.linters.sqlfluff').parser local bufnr = vim.uri_to_bufnr('file:///non-existent.sql') -- actual output I got from running sqlfluff + -- NB: These tests do not address parsing failures local result = parser([[ [{"filepath": "stdin", "violations": [{"start_line_no": 68, "start_line_pos": 1, "code": "L003", "description": "Expected 1 indentation, found 0 [compared to line 52]"}, {"start_line_no": 68, "start_line_pos": 1, "code": "L013", "description": "Column expression without alias. Use explicit `AS` clause."}]}] @@ -15,7 +16,7 @@ describe('linter.sqlfluff', function() message = 'Expected 1 indentation, found 0 [compared to line 52]', lnum = 67, -- mind the line indexing col = 0, -- mind the column indexing - severity = vim.diagnostic.severity.ERROR, + severity = vim.diagnostic.severity.WARN, user_data = {lsp = {code = 'L003'}}, } assert.are.same(expected[1], result[1]) @@ -25,7 +26,7 @@ describe('linter.sqlfluff', function() message = 'Column expression without alias. Use explicit `AS` clause.', lnum = 67, col = 0, - severity = vim.diagnostic.severity.ERROR, + severity = vim.diagnostic.severity.WARN, user_data = {lsp = {code = 'L013'}}, } assert.are.same(expected[2], result[2]) @@ -47,7 +48,7 @@ describe('linter.sqlfluff', function() message = 'Expected 1 indentation, found 0 [compared to line 52]', lnum = 67, -- mind the line indexing col = 0, -- mind the column indexing - severity = vim.diagnostic.severity.ERROR, + severity = vim.diagnostic.severity.WARN, user_data = {lsp = {code = 'L003'}}, } assert.are.same(expected[1], result[1]) @@ -57,7 +58,7 @@ describe('linter.sqlfluff', function() message = 'Column expression without alias. Use explicit `AS` clause.', lnum = 67, col = 0, - severity = vim.diagnostic.severity.ERROR, + severity = vim.diagnostic.severity.WARN, user_data = {lsp = {code = 'L013'}}, } assert.are.same(expected[2], result[2]) diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/.github/workflows/release.yml b/config/neovim/store/lazy-plugins/nvim-lspconfig/.github/workflows/release.yml index 9e590185..d38b8f20 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/.github/workflows/release.yml +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/.github/workflows/release.yml @@ -18,4 +18,4 @@ jobs: This plugin allows for declaratively configuring, launching, and initializing language servers you have installed on your system. Language server configurations are community-maintained. - licence: "Apache/2.0" + license: "Apache/2.0" diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/.github/workflows/test.yml b/config/neovim/store/lazy-plugins/nvim-lspconfig/.github/workflows/test.yml index 63346053..8d5f7a75 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/.github/workflows/test.yml +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: luajit uses: leafo/gh-actions-lua@v10 with: - luaVersion: "luajit-2.1.0-beta3" + luaVersion: "luajit-openresty" - name: luarocks uses: leafo/gh-actions-luarocks@v4 diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/doc/server_configurations.md b/config/neovim/store/lazy-plugins/nvim-lspconfig/doc/server_configurations.md index 476d85fa..f91a2c3f 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/doc/server_configurations.md +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/doc/server_configurations.md @@ -24,7 +24,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [ballerina](#ballerina) - [basedpyright](#basedpyright) - [bashls](#bashls) -- [bazelrc-lsp](#bazelrc-lsp) +- [bazelrc_lsp](#bazelrc_lsp) - [beancount](#beancount) - [bicep](#bicep) - [biome](#biome) @@ -60,6 +60,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [cucumber_language_server](#cucumber_language_server) - [custom_elements_ls](#custom_elements_ls) - [cypher_ls](#cypher_ls) +- [daedalus_ls](#daedalus_ls) - [dafny](#dafny) - [dagger](#dagger) - [dartls](#dartls) @@ -145,6 +146,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [jsonls](#jsonls) - [jsonnet_ls](#jsonnet_ls) - [julials](#julials) +- [kcl](#kcl) - [koka](#koka) - [kotlin_language_server](#kotlin_language_server) - [lean3ls](#lean3ls) @@ -253,6 +255,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [slint_lsp](#slint_lsp) - [smarty_ls](#smarty_ls) - [smithy_ls](#smithy_ls) +- [snakeskin_ls](#snakeskin_ls) - [snyk_ls](#snyk_ls) - [solang](#solang) - [solargraph](#solargraph) @@ -296,10 +299,11 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [thriftls](#thriftls) - [tilt_ls](#tilt_ls) - [tinymist](#tinymist) +- [ts_ls](#ts_ls) - [tsp_server](#tsp_server) -- [tsserver](#tsserver) - [ttags](#ttags) - [turtle_ls](#turtle_ls) +- [tvm_ffi_navigator](#tvm_ffi_navigator) - [twiggy_language_server](#twiggy_language_server) - [typeprof](#typeprof) - [typos_lsp](#typos_lsp) @@ -327,6 +331,8 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [yamlls](#yamlls) - [yang_lsp](#yang_lsp) - [yls](#yls) +- [ziggy](#ziggy) +- [ziggy_schema](#ziggy_schema) - [zk](#zk) - [zls](#zls) @@ -427,6 +433,13 @@ require'lspconfig'.als.setup{} ```lua { "ada_language_server" } ``` + - `deprecate` : + ```lua + { + to = "github.com/TamaMcGlinn/nvim-lspconfig-ada", + version = "0.2.0" + } + ``` - `filetypes` : ```lua { "ada" } @@ -1185,7 +1198,7 @@ require'lspconfig'.bashls.setup{} ``` -## bazelrc-lsp +## bazelrc_lsp https://github.com/salesforce-misc/bazelrc-lsp @@ -1205,7 +1218,7 @@ vim.filetype.add { **Snippet to enable the language server:** ```lua -require'lspconfig'.bazelrc-lsp.setup{} +require'lspconfig'.bazelrc_lsp.setup{} ``` @@ -1948,6 +1961,7 @@ https://clangd.llvm.org/installation.html require'lspconfig'.clangd.setup{} ``` **Commands:** +- ClangdShowSymbolInfo: Show symbol info - ClangdSwitchSourceHeader: Switch between source/header **Default values:** @@ -2608,6 +2622,45 @@ require'lspconfig'.cypher_ls.setup{} ``` +## daedalus_ls + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.daedalus_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "DaedalusLanguageServer" } + ``` + - `filetypes` : + ```lua + { "d" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + DaedalusLanguageServer = { + fileEncoding = "Windows-1252", + inlayHints = { + constants = true + }, + loglevel = "debug", + numParserThreads = 16, + srcFileEncoding = "Windows-1252" + } + } + ``` + + ## dafny Support for the Dafny language server. @@ -4237,7 +4290,7 @@ require'lspconfig'.foam_ls.setup{} ## fortls -https://github.com/gnikit/fortls +https://fortls.fortran-lang.org/index.html fortls is a Fortran Language Server, the server can be installed via pip @@ -4247,7 +4300,7 @@ pip install fortls Settings to the server can be passed either through the `cmd` option or through a local configuration file e.g. `.fortls`. For more information -see the `fortls` [documentation](https://gnikit.github.io/fortls/options.html). +see the `fortls` [documentation](https://fortls.fortran-lang.org/options.html). @@ -5237,9 +5290,20 @@ lspconfig.haxe_language_server.setup({ }) ``` -By default, an HXML compiler arguments file named `build.hxml` is expected in -your project's root directory. If your file is named something different, -specify it using the `init_options.displayArguments` setting. +By default, the language server is configured with the HXML compiler arguments +contained in the first `.hxml` file found in your project's root directory. +If you want to specify which one to use, set the `init_options.displayArguments` +setting: + +```lua +lspconfig.haxe_language_server.setup({ + -- ... + init_options = { + displayArguments = { "build.hxml" }, + }, +}) +``` + @@ -5260,13 +5324,15 @@ require'lspconfig'.haxe_language_server.setup{} ``` - `init_options` : ```lua - { - displayArguments = { "build.hxml" } - } + default value is set by on_new_config + ``` + - `on_new_config` : + ```lua + see source file ``` - `root_dir` : ```lua - root_pattern("*.hxml") + root_pattern("*.hxml", ".git") ``` - `settings` : ```lua @@ -5644,7 +5710,7 @@ require'lspconfig'.htmx.setup{} ``` - `filetypes` : ```lua - { "html", "templ" } + { "aspnetcorerazor", "astro", "astro-markdown", "blade", "clojure", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "gohtmltmpl", "haml", "handlebars", "hbs", "html", "htmlangular", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte", "templ" } ``` - `root_dir` : ```lua @@ -5714,7 +5780,7 @@ require'lspconfig'.hyprls.setup{} ``` - `filetypes` : ```lua - { "hyprlang", "*.hl", "hypr*.conf", ".config/hypr/*.conf" } + { "hyprlang" } ``` - `root_dir` : ```lua @@ -6098,7 +6164,7 @@ vscode-json-language-server, a language server for JSON and JSON schema npm i -g vscode-langservers-extracted ``` -Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. +`vscode-json-language-server` only provides completions when snippet support is enabled. If you use Neovim older than v0.10 you need to enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. ```lua --Enable (broadcasting) snippet capability for completion @@ -6234,6 +6300,36 @@ require'lspconfig'.julials.setup{} ``` +## kcl + +https://github.com/kcl-lang/kcl.nvim + +Language server for the KCL configuration and policy language. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.kcl.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "kcl-language-server" } + ``` + - `filetypes` : + ```lua + { "kcl" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + ## koka https://koka-lang.github.io/koka/doc/index.html @@ -6974,7 +7070,7 @@ require'lspconfig'.mesonlsp.setup{} ``` - `root_dir` : ```lua - util.root_pattern("meson_options.txt", "meson.options", ".git") + util.root_pattern("meson.build", "meson_options.txt", "meson.options", ".git") ``` @@ -9403,7 +9499,7 @@ require'lspconfig'.r_language_server.setup{} **Default values:** - `cmd` : ```lua - { "R", "--slave", "-e", "languageserver::run()" } + { "R", "--no-echo", "-e", "languageserver::run()" } ``` - `filetypes` : ```lua @@ -9745,7 +9841,21 @@ ReScript Language Server can be installed via npm: npm install -g @rescript/language-server ``` -See the init_options supported (see https://github.com/rescript-lang/rescript-vscode/tree/master/server/config.md): +See [package.json](https://github.com/rescript-lang/rescript-vscode/blob/master/package.json#L139) +for init_options supported. + +For example, in order to disable the `inlayHints` option: +```lua +require'lspconfig'.pylsp.setup{ + settings = { + rescript = { + settings = { + inlayHints = { enable = false }, + }, + }, + } +} +``` @@ -9768,7 +9878,21 @@ require'lspconfig'.rescriptls.setup{} ```lua { extensionConfiguration = { - askToStartBuild = false + allowBuiltInFormatter = true, + askToStartBuild = false, + cache = { + projectConfig = { + enabled = true + } + }, + codeLens = true, + incrementalTypechecking = { + acrossFiles = true, + enabled = true + }, + inlayHints = { + enable = true + } } } ``` @@ -10321,7 +10445,7 @@ require'lspconfig'.scheme_langserver.setup{} **Default values:** - `cmd` : ```lua - { "scheme-langserver" } + { "scheme-langserver", "~/.scheme-langserver.log", "enable", "disable" } ``` - `filetypes` : ```lua @@ -10660,6 +10784,38 @@ require'lspconfig'.smithy_ls.setup{} ``` +## snakeskin_ls + +https://www.npmjs.com/package/@snakeskin/cli + +`snakeskin cli` can be installed via `npm`: +```sh +npm install -g @snakeskin/cli +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.snakeskin_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "snakeskin-cli", "lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ss" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + ## snyk_ls https://github.com/snyk/snyk-ls @@ -11608,7 +11764,7 @@ require'lspconfig'.superhtml.setup{} https://github.com/sveltejs/language-tools/tree/master/packages/language-server -Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). +Note: assuming that [ts_ls](#ts_ls) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). `svelte-language-server` can be installed via `npm`: ```sh @@ -11746,7 +11902,7 @@ require'lspconfig'.swift_mesonls.setup{} ``` - `root_dir` : ```lua - util.root_pattern("meson_options.txt", "meson.options", ".git") + util.root_pattern("meson.build", "meson_options.txt", "meson.options", ".git") ``` @@ -11962,9 +12118,14 @@ https://github.com/teal-language/teal-language-server Install with: ``` -luarocks install --dev teal-language-server +luarocks install teal-language-server ``` +Optional Command Args: +* "--log-mode=by_date" - Enable logging in $HOME/.cache/teal-language-server. Log name will be date + pid of process +* "--log-mode=by_proj_path" - Enable logging in $HOME/.cache/teal-language-server. Log name will be project path + pid of process +* "--verbose=true" - Increases log level. Does nothing unless log-mode is set + **Snippet to enable the language server:** @@ -11984,7 +12145,7 @@ require'lspconfig'.teal_ls.setup{} ``` - `root_dir` : ```lua - root_pattern("tlconfig.lua", ".git") + root_pattern("tlconfig.lua") ``` @@ -12439,44 +12600,12 @@ require'lspconfig'.tinymist.setup{} ``` -## tsp_server - -https://github.com/microsoft/typespec - -The language server for TypeSpec, a language for defining cloud service APIs and shapes. - -`tsp-server` can be installed together with the typespec compiler via `npm`: -```sh -npm install -g @typespec/compiler -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.tsp_server.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "tsp-server", "--stdio" } - ``` - - `filetypes` : - ```lua - { "typespec" } - ``` - - `root_dir` : - ```lua - util.root_pattern("tspconfig.yaml", ".git") - ``` - - -## tsserver +## ts_ls https://github.com/typescript-language-server/typescript-language-server +`ts_ls`, aka `typescript-language-server`, is a Language Server Protocol implementation for TypeScript wrapping `tsserver`. Note that `ts_ls` is not `tsserver`. + `typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: ```sh npm install -g typescript typescript-language-server @@ -12510,7 +12639,7 @@ adds Vue support to this language server. *IMPORTANT*: It is crucial to ensure that `@vue/typescript-plugin` and `volar `are of identical versions. ```lua -require'lspconfig'.tsserver.setup{ +require'lspconfig'.ts_ls.setup{ init_options = { plugins = { { @@ -12543,7 +12672,7 @@ require'lspconfig'.tsserver.setup{ **Snippet to enable the language server:** ```lua -require'lspconfig'.tsserver.setup{} +require'lspconfig'.ts_ls.setup{} ``` @@ -12572,6 +12701,40 @@ require'lspconfig'.tsserver.setup{} ``` +## tsp_server + +https://github.com/microsoft/typespec + +The language server for TypeSpec, a language for defining cloud service APIs and shapes. + +`tsp-server` can be installed together with the typespec compiler via `npm`: +```sh +npm install -g @typespec/compiler +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tsp-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "typespec" } + ``` + - `root_dir` : + ```lua + util.root_pattern("tspconfig.yaml", ".git") + ``` + + ## ttags https://github.com/npezza93/ttags @@ -12631,6 +12794,38 @@ require'lspconfig'.turtle_ls.setup{} ``` +## tvm_ffi_navigator + +https://github.com/tqchen/ffi-navigator + +The Language Server for FFI calls in TVM to be able jump between python and C++ + +FFI navigator can be installed with `pip install ffi-navigator`, buf for more details, please see +https://github.com/tqchen/ffi-navigator?tab=readme-ov-file#installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tvm_ffi_navigator.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "python", "-m", "ffi_navigator.langserver" } + ``` + - `filetypes` : + ```lua + { "python", "cpp" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + ## twiggy_language_server https://github.com/moetelo/twiggy @@ -12718,10 +12913,6 @@ require'lspconfig'.typos_lsp.setup{} ```lua { "typos-lsp" } ``` - - `filetypes` : - ```lua - { "*" } - ``` - `root_dir` : ```lua see source file @@ -12915,11 +13106,11 @@ require'lspconfig'.uvls.setup{} ## v_analyzer -https://github.com/v-analyzer/v-analyzer +https://github.com/vlang/v-analyzer V language server. -`v-analyzer` can be installed by following the instructions [here](https://github.com/v-analyzer/v-analyzer#installation). +`v-analyzer` can be installed by following the instructions [here](https://github.com/vlang/v-analyzer#installation). @@ -13422,8 +13613,8 @@ Volar by default supports Vue 3 projects. Vue 2 projects need [additional configuration](https://github.com/vuejs/language-tools/tree/master/packages/vscode-vue#usage). **TypeScript support** -As of release 2.0.0, Volar no longer wraps around tsserver. For typescript -support, `tsserver` needs to be configured with the `@vue/typescript-plugin` +As of release 2.0.0, Volar no longer wraps around ts_ls. For typescript +support, `ts_ls` needs to be configured with the `@vue/typescript-plugin` plugin. **Take Over Mode** @@ -13665,7 +13856,7 @@ require'lspconfig'.wgsl_analyzer.setup{} ``` - `root_dir` : ```lua - root_pattern(".git" + root_pattern(".git") ``` - `settings` : ```lua @@ -13838,6 +14029,74 @@ require'lspconfig'.yls.setup{} ``` +## ziggy + +https://ziggy-lang.io/documentation/ziggy-lsp/ + +Language server for the Ziggy data serialization format + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ziggy.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ziggy", "lsp" } + ``` + - `filetypes` : + ```lua + { "ziggy" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ziggy_schema + +https://ziggy-lang.io/documentation/ziggy-lsp/ + +Language server for schema files of the Ziggy data serialization format + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ziggy_schema.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ziggy", "lsp", "--schema" } + ``` + - `filetypes` : + ```lua + { "ziggy_schema" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + ## zk https://github.com/mickael-menu/zk @@ -13852,6 +14111,7 @@ require'lspconfig'.zk.setup{} ``` **Commands:** - ZkIndex: ZkIndex +- ZkList: ZkList - ZkNew: ZkNew **Default values:** diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/doc/server_configurations.txt b/config/neovim/store/lazy-plugins/nvim-lspconfig/doc/server_configurations.txt index 476d85fa..f91a2c3f 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/doc/server_configurations.txt +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/doc/server_configurations.txt @@ -24,7 +24,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [ballerina](#ballerina) - [basedpyright](#basedpyright) - [bashls](#bashls) -- [bazelrc-lsp](#bazelrc-lsp) +- [bazelrc_lsp](#bazelrc_lsp) - [beancount](#beancount) - [bicep](#bicep) - [biome](#biome) @@ -60,6 +60,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [cucumber_language_server](#cucumber_language_server) - [custom_elements_ls](#custom_elements_ls) - [cypher_ls](#cypher_ls) +- [daedalus_ls](#daedalus_ls) - [dafny](#dafny) - [dagger](#dagger) - [dartls](#dartls) @@ -145,6 +146,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [jsonls](#jsonls) - [jsonnet_ls](#jsonnet_ls) - [julials](#julials) +- [kcl](#kcl) - [koka](#koka) - [kotlin_language_server](#kotlin_language_server) - [lean3ls](#lean3ls) @@ -253,6 +255,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [slint_lsp](#slint_lsp) - [smarty_ls](#smarty_ls) - [smithy_ls](#smithy_ls) +- [snakeskin_ls](#snakeskin_ls) - [snyk_ls](#snyk_ls) - [solang](#solang) - [solargraph](#solargraph) @@ -296,10 +299,11 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [thriftls](#thriftls) - [tilt_ls](#tilt_ls) - [tinymist](#tinymist) +- [ts_ls](#ts_ls) - [tsp_server](#tsp_server) -- [tsserver](#tsserver) - [ttags](#ttags) - [turtle_ls](#turtle_ls) +- [tvm_ffi_navigator](#tvm_ffi_navigator) - [twiggy_language_server](#twiggy_language_server) - [typeprof](#typeprof) - [typos_lsp](#typos_lsp) @@ -327,6 +331,8 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [yamlls](#yamlls) - [yang_lsp](#yang_lsp) - [yls](#yls) +- [ziggy](#ziggy) +- [ziggy_schema](#ziggy_schema) - [zk](#zk) - [zls](#zls) @@ -427,6 +433,13 @@ require'lspconfig'.als.setup{} ```lua { "ada_language_server" } ``` + - `deprecate` : + ```lua + { + to = "github.com/TamaMcGlinn/nvim-lspconfig-ada", + version = "0.2.0" + } + ``` - `filetypes` : ```lua { "ada" } @@ -1185,7 +1198,7 @@ require'lspconfig'.bashls.setup{} ``` -## bazelrc-lsp +## bazelrc_lsp https://github.com/salesforce-misc/bazelrc-lsp @@ -1205,7 +1218,7 @@ vim.filetype.add { **Snippet to enable the language server:** ```lua -require'lspconfig'.bazelrc-lsp.setup{} +require'lspconfig'.bazelrc_lsp.setup{} ``` @@ -1948,6 +1961,7 @@ https://clangd.llvm.org/installation.html require'lspconfig'.clangd.setup{} ``` **Commands:** +- ClangdShowSymbolInfo: Show symbol info - ClangdSwitchSourceHeader: Switch between source/header **Default values:** @@ -2608,6 +2622,45 @@ require'lspconfig'.cypher_ls.setup{} ``` +## daedalus_ls + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.daedalus_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "DaedalusLanguageServer" } + ``` + - `filetypes` : + ```lua + { "d" } + ``` + - `root_dir` : + ```lua + see source file + ``` + - `settings` : + ```lua + { + DaedalusLanguageServer = { + fileEncoding = "Windows-1252", + inlayHints = { + constants = true + }, + loglevel = "debug", + numParserThreads = 16, + srcFileEncoding = "Windows-1252" + } + } + ``` + + ## dafny Support for the Dafny language server. @@ -4237,7 +4290,7 @@ require'lspconfig'.foam_ls.setup{} ## fortls -https://github.com/gnikit/fortls +https://fortls.fortran-lang.org/index.html fortls is a Fortran Language Server, the server can be installed via pip @@ -4247,7 +4300,7 @@ pip install fortls Settings to the server can be passed either through the `cmd` option or through a local configuration file e.g. `.fortls`. For more information -see the `fortls` [documentation](https://gnikit.github.io/fortls/options.html). +see the `fortls` [documentation](https://fortls.fortran-lang.org/options.html). @@ -5237,9 +5290,20 @@ lspconfig.haxe_language_server.setup({ }) ``` -By default, an HXML compiler arguments file named `build.hxml` is expected in -your project's root directory. If your file is named something different, -specify it using the `init_options.displayArguments` setting. +By default, the language server is configured with the HXML compiler arguments +contained in the first `.hxml` file found in your project's root directory. +If you want to specify which one to use, set the `init_options.displayArguments` +setting: + +```lua +lspconfig.haxe_language_server.setup({ + -- ... + init_options = { + displayArguments = { "build.hxml" }, + }, +}) +``` + @@ -5260,13 +5324,15 @@ require'lspconfig'.haxe_language_server.setup{} ``` - `init_options` : ```lua - { - displayArguments = { "build.hxml" } - } + default value is set by on_new_config + ``` + - `on_new_config` : + ```lua + see source file ``` - `root_dir` : ```lua - root_pattern("*.hxml") + root_pattern("*.hxml", ".git") ``` - `settings` : ```lua @@ -5644,7 +5710,7 @@ require'lspconfig'.htmx.setup{} ``` - `filetypes` : ```lua - { "html", "templ" } + { "aspnetcorerazor", "astro", "astro-markdown", "blade", "clojure", "django-html", "htmldjango", "edge", "eelixir", "elixir", "ejs", "erb", "eruby", "gohtml", "gohtmltmpl", "haml", "handlebars", "hbs", "html", "htmlangular", "html-eex", "heex", "jade", "leaf", "liquid", "markdown", "mdx", "mustache", "njk", "nunjucks", "php", "razor", "slim", "twig", "javascript", "javascriptreact", "reason", "rescript", "typescript", "typescriptreact", "vue", "svelte", "templ" } ``` - `root_dir` : ```lua @@ -5714,7 +5780,7 @@ require'lspconfig'.hyprls.setup{} ``` - `filetypes` : ```lua - { "hyprlang", "*.hl", "hypr*.conf", ".config/hypr/*.conf" } + { "hyprlang" } ``` - `root_dir` : ```lua @@ -6098,7 +6164,7 @@ vscode-json-language-server, a language server for JSON and JSON schema npm i -g vscode-langservers-extracted ``` -Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. +`vscode-json-language-server` only provides completions when snippet support is enabled. If you use Neovim older than v0.10 you need to enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. ```lua --Enable (broadcasting) snippet capability for completion @@ -6234,6 +6300,36 @@ require'lspconfig'.julials.setup{} ``` +## kcl + +https://github.com/kcl-lang/kcl.nvim + +Language server for the KCL configuration and policy language. + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.kcl.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "kcl-language-server" } + ``` + - `filetypes` : + ```lua + { "kcl" } + ``` + - `root_dir` : + ```lua + root_pattern(".git") + ``` + + ## koka https://koka-lang.github.io/koka/doc/index.html @@ -6974,7 +7070,7 @@ require'lspconfig'.mesonlsp.setup{} ``` - `root_dir` : ```lua - util.root_pattern("meson_options.txt", "meson.options", ".git") + util.root_pattern("meson.build", "meson_options.txt", "meson.options", ".git") ``` @@ -9403,7 +9499,7 @@ require'lspconfig'.r_language_server.setup{} **Default values:** - `cmd` : ```lua - { "R", "--slave", "-e", "languageserver::run()" } + { "R", "--no-echo", "-e", "languageserver::run()" } ``` - `filetypes` : ```lua @@ -9745,7 +9841,21 @@ ReScript Language Server can be installed via npm: npm install -g @rescript/language-server ``` -See the init_options supported (see https://github.com/rescript-lang/rescript-vscode/tree/master/server/config.md): +See [package.json](https://github.com/rescript-lang/rescript-vscode/blob/master/package.json#L139) +for init_options supported. + +For example, in order to disable the `inlayHints` option: +```lua +require'lspconfig'.pylsp.setup{ + settings = { + rescript = { + settings = { + inlayHints = { enable = false }, + }, + }, + } +} +``` @@ -9768,7 +9878,21 @@ require'lspconfig'.rescriptls.setup{} ```lua { extensionConfiguration = { - askToStartBuild = false + allowBuiltInFormatter = true, + askToStartBuild = false, + cache = { + projectConfig = { + enabled = true + } + }, + codeLens = true, + incrementalTypechecking = { + acrossFiles = true, + enabled = true + }, + inlayHints = { + enable = true + } } } ``` @@ -10321,7 +10445,7 @@ require'lspconfig'.scheme_langserver.setup{} **Default values:** - `cmd` : ```lua - { "scheme-langserver" } + { "scheme-langserver", "~/.scheme-langserver.log", "enable", "disable" } ``` - `filetypes` : ```lua @@ -10660,6 +10784,38 @@ require'lspconfig'.smithy_ls.setup{} ``` +## snakeskin_ls + +https://www.npmjs.com/package/@snakeskin/cli + +`snakeskin cli` can be installed via `npm`: +```sh +npm install -g @snakeskin/cli +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.snakeskin_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "snakeskin-cli", "lsp", "--stdio" } + ``` + - `filetypes` : + ```lua + { "ss" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + ## snyk_ls https://github.com/snyk/snyk-ls @@ -11608,7 +11764,7 @@ require'lspconfig'.superhtml.setup{} https://github.com/sveltejs/language-tools/tree/master/packages/language-server -Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). +Note: assuming that [ts_ls](#ts_ls) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). `svelte-language-server` can be installed via `npm`: ```sh @@ -11746,7 +11902,7 @@ require'lspconfig'.swift_mesonls.setup{} ``` - `root_dir` : ```lua - util.root_pattern("meson_options.txt", "meson.options", ".git") + util.root_pattern("meson.build", "meson_options.txt", "meson.options", ".git") ``` @@ -11962,9 +12118,14 @@ https://github.com/teal-language/teal-language-server Install with: ``` -luarocks install --dev teal-language-server +luarocks install teal-language-server ``` +Optional Command Args: +* "--log-mode=by_date" - Enable logging in $HOME/.cache/teal-language-server. Log name will be date + pid of process +* "--log-mode=by_proj_path" - Enable logging in $HOME/.cache/teal-language-server. Log name will be project path + pid of process +* "--verbose=true" - Increases log level. Does nothing unless log-mode is set + **Snippet to enable the language server:** @@ -11984,7 +12145,7 @@ require'lspconfig'.teal_ls.setup{} ``` - `root_dir` : ```lua - root_pattern("tlconfig.lua", ".git") + root_pattern("tlconfig.lua") ``` @@ -12439,44 +12600,12 @@ require'lspconfig'.tinymist.setup{} ``` -## tsp_server - -https://github.com/microsoft/typespec - -The language server for TypeSpec, a language for defining cloud service APIs and shapes. - -`tsp-server` can be installed together with the typespec compiler via `npm`: -```sh -npm install -g @typespec/compiler -``` - - - -**Snippet to enable the language server:** -```lua -require'lspconfig'.tsp_server.setup{} -``` - - -**Default values:** - - `cmd` : - ```lua - { "tsp-server", "--stdio" } - ``` - - `filetypes` : - ```lua - { "typespec" } - ``` - - `root_dir` : - ```lua - util.root_pattern("tspconfig.yaml", ".git") - ``` - - -## tsserver +## ts_ls https://github.com/typescript-language-server/typescript-language-server +`ts_ls`, aka `typescript-language-server`, is a Language Server Protocol implementation for TypeScript wrapping `tsserver`. Note that `ts_ls` is not `tsserver`. + `typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: ```sh npm install -g typescript typescript-language-server @@ -12510,7 +12639,7 @@ adds Vue support to this language server. *IMPORTANT*: It is crucial to ensure that `@vue/typescript-plugin` and `volar `are of identical versions. ```lua -require'lspconfig'.tsserver.setup{ +require'lspconfig'.ts_ls.setup{ init_options = { plugins = { { @@ -12543,7 +12672,7 @@ require'lspconfig'.tsserver.setup{ **Snippet to enable the language server:** ```lua -require'lspconfig'.tsserver.setup{} +require'lspconfig'.ts_ls.setup{} ``` @@ -12572,6 +12701,40 @@ require'lspconfig'.tsserver.setup{} ``` +## tsp_server + +https://github.com/microsoft/typespec + +The language server for TypeSpec, a language for defining cloud service APIs and shapes. + +`tsp-server` can be installed together with the typespec compiler via `npm`: +```sh +npm install -g @typespec/compiler +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tsp_server.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "tsp-server", "--stdio" } + ``` + - `filetypes` : + ```lua + { "typespec" } + ``` + - `root_dir` : + ```lua + util.root_pattern("tspconfig.yaml", ".git") + ``` + + ## ttags https://github.com/npezza93/ttags @@ -12631,6 +12794,38 @@ require'lspconfig'.turtle_ls.setup{} ``` +## tvm_ffi_navigator + +https://github.com/tqchen/ffi-navigator + +The Language Server for FFI calls in TVM to be able jump between python and C++ + +FFI navigator can be installed with `pip install ffi-navigator`, buf for more details, please see +https://github.com/tqchen/ffi-navigator?tab=readme-ov-file#installation + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.tvm_ffi_navigator.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "python", "-m", "ffi_navigator.langserver" } + ``` + - `filetypes` : + ```lua + { "python", "cpp" } + ``` + - `root_dir` : + ```lua + see source file + ``` + + ## twiggy_language_server https://github.com/moetelo/twiggy @@ -12718,10 +12913,6 @@ require'lspconfig'.typos_lsp.setup{} ```lua { "typos-lsp" } ``` - - `filetypes` : - ```lua - { "*" } - ``` - `root_dir` : ```lua see source file @@ -12915,11 +13106,11 @@ require'lspconfig'.uvls.setup{} ## v_analyzer -https://github.com/v-analyzer/v-analyzer +https://github.com/vlang/v-analyzer V language server. -`v-analyzer` can be installed by following the instructions [here](https://github.com/v-analyzer/v-analyzer#installation). +`v-analyzer` can be installed by following the instructions [here](https://github.com/vlang/v-analyzer#installation). @@ -13422,8 +13613,8 @@ Volar by default supports Vue 3 projects. Vue 2 projects need [additional configuration](https://github.com/vuejs/language-tools/tree/master/packages/vscode-vue#usage). **TypeScript support** -As of release 2.0.0, Volar no longer wraps around tsserver. For typescript -support, `tsserver` needs to be configured with the `@vue/typescript-plugin` +As of release 2.0.0, Volar no longer wraps around ts_ls. For typescript +support, `ts_ls` needs to be configured with the `@vue/typescript-plugin` plugin. **Take Over Mode** @@ -13665,7 +13856,7 @@ require'lspconfig'.wgsl_analyzer.setup{} ``` - `root_dir` : ```lua - root_pattern(".git" + root_pattern(".git") ``` - `settings` : ```lua @@ -13838,6 +14029,74 @@ require'lspconfig'.yls.setup{} ``` +## ziggy + +https://ziggy-lang.io/documentation/ziggy-lsp/ + +Language server for the Ziggy data serialization format + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ziggy.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ziggy", "lsp" } + ``` + - `filetypes` : + ```lua + { "ziggy" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + +## ziggy_schema + +https://ziggy-lang.io/documentation/ziggy-lsp/ + +Language server for schema files of the Ziggy data serialization format + + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.ziggy_schema.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "ziggy", "lsp", "--schema" } + ``` + - `filetypes` : + ```lua + { "ziggy_schema" } + ``` + - `root_dir` : + ```lua + util.find_git_ancestor + ``` + - `single_file_support` : + ```lua + true + ``` + + ## zk https://github.com/mickael-menu/zk @@ -13852,6 +14111,7 @@ require'lspconfig'.zk.setup{} ``` **Commands:** - ZkIndex: ZkIndex +- ZkList: ZkList - ZkNew: ZkNew **Default values:** diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig.lua index 0823ec8d..b9012f87 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig.lua @@ -27,6 +27,10 @@ local function server_alias(name) to = 'lua_ls', version = '0.2.0', }, + tsserver = { + to = 'ts_ls', + version = '0.2.0', + }, } return aliases[name] diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/als.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/als.lua index 7d916adf..30e3227a 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/als.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/als.lua @@ -10,6 +10,10 @@ return { cmd = { bin_name }, filetypes = { 'ada' }, root_dir = util.root_pattern('Makefile', '.git', '*.gpr', '*.adc'), + deprecate = { + to = 'github.com/TamaMcGlinn/nvim-lspconfig-ada', + version = '0.2.0', + }, }, docs = { description = [[ diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/bazelrc-lsp.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/bazelrc_lsp.lua similarity index 100% rename from config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/bazelrc-lsp.lua rename to config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/bazelrc_lsp.lua diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/clangd.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/clangd.lua index 732f556c..d6cb0295 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/clangd.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/clangd.lua @@ -21,6 +21,31 @@ local function switch_source_header(bufnr) end end +local function symbol_info() + local bufnr = vim.api.nvim_get_current_buf() + local clangd_client = util.get_active_client_by_name(bufnr, 'clangd') + if not clangd_client or not clangd_client.supports_method 'textDocument/symbolInfo' then + return vim.notify('Clangd client not found', vim.log.levels.ERROR) + end + local params = vim.lsp.util.make_position_params() + clangd_client.request('textDocument/symbolInfo', params, function(err, res) + if err or #res == 0 then + -- Clangd always returns an error, there is not reason to parse it + return + end + local container = string.format('container: %s', res[1].containerName) ---@type string + local name = string.format('name: %s', res[1].name) ---@type string + vim.lsp.util.open_floating_preview({ name, container }, '', { + height = 2, + width = math.max(string.len(name), string.len(container)), + focusable = false, + focus = false, + border = require('lspconfig.ui.windows').default_options.border or 'single', + title = 'Symbol Info', + }) + end, bufnr) +end + local root_files = { '.clangd', '.clang-tidy', @@ -56,6 +81,12 @@ return { end, description = 'Switch between source/header', }, + ClangdShowSymbolInfo = { + function() + symbol_info() + end, + description = 'Show symbol info', + }, }, docs = { description = [[ diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/daedalus_ls.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/daedalus_ls.lua new file mode 100644 index 00000000..db3dc3ba --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/daedalus_ls.lua @@ -0,0 +1,28 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'Gothic.src', + 'Camera.src', + 'Menu.src', + 'Music.src', + 'ParticleFX.src', + 'SFX.src', + 'VisualFX.src', +} + +return { + default_config = { + cmd = { 'DaedalusLanguageServer' }, + filetypes = { 'd' }, + root_dir = util.root_pattern(unpack(root_files)), + settings = { + DaedalusLanguageServer = { + loglevel = 'debug', + inlayHints = { constants = true }, + numParserThreads = 16, + fileEncoding = 'Windows-1252', + srcFileEncoding = 'Windows-1252', + }, + }, + }, +} diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/fortls.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/fortls.lua index 41a00051..24938668 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/fortls.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/fortls.lua @@ -17,7 +17,7 @@ return { }, docs = { description = [[ -https://github.com/gnikit/fortls +https://fortls.fortran-lang.org/index.html fortls is a Fortran Language Server, the server can be installed via pip @@ -27,7 +27,7 @@ pip install fortls Settings to the server can be passed either through the `cmd` option or through a local configuration file e.g. `.fortls`. For more information -see the `fortls` [documentation](https://gnikit.github.io/fortls/options.html). +see the `fortls` [documentation](https://fortls.fortran-lang.org/options.html). ]], default_config = { root_dir = [[root_pattern(".fortls")]], diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/haxe_language_server.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/haxe_language_server.lua index 1589c7b0..4412238d 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/haxe_language_server.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/haxe_language_server.lua @@ -1,18 +1,33 @@ local util = require 'lspconfig.util' +local function find_hxml(path) + return vim.fs.find(function(name) + return name:match '.hxml$' + end, { path = path, type = 'file' }) +end + return { default_config = { cmd = { 'haxe-language-server' }, filetypes = { 'haxe' }, - root_dir = util.root_pattern '*.hxml', + root_dir = util.root_pattern('*.hxml', '.git'), settings = { haxe = { executable = 'haxe', }, }, - init_options = { - displayArguments = { 'build.hxml' }, - }, + init_options = {}, + on_new_config = function(new_config, new_root_dir) + if new_config.init_options.displayArguments then + return + end + + local hxml = find_hxml(new_root_dir)[1] + if hxml then + vim.notify('Using HXML: ' .. hxml) + new_config.init_options.displayArguments = { hxml } + end + end, }, docs = { description = [[ @@ -36,12 +51,24 @@ lspconfig.haxe_language_server.setup({ }) ``` -By default, an HXML compiler arguments file named `build.hxml` is expected in -your project's root directory. If your file is named something different, -specify it using the `init_options.displayArguments` setting. +By default, the language server is configured with the HXML compiler arguments +contained in the first `.hxml` file found in your project's root directory. +If you want to specify which one to use, set the `init_options.displayArguments` +setting: + +```lua +lspconfig.haxe_language_server.setup({ + -- ... + init_options = { + displayArguments = { "build.hxml" }, + }, +}) +``` + ]], default_config = { - root_dir = [[root_pattern("*.hxml")]], + root_dir = [[root_pattern("*.hxml", ".git")]], + init_options = 'default value is set by on_new_config', }, }, } diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/htmx.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/htmx.lua index 26611b71..fe7e1de5 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/htmx.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/htmx.lua @@ -3,7 +3,54 @@ local util = require 'lspconfig.util' return { default_config = { cmd = { 'htmx-lsp' }, - filetypes = { 'html', 'templ' }, + filetypes = { -- filetypes copied and adjusted from tailwindcss-intellisense + -- html + 'aspnetcorerazor', + 'astro', + 'astro-markdown', + 'blade', + 'clojure', + 'django-html', + 'htmldjango', + 'edge', + 'eelixir', -- vim ft + 'elixir', + 'ejs', + 'erb', + 'eruby', -- vim ft + 'gohtml', + 'gohtmltmpl', + 'haml', + 'handlebars', + 'hbs', + 'html', + 'htmlangular', + 'html-eex', + 'heex', + 'jade', + 'leaf', + 'liquid', + 'markdown', + 'mdx', + 'mustache', + 'njk', + 'nunjucks', + 'php', + 'razor', + 'slim', + 'twig', + -- js + 'javascript', + 'javascriptreact', + 'reason', + 'rescript', + 'typescript', + 'typescriptreact', + -- mixed + 'vue', + 'svelte', + 'templ', + }, single_file_support = true, root_dir = function(fname) return util.find_git_ancestor(fname) diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/hyprls.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/hyprls.lua index f967127c..b1327f2c 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/hyprls.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/hyprls.lua @@ -3,7 +3,7 @@ local util = require 'lspconfig.util' return { default_config = { cmd = { 'hyprls', '--stdio' }, - filetypes = { 'hyprlang', '*.hl', 'hypr*.conf', '.config/hypr/*.conf' }, + filetypes = { 'hyprlang' }, root_dir = util.find_git_ancestor, single_file_support = true, }, diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/jsonls.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/jsonls.lua index b6299599..b0780496 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/jsonls.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/jsonls.lua @@ -22,7 +22,7 @@ vscode-json-language-server, a language server for JSON and JSON schema npm i -g vscode-langservers-extracted ``` -Neovim does not currently include built-in snippets. `vscode-json-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. +`vscode-json-language-server` only provides completions when snippet support is enabled. If you use Neovim older than v0.10 you need to enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. ```lua --Enable (broadcasting) snippet capability for completion diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/kcl.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/kcl.lua new file mode 100644 index 00000000..0e241ab8 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/kcl.lua @@ -0,0 +1,20 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'kcl-language-server' }, + filetypes = { 'kcl' }, + root_dir = util.root_pattern '.git', + }, + docs = { + description = [[ +https://github.com/kcl-lang/kcl.nvim + +Language server for the KCL configuration and policy language. + +]], + default_config = { + root_dir = [[root_pattern(".git")]], + }, + }, +} diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/mesonlsp.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/mesonlsp.lua index 29eaef9b..1e45ef8b 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/mesonlsp.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/mesonlsp.lua @@ -4,7 +4,7 @@ return { default_config = { cmd = { 'mesonlsp', '--lsp' }, filetypes = { 'meson' }, - root_dir = util.root_pattern('meson_options.txt', 'meson.options', '.git'), + root_dir = util.root_pattern('meson.build', 'meson_options.txt', 'meson.options', '.git'), }, docs = { description = [[ @@ -13,7 +13,7 @@ https://github.com/JCWasmx86/mesonlsp An unofficial, unendorsed language server for meson written in C++ ]], default_config = { - root_dir = [[util.root_pattern("meson_options.txt", "meson.options", ".git")]], + root_dir = [[util.root_pattern("meson.build", "meson_options.txt", "meson.options", ".git")]], }, }, } diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/r_language_server.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/r_language_server.lua index bdbab842..bd315390 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/r_language_server.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/r_language_server.lua @@ -2,7 +2,7 @@ local util = require 'lspconfig.util' return { default_config = { - cmd = { 'R', '--slave', '-e', 'languageserver::run()' }, + cmd = { 'R', '--no-echo', '-e', 'languageserver::run()' }, filetypes = { 'r', 'rmd' }, root_dir = function(fname) return util.find_git_ancestor(fname) or vim.loop.os_homedir() diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/rescriptls.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/rescriptls.lua index 882a1100..f7869b34 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/rescriptls.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/rescriptls.lua @@ -8,7 +8,17 @@ return { settings = {}, init_options = { extensionConfiguration = { + -- buggy, prompts much too often, superseded by incrementalTypechecking, below askToStartBuild = false, + + allowBuiltInFormatter = true, -- lower latency + incrementalTypechecking = { -- removes the need for external build process + enabled = true, + acrossFiles = true, + }, + cache = { projectConfig = { enabled = true } }, -- speed up latency dramatically + codeLens = true, + inlayHints = { enable = true }, }, }, }, @@ -21,7 +31,21 @@ ReScript Language Server can be installed via npm: npm install -g @rescript/language-server ``` -See the init_options supported (see https://github.com/rescript-lang/rescript-vscode/tree/master/server/config.md): +See [package.json](https://github.com/rescript-lang/rescript-vscode/blob/master/package.json#L139) +for init_options supported. + +For example, in order to disable the `inlayHints` option: +```lua +require'lspconfig'.pylsp.setup{ + settings = { + rescript = { + settings = { + inlayHints = { enable = false }, + }, + }, + } +} +``` ]], root_dir = [[root_pattern('bsconfig.json', 'rescript.json', '.git')]], }, diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/scheme_langserver.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/scheme_langserver.lua index 0eaaa289..ceaa9320 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/scheme_langserver.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/scheme_langserver.lua @@ -1,6 +1,5 @@ local util = require 'lspconfig.util' -local bin_name = 'scheme-langserver' -local cmd = { bin_name } +local cmd = { 'scheme-langserver', '~/.scheme-langserver.log', 'enable', 'disable' } local root_files = { 'Akku.manifest', '.git', diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/snakeskin_ls.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/snakeskin_ls.lua new file mode 100644 index 00000000..5fd96386 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/snakeskin_ls.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'snakeskin-cli', 'lsp', '--stdio' }, + filetypes = { 'ss' }, + root_dir = util.root_pattern 'package.json', + }, + docs = { + description = [[ +https://www.npmjs.com/package/@snakeskin/cli + +`snakeskin cli` can be installed via `npm`: +```sh +npm install -g @snakeskin/cli +``` +]], + }, +} diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/svelte.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/svelte.lua index a08bb954..edaa740d 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/svelte.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/svelte.lua @@ -10,7 +10,7 @@ return { description = [[ https://github.com/sveltejs/language-tools/tree/master/packages/language-server -Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). +Note: assuming that [ts_ls](#ts_ls) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage). `svelte-language-server` can be installed via `npm`: ```sh diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/swift_mesonls.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/swift_mesonls.lua index 5197f73a..4692e669 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/swift_mesonls.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/swift_mesonls.lua @@ -4,7 +4,7 @@ return { default_config = { cmd = { 'Swift-MesonLSP', '--lsp' }, filetypes = { 'meson' }, - root_dir = util.root_pattern('meson_options.txt', 'meson.options', '.git'), + root_dir = util.root_pattern('meson.build', 'meson_options.txt', 'meson.options', '.git'), }, docs = { description = [[ @@ -13,7 +13,7 @@ https://github.com/JCWasmx86/Swift-MesonLSP Meson language server written in Swift ]], default_config = { - root_dir = [[util.root_pattern("meson_options.txt", "meson.options", ".git")]], + root_dir = [[util.root_pattern("meson.build", "meson_options.txt", "meson.options", ".git")]], }, }, } diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/taplo.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/taplo.lua index e1a93530..06d6125c 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/taplo.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/taplo.lua @@ -4,9 +4,7 @@ return { default_config = { cmd = { 'taplo', 'lsp', 'stdio' }, filetypes = { 'toml' }, - root_dir = function(fname) - return util.root_pattern '*.toml'(fname) or util.find_git_ancestor(fname) - end, + root_dir = util.find_git_ancestor, single_file_support = true, }, docs = { diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/teal_ls.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/teal_ls.lua index b554adda..04ba9381 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/teal_ls.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/teal_ls.lua @@ -4,14 +4,11 @@ return { default_config = { cmd = { 'teal-language-server', - -- use this to enable logging in /tmp/teal-language-server.log - -- "logging=on", }, filetypes = { 'teal', - -- "lua", -- Also works for lua, but you may get type errors that cannot be resolved within lua itself }, - root_dir = util.root_pattern('tlconfig.lua', '.git'), + root_dir = util.root_pattern 'tlconfig.lua', }, docs = { description = [[ @@ -19,11 +16,16 @@ https://github.com/teal-language/teal-language-server Install with: ``` -luarocks install --dev teal-language-server +luarocks install teal-language-server ``` + +Optional Command Args: +* "--log-mode=by_date" - Enable logging in $HOME/.cache/teal-language-server. Log name will be date + pid of process +* "--log-mode=by_proj_path" - Enable logging in $HOME/.cache/teal-language-server. Log name will be project path + pid of process +* "--verbose=true" - Increases log level. Does nothing unless log-mode is set ]], default_config = { - root_dir = [[root_pattern("tlconfig.lua", ".git")]], + root_dir = [[root_pattern("tlconfig.lua")]], }, }, } diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/texlab.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/texlab.lua index 7b079d27..7f039f52 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/texlab.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/texlab.lua @@ -14,16 +14,11 @@ local texlab_forward_status = { [3] = 'Unconfigured', } -local function buf_build(bufnr) - bufnr = util.validate_bufnr(bufnr) +local function buf_build() + local bufnr = vim.api.nvim_get_current_buf() local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') - local pos = vim.api.nvim_win_get_cursor(0) - local params = { - textDocument = { uri = vim.uri_from_bufnr(bufnr) }, - position = { line = pos[1] - 1, character = pos[2] }, - } if texlab_client then - texlab_client.request('textDocument/build', params, function(err, result) + texlab_client.request('textDocument/build', vim.lsp.util.make_position_params(), function(err, result) if err then error(tostring(err)) end @@ -37,16 +32,11 @@ local function buf_build(bufnr) end end -local function buf_search(bufnr) - bufnr = util.validate_bufnr(bufnr) +local function buf_search() + local bufnr = vim.api.nvim_get_current_buf() local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') - local pos = vim.api.nvim_win_get_cursor(0) - local params = { - textDocument = { uri = vim.uri_from_bufnr(bufnr) }, - position = { line = pos[1] - 1, character = pos[2] }, - } if texlab_client then - texlab_client.request('textDocument/forwardSearch', params, function(err, result) + texlab_client.request('textDocument/forwardSearch', vim.lsp.util.make_position_params(), function(err, result) if err then error(tostring(err)) end @@ -60,8 +50,8 @@ local function buf_search(bufnr) end end -local function buf_cancel_build(bufnr) - bufnr = util.validate_bufnr(bufnr) +local function buf_cancel_build() + local bufnr = vim.api.nvim_get_current_buf() if not util.get_active_client_by_name(bufnr, 'texlab') then return vim.notify('Texlab client not found', vim.log.levels.ERROR) end @@ -69,8 +59,8 @@ local function buf_cancel_build(bufnr) vim.notify('Build cancelled', vim.log.levels.INFO) end -local function dependency_graph(bufnr) - bufnr = util.validate_bufnr(bufnr) +local function dependency_graph() + local bufnr = vim.api.nvim_get_current_buf() local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') if not texlab_client then return vim.notify('Texlab client not found', vim.log.levels.ERROR) @@ -83,8 +73,8 @@ local function dependency_graph(bufnr) end, 0) end -local function cleanArtifacts(bufnr) - bufnr = util.validate_bufnr(bufnr) +local function cleanArtifacts() + local bufnr = vim.api.nvim_get_current_buf() if not util.get_active_client_by_name(bufnr, 'texlab') then return vim.notify('Texlab client not found', vim.log.levels.ERROR) end @@ -95,8 +85,8 @@ local function cleanArtifacts(bufnr) vim.notify('Artifacts cleaned successfully', vim.log.levels.INFO) end -local function cleanAuxiliary(bufnr) - bufnr = util.validate_bufnr(bufnr) +local function cleanAuxiliary() + local bufnr = vim.api.nvim_get_current_buf() if not util.get_active_client_by_name(bufnr, 'texlab') then return vim.notify('Texlab client not found', vim.log.levels.ERROR) end @@ -107,31 +97,41 @@ local function cleanAuxiliary(bufnr) vim.notify('Auxiliary files cleaned successfully', vim.log.levels.INFO) end -local function buf_find_envs(bufnr) - bufnr = util.validate_bufnr(bufnr) +local function buf_find_envs() + local bufnr = vim.api.nvim_get_current_buf() local texlab_client = util.get_active_client_by_name(bufnr, 'texlab') if not texlab_client then return vim.notify('Texlab client not found', vim.log.levels.ERROR) end - local pos = vim.api.nvim_win_get_cursor(0) texlab_client.request('workspace/executeCommand', { command = 'texlab.findEnvironments', - arguments = { - { - textDocument = { uri = vim.uri_from_bufnr(bufnr) }, - position = { line = pos[1] - 1, character = pos[2] }, - }, - }, + arguments = { vim.lsp.util.make_position_params() }, }, function(err, result) if err then return vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR) end - return vim.notify('The environments are:\n' .. vim.inspect(result), vim.log.levels.INFO) + local env_names = {} + local max_length = 1 + for _, env in ipairs(result) do + table.insert(env_names, env.name.text) + max_length = math.max(max_length, string.len(env.name.text)) + end + for i, name in ipairs(env_names) do + env_names[i] = string.rep(' ', i - 1) .. name + end + vim.lsp.util.open_floating_preview(env_names, '', { + height = #env_names, + width = math.max((max_length + #env_names - 1), (string.len 'Environments')), + focusable = false, + focus = false, + border = require('lspconfig.ui.windows').default_options.border or 'single', + title = 'Environments', + }) end, bufnr) end -local function buf_change_env(bufnr) - bufnr = util.validate_bufnr(bufnr) +local function buf_change_env() + local bufnr = vim.api.nvim_get_current_buf() if not util.get_active_client_by_name(bufnr, 'texlab') then return vim.notify('Texlab client not found', vim.log.levels.ERROR) end @@ -152,18 +152,6 @@ local function buf_change_env(bufnr) } end --- bufnr isn't actually required here, but we need a valid buffer in order to --- be able to find the client for buf_request. --- TODO find a client by looking through buffers for a valid client? --- local function build_cancel_all(bufnr) --- bufnr = util.validate_bufnr(bufnr) --- local params = { token = "texlab-build-*" } --- lsp.buf_request(bufnr, 'window/progress/cancel', params, function(err, method, result, client_id) --- if err then error(tostring(err)) end --- print("Cancel result", vim.inspect(result)) --- end) --- end - return { default_config = { cmd = { 'texlab' }, @@ -202,49 +190,49 @@ return { commands = { TexlabBuild = { function() - buf_build(0) + buf_build() end, description = 'Build the current buffer', }, TexlabForward = { function() - buf_search(0) + buf_search() end, description = 'Forward search from current position', }, TexlabCancelBuild = { function() - buf_cancel_build(0) + buf_cancel_build() end, description = 'Cancel the current build', }, TexlabDependencyGraph = { function() - dependency_graph(0) + dependency_graph() end, description = 'Show the dependency graph', }, TexlabCleanArtifacts = { function() - cleanArtifacts(0) + cleanArtifacts() end, description = 'Clean the artifacts', }, TexlabCleanAuxiliary = { function() - cleanAuxiliary(0) + cleanAuxiliary() end, description = 'Clean the auxiliary files', }, TexlabFindEnvironments = { function() - buf_find_envs(0) + buf_find_envs() end, description = 'Find the environments at current position', }, TexlabChangeEnvironment = { function() - buf_change_env(0) + buf_change_env() end, description = 'Change the environment at current position', }, diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/tsserver.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ts_ls.lua similarity index 91% rename from config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/tsserver.lua rename to config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ts_ls.lua index 6220e7f2..38a7c800 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/tsserver.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ts_ls.lua @@ -19,6 +19,8 @@ return { description = [[ https://github.com/typescript-language-server/typescript-language-server +`ts_ls`, aka `typescript-language-server`, is a Language Server Protocol implementation for TypeScript wrapping `tsserver`. Note that `ts_ls` is not `tsserver`. + `typescript-language-server` depends on `typescript`. Both packages can be installed via `npm`: ```sh npm install -g typescript typescript-language-server @@ -52,7 +54,7 @@ adds Vue support to this language server. *IMPORTANT*: It is crucial to ensure that `@vue/typescript-plugin` and `volar `are of identical versions. ```lua -require'lspconfig'.tsserver.setup{ +require'lspconfig'.ts_ls.setup{ init_options = { plugins = { { diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/tvm_ffi_navigator.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/tvm_ffi_navigator.lua new file mode 100644 index 00000000..6abd3b8d --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/tvm_ffi_navigator.lua @@ -0,0 +1,19 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'python', '-m', 'ffi_navigator.langserver' }, + filetypes = { 'python', 'cpp' }, + root_dir = util.root_pattern('pyproject.toml', '.git'), + }, + docs = { + description = [[ +https://github.com/tqchen/ffi-navigator + +The Language Server for FFI calls in TVM to be able jump between python and C++ + +FFI navigator can be installed with `pip install ffi-navigator`, buf for more details, please see +https://github.com/tqchen/ffi-navigator?tab=readme-ov-file#installation +]], + }, +} diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/typos_lsp.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/typos_lsp.lua index e5cca497..3fb58b25 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/typos_lsp.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/typos_lsp.lua @@ -3,7 +3,6 @@ local util = require 'lspconfig.util' return { default_config = { cmd = { 'typos-lsp' }, - filetypes = { '*' }, root_dir = util.root_pattern('typos.toml', '_typos.toml', '.typos.toml'), single_file_support = true, settings = {}, diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/v_analyzer.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/v_analyzer.lua index d3892593..d6b7e273 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/v_analyzer.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/v_analyzer.lua @@ -8,11 +8,11 @@ return { }, docs = { description = [[ -https://github.com/v-analyzer/v-analyzer +https://github.com/vlang/v-analyzer V language server. -`v-analyzer` can be installed by following the instructions [here](https://github.com/v-analyzer/v-analyzer#installation). +`v-analyzer` can be installed by following the instructions [here](https://github.com/vlang/v-analyzer#installation). ]], default_config = { root_dir = [[root_pattern("v.mod", ".git")]], diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/volar.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/volar.lua index 4875b1ff..888cd165 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/volar.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/volar.lua @@ -44,8 +44,8 @@ Volar by default supports Vue 3 projects. Vue 2 projects need [additional configuration](https://github.com/vuejs/language-tools/tree/master/packages/vscode-vue#usage). **TypeScript support** -As of release 2.0.0, Volar no longer wraps around tsserver. For typescript -support, `tsserver` needs to be configured with the `@vue/typescript-plugin` +As of release 2.0.0, Volar no longer wraps around ts_ls. For typescript +support, `ts_ls` needs to be configured with the `@vue/typescript-plugin` plugin. **Take Over Mode** diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/wgsl_analyzer.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/wgsl_analyzer.lua index cf8913df..2325cc6e 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/wgsl_analyzer.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/wgsl_analyzer.lua @@ -17,7 +17,7 @@ cargo install --git https://github.com/wgsl-analyzer/wgsl-analyzer wgsl_analyzer ``` ]], default_config = { - root_dir = [[root_pattern(".git"]], + root_dir = [[root_pattern(".git")]], }, }, } diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ziggy.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ziggy.lua new file mode 100644 index 00000000..4ca58fb3 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ziggy.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ziggy', 'lsp' }, + filetypes = { 'ziggy' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://ziggy-lang.io/documentation/ziggy-lsp/ + +Language server for the Ziggy data serialization format + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ziggy_schema.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ziggy_schema.lua new file mode 100644 index 00000000..2bd01cc8 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/ziggy_schema.lua @@ -0,0 +1,21 @@ +local util = require 'lspconfig.util' + +return { + default_config = { + cmd = { 'ziggy', 'lsp', '--schema' }, + filetypes = { 'ziggy_schema' }, + root_dir = util.find_git_ancestor, + single_file_support = true, + }, + docs = { + description = [[ +https://ziggy-lang.io/documentation/ziggy-lsp/ + +Language server for schema files of the Ziggy data serialization format + +]], + default_config = { + root_dir = [[util.find_git_ancestor]], + }, + }, +} diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/zk.lua b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/zk.lua index e7065282..57a1ea1a 100644 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/zk.lua +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/lua/lspconfig/server_configurations/zk.lua @@ -1,5 +1,13 @@ local util = require 'lspconfig.util' +local function find_zk_root(startpath) + for dir in vim.fs.parents(startpath) do + if vim.fn.isdirectory(vim.fs.joinpath(dir, '.zk')) == 1 then + return dir + end + end +end + return { default_config = { cmd = { 'zk', 'lsp' }, @@ -16,6 +24,29 @@ return { end, description = 'ZkIndex', }, + ZkList = { + function() + local bufpath = vim.api.nvim_buf_get_name(0) + local root = find_zk_root(bufpath) + + vim.lsp.buf_request(0, 'workspace/executeCommand', { + command = 'zk.list', + arguments = { root, { select = { 'path' } } }, + }, function(_, result, _, _) + if not result then + return + end + local paths = vim.tbl_map(function(item) + return item.path + end, result) + vim.ui.select(paths, {}, function(choice) + vim.cmd('edit ' .. choice) + end) + end) + end, + + description = 'ZkList', + }, ZkNew = { function(...) vim.lsp.buf_request(0, 'workspace/executeCommand', { diff --git a/config/neovim/store/lazy-plugins/nvim-lspconfig/scripts/docgen.sh b/config/neovim/store/lazy-plugins/nvim-lspconfig/scripts/docgen.sh index d8a05aeb..d507e8e0 100755 --- a/config/neovim/store/lazy-plugins/nvim-lspconfig/scripts/docgen.sh +++ b/config/neovim/store/lazy-plugins/nvim-lspconfig/scripts/docgen.sh @@ -1,2 +1,2 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/sh +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/sh exec nvim -u NONE -E -R --headless +'set rtp+=$PWD' +'luafile scripts/docgen.lua' +q diff --git a/config/neovim/store/lazy-plugins/nvim-notify/scripts/docgen b/config/neovim/store/lazy-plugins/nvim-notify/scripts/docgen index 56580e88..68667cfc 100755 --- a/config/neovim/store/lazy-plugins/nvim-notify/scripts/docgen +++ b/config/neovim/store/lazy-plugins/nvim-notify/scripts/docgen @@ -1,3 +1,3 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash nvim --headless -c "luafile ./scripts/gendocs.lua" -c 'qa' diff --git a/config/neovim/store/lazy-plugins/nvim-notify/scripts/style b/config/neovim/store/lazy-plugins/nvim-notify/scripts/style index f3d846da..6d19dc40 100755 --- a/config/neovim/store/lazy-plugins/nvim-notify/scripts/style +++ b/config/neovim/store/lazy-plugins/nvim-notify/scripts/style @@ -1,3 +1,3 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash stylua lua tests diff --git a/config/neovim/store/lazy-plugins/nvim-notify/scripts/test b/config/neovim/store/lazy-plugins/nvim-notify/scripts/test index ee98c893..91355033 100755 --- a/config/neovim/store/lazy-plugins/nvim-notify/scripts/test +++ b/config/neovim/store/lazy-plugins/nvim-notify/scripts/test @@ -1,4 +1,4 @@ -#!/nix/store/4bj2kxdm1462fzcc2i2s4dn33g2angcc-bash-5.2p32/bin/bash +#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash tempfile=".test_output.tmp" if [[ -n $1 ]]; then diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/.github/CODEOWNERS b/config/neovim/store/lazy-plugins/nvim-treesitter/.github/CODEOWNERS deleted file mode 100644 index 8fcb7cd9..00000000 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/.github/CODEOWNERS +++ /dev/null @@ -1,7 +0,0 @@ -/lua/nvim-treesitter/textobjects/ @theHamsta -/lua/nvim-treesitter/incremental_selection.lua @theHamsta - -/lua/nvim-treesitter/fold.lua @vigoux -/lua/nvim-treesitter/highlight.lua @vigoux - -/lua/nvim-treesitter/refactor/ @steelsojka diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/lint.yml b/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/lint.yml index 7123332b..cd0e5198 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/lint.yml +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/lint.yml @@ -27,7 +27,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Lint with stylua - uses: JohnnyMorganz/stylua-action@v3 + uses: JohnnyMorganz/stylua-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} version: latest diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/update-lockfile.yml b/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/update-lockfile.yml index 8d721fa3..38aab1cf 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/update-lockfile.yml +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/update-lockfile.yml @@ -31,7 +31,7 @@ jobs: - name: Update parsers env: - SKIP_LOCKFILE_UPDATE_FOR_LANGS: "javascript" + SKIP_LOCKFILE_UPDATE_FOR_LANGS: "" run: | cp lockfile.json /tmp/old_lockfile.json nvim -l scripts/write-lockfile.lua @@ -42,10 +42,10 @@ jobs: echo "UPDATED_PARSERS=$UPDATED_PARSERS" >> $GITHUB_ENV - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: token: ${{ steps.app-token.outputs.token }} - author: "nvim-treesitter-bot[bot] <157957100+nvim-treesitter-bot[bot]@users.noreply.github.com>" + sign-commits: true commit-message: "bot(lockfile): update ${{ env.UPDATED_PARSERS }}" title: "Update lockfile.json: ${{ env.UPDATED_PARSERS }}" body: "[beep boop](https://github.com/peter-evans/create-pull-request)" diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/update-readme.yml b/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/update-readme.yml index 44f10a42..a3fa018e 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/update-readme.yml +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/.github/workflows/update-readme.yml @@ -30,10 +30,10 @@ jobs: nvim -l scripts/update-readme.lua || echo 'Needs update' - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: token: ${{ steps.app-token.outputs.token }} - author: "nvim-treesitter-bot[bot] <157957100+nvim-treesitter-bot[bot]@users.noreply.github.com>" + sign-commits: true commit-message: "bot(readme): update" title: Update README body: "[beep boop](https://github.com/peter-evans/create-pull-request)" diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/README.md b/config/neovim/store/lazy-plugins/nvim-treesitter/README.md index 6e50e6be..a953df38 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/README.md +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/README.md @@ -176,7 +176,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [ada](https://github.com/briot/tree-sitter-ada) (maintained by @briot) - [x] [agda](https://github.com/tree-sitter/tree-sitter-agda) (maintained by @Decodetalkers) - [x] [angular](https://github.com/dlvandenberg/tree-sitter-angular) (experimental, maintained by @dlvandenberg) -- [x] [apex](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber) +- [x] [apex](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland) - [x] [arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) (maintained by @ObserverOfTime) - [x] [asm](https://github.com/RubixDev/tree-sitter-asm) (maintained by @RubixDev) - [x] [astro](https://github.com/virchau13/tree-sitter-astro) (maintained by @virchau13) @@ -241,6 +241,8 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [fsh](https://github.com/mgramigna/tree-sitter-fsh) (maintained by @mgramigna) - [x] [func](https://github.com/amaanq/tree-sitter-func) (maintained by @amaanq) - [x] [fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) (maintained by @jirgn) +- [x] [GAP system](https://github.com/gap-system/tree-sitter-gap) (maintained by @reiniscirpons) +- [x] [GAP system test files](https://github.com/gap-system/tree-sitter-gaptst) (maintained by @reiniscirpons) - [x] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by @PrestonKnopp) - [x] [gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) (maintained by @godofavacyn) - [x] [git_config](https://github.com/the-mikedavis/tree-sitter-git-config) (maintained by @amaanq) @@ -249,7 +251,9 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) (maintained by @gbprod) - [x] [gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) (maintained by @theHamsta) - [x] [gleam](https://github.com/gleam-lang/tree-sitter-gleam) (maintained by @amaanq) -- [x] [Glimmer and Ember](https://github.com/alexlafroscia/tree-sitter-glimmer) (maintained by @NullVoxPopuli) +- [x] [Glimmer and Ember](https://github.com/ember-tooling/tree-sitter-glimmer) (maintained by @NullVoxPopuli) +- [x] [glimmer_javascript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript) (maintained by @NullVoxPopuli) +- [x] [glimmer_typescript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript) (maintained by @NullVoxPopuli) - [x] [glsl](https://github.com/theHamsta/tree-sitter-glsl) (maintained by @theHamsta) - [x] [GN (Generate Ninja)](https://github.com/amaanq/tree-sitter-gn) (maintained by @amaanq) - [x] [gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) (maintained by @dpezto) @@ -343,8 +347,8 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [passwd](https://github.com/ath3/tree-sitter-passwd) (maintained by @amaanq) - [x] [pem](https://github.com/ObserverOfTime/tree-sitter-pem) (maintained by @ObserverOfTime) - [x] [perl](https://github.com/tree-sitter-perl/tree-sitter-perl) (maintained by @RabbiVeesh, @LeoNerd) -- [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka) -- [x] [php_only](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka) +- [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka, @calebdw) +- [x] [php_only](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka, @calebdw) - [x] [phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) (experimental, maintained by @mikehaertl) - [x] [pioasm](https://github.com/leo60228/tree-sitter-pioasm) (maintained by @leo60228) - [x] [po](https://github.com/erasin/tree-sitter-po) (maintained by @amaanq) @@ -393,14 +397,15 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [scfg](https://github.com/rockorager/tree-sitter-scfg) (maintained by @WhyNotHugo) - [ ] [scheme](https://github.com/6cdh/tree-sitter-scheme) - [x] [scss](https://github.com/serenadeai/tree-sitter-scss) (maintained by @elianiva) +- [x] [sflog](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland) - [x] [slang](https://github.com/theHamsta/tree-sitter-slang) (experimental, maintained by @theHamsta) - [x] [slint](https://github.com/slint-ui/tree-sitter-slint) (maintained by @hunger) - [x] [smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) (maintained by @amaanq) - [x] [smithy](https://github.com/indoorvivants/tree-sitter-smithy) (maintained by @amaanq, @keynmol) - [ ] [snakemake](https://github.com/osthomas/tree-sitter-snakemake) (experimental) - [x] [solidity](https://github.com/JoranHonig/tree-sitter-solidity) (maintained by @amaanq) -- [x] [soql](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber) -- [x] [sosl](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber) +- [x] [soql](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland) +- [x] [sosl](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland) - [x] [sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) (maintained by @Sarrus1) - [x] [sparql](https://github.com/GordianDziwis/tree-sitter-sparql) (maintained by @GordianDziwis) - [x] [sql](https://github.com/derekstride/tree-sitter-sql) (maintained by @derekstride) @@ -463,7 +468,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [yang](https://github.com/Hubro/tree-sitter-yang) (maintained by @Hubro) - [x] [yuck](https://github.com/Philipp-M/tree-sitter-yuck) (maintained by @Philipp-M, @amaanq) - [x] [zathurarc](https://github.com/Freed-Wu/tree-sitter-zathurarc) (maintained by @Freed-Wu) -- [x] [zig](https://github.com/maxxnino/tree-sitter-zig) (maintained by @maxxnino) +- [x] [zig](https://github.com/tree-sitter-grammars/tree-sitter-zig) (maintained by @amaanq) For related information on the supported languages, including related plugins, see [this wiki page](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Supported-Languages-Information). diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/lockfile.json b/config/neovim/store/lazy-plugins/nvim-treesitter/lockfile.json index 29029960..f651dbba 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/lockfile.json +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/lockfile.json @@ -6,16 +6,16 @@ "revision": "d3dc807692e6bca671d4491b3bf5c67eeca8c016" }, "angular": { - "revision": "31182d43b062a350d4bd2449f2fc0d5654972be9" + "revision": "c473dbc54ca27f95d8928cfdb2a1a79300e16951" }, "apex": { - "revision": "c99ad4b16d112fea91745e3f1b769754239fdaba" + "revision": "602cc4b050ef1e14a69acc2ea094968bf928fa59" }, "arduino": { - "revision": "afb34b2c65f507932c5c6ddbf0d5a9ca6a772f2f" + "revision": "ce02903e3ae74c729e9415dc32c276447b1c8afd" }, "asm": { - "revision": "b0306e9bb2ebe01c6562f1aef265cc42ccc53070" + "revision": "55b2b913f1e71136027d6fce8212e760c64f3532" }, "astro": { "revision": "4be180759ec13651f72bacee65fa477c64222a1a" @@ -24,16 +24,16 @@ "revision": "1dec7e1af96c56924e3322cd85fdce15d0a31d00" }, "awk": { - "revision": "ba7472152d79a8c916550c80fdbfd5724d07a0c9" + "revision": "553fdc4afb3b603332c3f4baf50c711506f4e797" }, "bash": { - "revision": "2fbd860f802802ca76a6661ce025b3a3bca2d3ed" + "revision": "c8713e50f0bd77d080832fc61ad128bc8f2934e9" }, "bass": { "revision": "28dc7059722be090d04cd751aed915b2fee2f89a" }, "beancount": { - "revision": "384c55ede2a1f13e83d8e18dbef8f11304c379c2" + "revision": "01c0da29e0fc7130420a09d939ecc524e09b6ba6" }, "bibtex": { "revision": "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34" @@ -51,10 +51,10 @@ "revision": "4e60cf3c2e613625c06f6f85540b3631e2d06cd3" }, "c": { - "revision": "be23d2c9d8e5b550e713ef0f86126a248462ca6e" + "revision": "bc85948c0bec746ebe921f72d2296d47e17d4ea7" }, "c_sharp": { - "revision": "31a64b28292aac6adf44071e449fa03fb80eaf4e" + "revision": "fd7f7402db6e66afd70b402fb2e367b2d71c10d6" }, "cairo": { "revision": "6238f609bea233040fe927858156dee5515a0745" @@ -72,7 +72,7 @@ "revision": "69d7a8b0f7493b0dbb07d54e8fea96c5421e8a71" }, "comment": { - "revision": "5d8b29f6ef3bf64d59430dcfe76b31cc44b5abfd" + "revision": "3555706cef8b98d3e4c7379d7260548ff03ad363" }, "commonlisp": { "revision": "bf2a65b1c119898a1a17389e07f2a399c05cdc0c" @@ -87,16 +87,16 @@ "revision": "594289eadfec719198e560f9d7fd243c4db678d5" }, "cpp": { - "revision": "0b4aa47f07d958a49260aadc87e8474b03897c23" + "revision": "30f973c2244f0bff444186185f475c3bd76bc3a5" }, "css": { - "revision": "f6be52c3d1cdb1c5e4dd7d8bce0a57497f55d6af" + "revision": "a68fcd1e6b03118d1e92ffa45e7ab7a39d52d3f7" }, "csv": { "revision": "7eb7297823605392d2bbcc4c09b1cd18d6fa9529" }, "cuda": { - "revision": "7c97acb8398734d790c86210c53c320df61ff66b" + "revision": "635e8aa3747823a0c4e9660c07cef76fe8d3ef93" }, "cue": { "revision": "8a5f273bfa281c66354da562f2307c2d394b6c81" @@ -105,10 +105,10 @@ "revision": "ac584585a15c4cacd6cda8e6bfe7cb1ca7b3898e" }, "dart": { - "revision": "ac0bb849ccd1a923963af47573b5e396736ff582" + "revision": "9ac03bb2154316624fb4c41fe0f372a5f1597b43" }, "devicetree": { - "revision": "fb07e6044ffd36932c57a5be01ba5d6b8a9337bb" + "revision": "296b3c294a8bcfca6673296d99f9cd37049b8026" }, "dhall": { "revision": "affb6ee38d629c9296749767ab832d69bb0d9ea8" @@ -135,13 +135,13 @@ "revision": "809266ed1694d64dedc168a18893cc254e3edf7e" }, "earthfile": { - "revision": "b0a9bc5737340a9b80b489fe9ae93d7b2fe78cd7" + "revision": "1d637f2002bb8b22d4c08d26ad2bfbc22916f3ce" }, "ebnf": { "revision": "8e635b0b723c620774dfb8abf382a7f531894b40" }, "editorconfig": { - "revision": "fd0d64d2fc91eab903bed4c11ce280b62e46f16e" + "revision": "faf014c607f912ff666b20183d32a03dcfc3111d" }, "eds": { "revision": "0ad62cb635c2f4353359a88dec9e3a57bbf9f66d" @@ -150,7 +150,7 @@ "revision": "f742f2fe327463335e8671a87c0b9b396905d1d1" }, "elixir": { - "revision": "c7ae8b77e2749826dcf23df6514f08fdd68c66a3" + "revision": "2c6e93171477973b38de4b1d2be427cc99f990a6" }, "elm": { "revision": "09dbf221d7491dc8d8839616b27c21b9c025c457" @@ -162,10 +162,10 @@ "revision": "5e7210d945425b77f82cbaebc5af4dd3e1ad40f5" }, "embedded_template": { - "revision": "38d5004a797298dc42c85e7706c5ceac46a3f29f" + "revision": "62b0a6e45900a7dff7c37da95fec20a09968ba52" }, "erlang": { - "revision": "8f41b588fe38b981156651ef56b192ed3d158efd" + "revision": "0dfcdf18b35dd9cfcf92be42659794d07d819d88" }, "facility": { "revision": "2d037f2f2bf668737f72e6be6eda4b7918b68d86" @@ -192,7 +192,7 @@ "revision": "90189238385cf636b9ee99ce548b9e5b5e569d48" }, "fortran": { - "revision": "6b633433fb3f132f21250cf8e8be76d5a6389b7e" + "revision": "8f842945abefb76b9a68c0835619b37060b8f098" }, "fsh": { "revision": "fad2e175099a45efbc98f000cc196d3674cc45e0" @@ -203,6 +203,12 @@ "fusion": { "revision": "19db2f47ba4c3a0f6238d4ae0e2abfca16e61dd6" }, + "gap": { + "revision": "141b063335e85299bde3f61b4888d02d674a1abc" + }, + "gaptst": { + "revision": "e0723dc6136309b3d5904dad2c73ef71267428c1" + }, "gdscript": { "revision": "1f1e782fe2600f50ae57b53876505b8282388d77" }, @@ -225,10 +231,16 @@ "revision": "f4685bf11ac466dd278449bcfe5fd014e94aa504" }, "gleam": { - "revision": "426e67087fd62be5f4533581b5916b2cf010fb5b" + "revision": "9586f38658da115c90e2d01099c83479eb0eea99" }, "glimmer": { - "revision": "6b25d265c990139353e1f7f97baf84987ebb7bf0" + "revision": "da605af8c5999b43e6839b575eae5e6cafabb06f" + }, + "glimmer_javascript": { + "revision": "a260911201684f80cf815418b3771e6c39309f81" + }, + "glimmer_typescript": { + "revision": "9d018a0f93417e6951264a26093b89ee63df7315" }, "glsl": { "revision": "ddc3137a2d775aca93084ff997fa13cc1691058a" @@ -240,10 +252,10 @@ "revision": "3c895f5d9c0b3a3c7e02383766b462c21913c000" }, "go": { - "revision": "7ee8d928db5202f6831a78f8112fd693bf69f98b" + "revision": "81a11f8252998ee6b98d59e6da91fc307491e53d" }, "goctl": { - "revision": "f107937259c7ec4bb05f7e3d2c24b89ac36d4cc3" + "revision": "49c43532689fe1f53e8b9e009d0521cab02c432b" }, "godot_resource": { "revision": "2ffb90de47417018651fc3b970e5f6b67214dc9d" @@ -255,7 +267,7 @@ "revision": "e2ac513b2240c7ff1069ae33b2df29ce90777c11" }, "gotmpl": { - "revision": "9d3f6e526dd074b9edae9070b7bb778f00e87a5b" + "revision": "fd9e1c6647e5e9b23918d00d1e48710d0f703e19" }, "gowork": { "revision": "949a8a470559543857a62102c84700d291fc984c" @@ -267,7 +279,7 @@ "revision": "5e66e961eee421786bdda8495ed1db045e06b5fe" }, "groovy": { - "revision": "105ee343682b7eee86b38ec6858a269e16474a72" + "revision": "0d8884514fe10c4fa47527d9a0284d207f38ddea" }, "gstlaunch": { "revision": "549aef253fd38a53995cda1bf55c501174372bf7" @@ -279,7 +291,7 @@ "revision": "4af5d82cf9ec39f67cb1db5b7a9269d337406592" }, "haskell": { - "revision": "a50070d5bb5bd5c1281740a6102ecf1f4b0c4f19" + "revision": "558b997049fddcb07fc513528189c57d6129a260" }, "haskell_persistent": { "revision": "577259b4068b2c281c9ebf94c109bd50a74d5857" @@ -291,16 +303,16 @@ "revision": "6dd0303acf7138dd2b9b432a229e16539581c701" }, "helm": { - "revision": "9d3f6e526dd074b9edae9070b7bb778f00e87a5b" + "revision": "fd9e1c6647e5e9b23918d00d1e48710d0f703e19" }, "hjson": { "revision": "02fa3b79b3ff9a296066da6277adfc3f26cbc9e0" }, "hlsl": { - "revision": "81dbfa44a2e0f9e36d16f449fc792020e2f38426" + "revision": "cf432a7420eb71e9b40954aa829dcb8a9bf6b546" }, "hlsplaylist": { - "revision": "64f19029339e75d6762feae39e7878595860c980" + "revision": "3bfda9271e3adb08d35f47a2102fe957009e1c55" }, "hocon": { "revision": "c390f10519ae69fdb03b3e5764f5592fb6924bcc" @@ -309,13 +321,13 @@ "revision": "a24c5a39d1d7e993a8bee913c8e8b6a652ca5ae8" }, "html": { - "revision": "e4d834eb4918df01dcad5c27d1b15d56e3bd94cd" + "revision": "14bdaf0da9e26e2de9b30178c2242539d2b0b285" }, "htmldjango": { "revision": "ea71012d3fe14dd0b69f36be4f96bdfe9155ebae" }, "http": { - "revision": "5ae6c7cfa62a7d7325c26171a1de4f6b866702b5" + "revision": "7c68e1c8ce6eeef6bc4b749330c540dbbda5ba44" }, "hurl": { "revision": "fba6ed8db3a009b9e7d656511931b181a3ee5b08" @@ -324,10 +336,10 @@ "revision": "6858695eba0e63b9e0fceef081d291eb352abce8" }, "idl": { - "revision": "1a6683f6809f7bc630f10fcad7d9ac6471deb706" + "revision": "5573b295410201ed22771776b34d636900eba368" }, "ini": { - "revision": "87176e524f0a98f5be75fa44f4f0ff5c6eac069c" + "revision": "962568c9efa71d25720ab42c5d36e222626ef3a6" }, "inko": { "revision": "234c87be1dac20f766ddf6f486a7bde2a4bc5594" @@ -336,22 +348,22 @@ "revision": "9b2f9aec2106b94b4e099fe75e73ebd8ae707c04" }, "janet_simple": { - "revision": "ea842cb57a90865c8f50bcb4499de1a94860f3a4" + "revision": "12bfab7db8a5f5b1d774ef84b5831acd34936071" }, "java": { - "revision": "953abfc8bb3eb2f578e1f461edba4a9885f974b8" + "revision": "245b05c6ba900fa708242835f6168ef76f9d951e" }, "javascript": { - "revision": "12e45374422f6051648717be62f0ffc40a279ee2" + "revision": "b6f0624c1447bc209830b195999b78a56b10a579" }, "jq": { "revision": "13990f530e8e6709b7978503da9bc8701d366791" }, "jsdoc": { - "revision": "49fde205b59a1d9792efc21ee0b6d50bbd35ff14" + "revision": "bc09606fc786ead131a301e4b7524888f2d5c517" }, "json": { - "revision": "94f5c527b2965465956c2000ed6134dd24daf2a7" + "revision": "8bfdb43f47ad805bb1ce093203cfcbaa8ed2c571" }, "json5": { "revision": "ab0ba8229d639ec4f3fa5f674c9133477f4b77bd" @@ -360,10 +372,10 @@ "revision": "02b01653c8a1c198ae7287d566efa86a135b30d5" }, "jsonnet": { - "revision": "d34615fa12cc1d1cfc1f1f1a80acc9db80ee4596" + "revision": "ddd075f1939aed8147b7aa67f042eda3fce22790" }, "julia": { - "revision": "f1baa5f8e271109d01cc8ff7473c11df2d8a9aee" + "revision": "3520b57e418f734f582215181ecd926a6178c90f" }, "just": { "revision": "6648ac1c0cdadaec8ee8bcf9a4ca6ace5102cf21" @@ -375,7 +387,7 @@ "revision": "b37e3d58e5c5cf8d739b315d6114e02d42e66664" }, "kotlin": { - "revision": "8d9d372b09fa4c3735657c5fc2ad03e53a5f05f5" + "revision": "ec985672ff21f7fd7f835869d8021e8f87304bb4" }, "koto": { "revision": "d4109879ba1387d19095269a7473bd7d274ab848" @@ -387,19 +399,19 @@ "revision": "854a40e99f7c70258e522bdb8ab584ede6196e2e" }, "latex": { - "revision": "efe5afdbb59b70214e6d70db5197dc945d5b213e" + "revision": "90fd9894bebddce79f5b8041e7f82523364a619b" }, "ledger": { "revision": "8a841fb20ce683bfbb3469e6ba67f2851cfdf94a" }, "leo": { - "revision": "304611b5eaf53aca07459a0a03803b83b6dfd3b3" + "revision": "6ca11a96fc2cab51217e0cf4a2f9ed3ea63e28fb" }, "linkerscript": { "revision": "f99011a3554213b654985a4b0a65b3b032ec4621" }, "liquid": { - "revision": "7862a3424832c3a9d45eb21143b375837bd6573b" + "revision": "23ac814111e2b4b4b083e2c92219af2d5b74d13d" }, "liquidsoap": { "revision": "14feafa91630afb1ab9988cf9b738b7ea29f3f89" @@ -408,7 +420,7 @@ "revision": "1b96e58faf558ce057d4dc664b904528aee743cb" }, "lua": { - "revision": "a24dab177e58c9c6832f96b9a73102a0cfbced4a" + "revision": "99fc677e6971c425e8d407f59c77ab897e585c92" }, "luadoc": { "revision": "873612aadd3f684dd4e631bdf42ea8990c57634e" @@ -426,13 +438,13 @@ "revision": "a4b9187417d6be349ee5fd4b6e77b4172c6827dd" }, "markdown": { - "revision": "7fe453beacecf02c86f7736439f238f5bb8b5c9b" + "revision": "c25b6354120182f1e0d5caa52f717b097a7e46a3" }, "markdown_inline": { - "revision": "7fe453beacecf02c86f7736439f238f5bb8b5c9b" + "revision": "c25b6354120182f1e0d5caa52f717b097a7e46a3" }, "matlab": { - "revision": "0d5a05e543af2de60cdb5e71f0f5888c95ab936f" + "revision": "306c43ab28b7b8a4976e40ff0a7c26b019ad52df" }, "menhir": { "revision": "be8866a6bcc2b563ab0de895af69daeffa88fe70" @@ -444,10 +456,10 @@ "revision": "bd17c824196ce70800f64ad39cfddd1b17acc13f" }, "mlir": { - "revision": "affbd6f3b08155826a22cfa8373147acbf60f1f1" + "revision": "02af5a1a1cfa69a094e3136b10dfb602f968232e" }, "muttrc": { - "revision": "90ef60852c410bd964cd3b954366e4c403c17314" + "revision": "173b0ab53a9c07962c9777189c4c70e90f1c1837" }, "nasm": { "revision": "570f3d7be01fffc751237f4cfcf52d04e20532d1" @@ -456,7 +468,7 @@ "revision": "281d184b8240b2b22670b8907b57b6d6842db6f3" }, "nickel": { - "revision": "3039ad9e9af3c1ffe049a04ee83a2b489915b0b9" + "revision": "88d836a24b3b11c8720874a1a9286b8ae838d30a" }, "nim": { "revision": "897e5d346f0b59ed62b517cfb0f1a845ad8f0ab7" @@ -468,10 +480,10 @@ "revision": "0a95cfdc0745b6ae82f60d3a339b37f19b7b9267" }, "nix": { - "revision": "68d3b7999ad89d31690461884270e5658e0a22c4" + "revision": "537095ddc80cf610fa75a2a0149fe9799b011014" }, "norg": { - "revision": "aa1a1a7ded81a094cc3d5cb14bea6f34b86d8688" + "revision": "d89d95af13d409f30a6c7676387bde311ec4a2c8" }, "nqc": { "revision": "14e6da1627aaef21d2b2aa0c37d04269766dcc1d" @@ -483,10 +495,10 @@ "revision": "28d3b2e25a0b1881d1b47ed1924ca276c7003d45" }, "ocaml": { - "revision": "036226e5edb410aec004cc7ac0f4b2014dd04a0e" + "revision": "14beb5ef0e7488bf1d93b8c67f69942324fee557" }, "ocaml_interface": { - "revision": "036226e5edb410aec004cc7ac0f4b2014dd04a0e" + "revision": "14beb5ef0e7488bf1d93b8c67f69942324fee557" }, "ocamllex": { "revision": "4b9898ccbf198602bb0dec9cd67cc1d2c0a4fad2" @@ -498,7 +510,7 @@ "revision": "64cfbc213f5a83da17632c95382a5a0a2f3357c1" }, "pascal": { - "revision": "a9ee969dec5b2e3b2ccccc5954fec04100c7619e" + "revision": "d0ebabefaea9ac3f6fc3004cf08cd121b66da9e4" }, "passwd": { "revision": "20239395eacdc2e0923a7e5683ad3605aee7b716" @@ -507,16 +519,16 @@ "revision": "217ff2af3f2db15a79ab7e3d21ea1e0c17e71a1a" }, "perl": { - "revision": "3a21d9cb2a20a062c17f8f53d5983fd473c4673c" + "revision": "70db420b20885ecd7268e5a710ebb3aeaef3a293" }, "php": { - "revision": "c07d69739ba71b5a449bdbb7735991f8aabf8546" + "revision": "74c6b0d560c2660db4d9e8c76b681f538d494160" }, "php_only": { - "revision": "c07d69739ba71b5a449bdbb7735991f8aabf8546" + "revision": "74c6b0d560c2660db4d9e8c76b681f538d494160" }, "phpdoc": { - "revision": "1d0e255b37477d0ca46f1c9e9268c8fa76c0b3fc" + "revision": "df5e7da4b83da072f99135079ac3436550b8d67d" }, "pioasm": { "revision": "924aadaf5dea2a6074d72027b064f939acf32e20" @@ -525,7 +537,7 @@ "revision": "bd860a0f57f697162bf28e576674be9c1500db5e" }, "pod": { - "revision": "39da859947b94abdee43e431368e1ae975c0a424" + "revision": "0bf8387987c21bf2f8ed41d2575a8f22b139687f" }, "poe_filter": { "revision": "592476d81f95d2451f2ca107dc872224c76fecdf" @@ -576,25 +588,25 @@ "revision": "be062582956165019d3253794b4d712f66dfeaaa" }, "python": { - "revision": "0dee05ef958ba2eae88d1e65f24b33cad70d4367" + "revision": "8c65e256f971812276ff2a69a2f515c218ed7f82" }, "ql": { - "revision": "42becd6f8f7bae82c818fa3abb1b6ff34b552310" + "revision": "c73c31c89cb0019ef56fe8bc1723e7c36e0be607" }, "qmldir": { "revision": "6b2b5e41734bd6f07ea4c36ac20fb6f14061c841" }, "qmljs": { - "revision": "febf48a5b6928600cd8fb2a01254743af550780d" + "revision": "cc4186f15e2829385be33440561fdd17b1c40cf7" }, "query": { "revision": "f767fb0ac5e711b6d44c5e0c8d1f349687a86ce0" }, "r": { - "revision": "b1e211f52ad8f8e1e182bbbcc16dcd5e3688eb7d" + "revision": "c8b6e5f3f3c055cfc76471ebc912286e9e73d7d2" }, "racket": { - "revision": "171f52a8c0ed635b85cd42d1e36d82f1066a03b4" + "revision": "5b211bf93021d1c45f39aa96898be9f794f087e4" }, "ralph": { "revision": "f6d81bf7a4599c77388035439cf5801cd461ff77" @@ -612,7 +624,7 @@ "revision": "3d4768b04d7cfaf40533e12b28672603428b8f31" }, "regex": { - "revision": "47007f195752d8e57bda80b0b6cdb2d173a9f7d7" + "revision": "f70251e1f1d72bd6dc1f897f956f9112f8668441" }, "rego": { "revision": "20b5a5958c837bc9f74b231022a68a594a313f6d" @@ -642,28 +654,31 @@ "revision": "5120f6e59284cb8b85b450bd2db0bd352635ba9f" }, "ruby": { - "revision": "0ffe457fb6aabf064f173fd30ea356845cef2513" + "revision": "a66579f70d6f50ffd81a16fc3d3358e2ac173c88" }, "rust": { - "revision": "9c84af007b0f144954adb26b3f336495cbb320a7" + "revision": "6b7d1fc73ded57f73b1619bcf4371618212208b1" }, "scala": { - "revision": "a13f2d1ee9609cc5c4c8ffce9640c353b77a24d8" + "revision": "b02af60518ae1633d552ae2d0f25ca5e05f274f7" }, "scfg": { "revision": "a5512800ea0220da4abbae61b8aea8423d1549aa" }, "scheme": { - "revision": "8f9dff3d038f09934db5ea113cebc59c74447743" + "revision": "63e25a4a84142ae7ee0ee01fe3a32c985ca16745" }, "scss": { "revision": "c478c6868648eff49eb04a4df90d703dc45b312a" }, + "sflog": { + "revision": "602cc4b050ef1e14a69acc2ea094968bf928fa59" + }, "slang": { - "revision": "d84b43d75d65bbc4ba57166ce17555f32c0b8983" + "revision": "4a3fabd26b09efd7431ea4899e5f2d81b568a4b9" }, "slint": { - "revision": "4a0558cc0fcd7a6110815b9bbd7cc12d7ab31e74" + "revision": "34ccfd58d3baee7636f62d9326f32092264e8407" }, "smali": { "revision": "fdfa6a1febc43c7467aa7e937b87b607956f2346" @@ -672,16 +687,16 @@ "revision": "fa898ac0885d1da9a253695c3e0e91f5efc587cd" }, "snakemake": { - "revision": "46d4de8e6cfca8a97c0489aea936bb15beeaf666" + "revision": "e909815acdbe37e69440261ebb1091ed52e1dec6" }, "solidity": { "revision": "ee5a2d2ba30b487c4bbf613d2ef310a454c09c7c" }, "soql": { - "revision": "c99ad4b16d112fea91745e3f1b769754239fdaba" + "revision": "602cc4b050ef1e14a69acc2ea094968bf928fa59" }, "sosl": { - "revision": "c99ad4b16d112fea91745e3f1b769754239fdaba" + "revision": "602cc4b050ef1e14a69acc2ea094968bf928fa59" }, "sourcepawn": { "revision": "6b9bf9cbab91443380d2ca8a2f6c491cc7fac5bf" @@ -690,7 +705,7 @@ "revision": "d853661ca680d8ff7f8d800182d5782b61d0dd58" }, "sql": { - "revision": "b8175006d9c8120d41cf40a4ef3711bbbbc08973" + "revision": "a8b10c76759a372d0f92bb070b4f5c993e0ce5f9" }, "squirrel": { "revision": "072c969749e66f000dba35a33c387650e203e96e" @@ -705,7 +720,7 @@ "revision": "d819cdd5dbe455bd3c859193633c8d91c0df7c36" }, "styled": { - "revision": "65835cca33a5f033bcde580ed66cde01c1fabbbe" + "revision": "b729198642b3058d4ea0f864d86efb271d594595" }, "supercollider": { "revision": "affa4389186b6939d89673e1e9d2b28364f5ca6f" @@ -714,16 +729,16 @@ "revision": "f4586b35ac8548667a9aaa4eae44456c1f43d032" }, "svelte": { - "revision": "7ab8221e3f378a3b04b4b488f07c1f408c5bd0d8" + "revision": "774a65aea563accc35f5d45fafa4d96ec5761f57" }, "swift": { - "revision": "769bb834feb2947f2c706d82830b0a05958727de" + "revision": "7d303df70012edb7385a6a3b3938e0e7b89ecfbd" }, "sxhkdrc": { "revision": "440d5f913d9465c9c776a1bd92334d32febcf065" }, "systemtap": { - "revision": "1af543a96d060b1f808982037bfc54cc02218edd" + "revision": "f2b378a9af0b7e1192cff67a5fb45508c927205d" }, "systemverilog": { "revision": "4f897d5e3f0e38bf8fbb55e8f39dc97d2bc2229e" @@ -735,16 +750,16 @@ "revision": "b1170880c61355aaf38fc06f4af7d3c55abdabc4" }, "tact": { - "revision": "91cc49a83f4f0b3a756bf7d0e65403a9cf757003" + "revision": "b3710fe2723bd9b285de7f3d0c0717bebf3f17bd" }, "tcl": { - "revision": "8784024358c233efd0f3a6fd9e7a3c5852e628bc" + "revision": "cdba4ab96a9896492d0d5219b70300c8783ca4e7" }, "teal": { "revision": "19b02da829d1721a521bf7b802eb80a50bd53aab" }, "templ": { - "revision": "de0d0ee129cf643872e8e0d5c4a6589b5a3aae23" + "revision": "0524da9e1f14b9b7d7d6d36608293f85a550b263" }, "terraform": { "revision": "9e3ec9848f28d26845ba300fd73c740459b83e9b" @@ -762,7 +777,7 @@ "revision": "bba02e79f85e335f310fc95e21c677e49f2c4439" }, "tmux": { - "revision": "9138ea508410e0f34da2666609f600f65e944f22" + "revision": "0252ecd080016e45e6305ef1a943388f5ae2f4b4" }, "todotxt": { "revision": "3937c5cd105ec4127448651a21aef45f52d19609" @@ -774,7 +789,7 @@ "revision": "7eb7297823605392d2bbcc4c09b1cd18d6fa9529" }, "tsx": { - "revision": "198d03553f43a45b92ac5d0ee167db3fec6a6fd6" + "revision": "9951831c5f05be434514dce38b30eef213667601" }, "turtle": { "revision": "7f789ea7ef765080f71a298fc96b7c957fa24422" @@ -783,7 +798,7 @@ "revision": "085648e01d1422163a1702a44e72303b4e2a0bd1" }, "typescript": { - "revision": "198d03553f43a45b92ac5d0ee167db3fec6a6fd6" + "revision": "9951831c5f05be434514dce38b30eef213667601" }, "typespec": { "revision": "0ee05546d73d8eb64635ed8125de6f35c77759fe" @@ -810,7 +825,7 @@ "revision": "ad9b638b914095320de85d59c49ab271603af048" }, "v": { - "revision": "7f80a0441ff2ca6aa8ced8e1ee87cead9dd26515" + "revision": "d63bc6c08a88715c89f4b1b06642e130dd899aba" }, "vala": { "revision": "8f690bfa639f2b83d1fb938ed3dd98a7ba453e8b" @@ -822,10 +837,10 @@ "revision": "075ebfc84543675f12e79a955f79d717772dcef3" }, "vhdl": { - "revision": "4ab3e251eae8890a020d083d00acd1b8c2653c07" + "revision": "3f13cd14952b39ccf6817f58880834b84565ca54" }, "vhs": { - "revision": "90028bbadb267ead5b87830380f6a825147f0c0f" + "revision": "09f8fbfe40a3a699b200daca7d92e65fbbe9f9e6" }, "vim": { "revision": "f3cd62d8bd043ef20507e84bb6b4b53731ccf3a7" @@ -846,7 +861,7 @@ "revision": "0f06f24e259ac725045956436b9025dab008ff9f" }, "wing": { - "revision": "bd1d35cf3e013dc7e189b46a593bdc2b281b0dd7" + "revision": "76e0c25844a66ebc6e866d690fcc5f4e90698947" }, "wit": { "revision": "c52f0b07786603df17ad0197f6cef680f312eb2c" @@ -867,9 +882,9 @@ "revision": "e877f6ade4b77d5ef8787075141053631ba12318" }, "zathurarc": { - "revision": "6e7c8edfcd6f5f7c12b2fa9ffc6d042f1b6d7068" + "revision": "0554b4a5d313244b7fc000cbb41c04afae4f4e31" }, "zig": { - "revision": "2bac4cc6c697d46a193905fef6d003bfa0bfabfd" + "revision": "21e2218e0ec7f4e3c0640d16bf8c67e6f0a61e18" } } diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/parsers.lua b/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/parsers.lua index 969c75fe..b975ec41 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/parsers.lua +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/parsers.lua @@ -98,7 +98,7 @@ list.apex = { files = { "src/parser.c" }, location = "apex", }, - maintainers = { "@aheber" }, + maintainers = { "@aheber", "@xixiaofinland" }, } list.arduino = { @@ -633,6 +633,24 @@ list.fusion = { maintainers = { "@jirgn" }, } +list.gap = { + install_info = { + url = "https://github.com/gap-system/tree-sitter-gap", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@reiniscirpons" }, + readme_name = "GAP system", +} + +list.gaptst = { + install_info = { + url = "https://github.com/gap-system/tree-sitter-gaptst", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@reiniscirpons" }, + readme_name = "GAP system test files", +} + list.gdscript = { install_info = { url = "https://github.com/PrestonKnopp/tree-sitter-gdscript", @@ -704,7 +722,7 @@ list.gleam = { list.glimmer = { install_info = { - url = "https://github.com/alexlafroscia/tree-sitter-glimmer", + url = "https://github.com/ember-tooling/tree-sitter-glimmer", files = { "src/parser.c", "src/scanner.c" }, }, filetype = "handlebars", @@ -712,6 +730,26 @@ list.glimmer = { readme_name = "Glimmer and Ember", } +list.glimmer_javascript = { + install_info = { + url = "https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript", + files = { "src/parser.c", "src/scanner.c" }, + generate_requires_npm = true, + }, + filetype = "javascript.glimmer", + maintainers = { "@NullVoxPopuli" }, +} + +list.glimmer_typescript = { + install_info = { + url = "https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript", + files = { "src/parser.c", "src/scanner.c" }, + generate_requires_npm = true, + }, + filetype = "typescript.glimmer", + maintainers = { "@NullVoxPopuli" }, +} + list.glsl = { install_info = { url = "https://github.com/theHamsta/tree-sitter-glsl", @@ -1495,7 +1533,7 @@ list.php = { location = "php", files = { "src/parser.c", "src/scanner.c" }, }, - maintainers = { "@tk-shirasaka" }, + maintainers = { "@tk-shirasaka", "@calebdw" }, } list.php_only = { @@ -1504,7 +1542,7 @@ list.php_only = { location = "php_only", files = { "src/parser.c", "src/scanner.c" }, }, - maintainers = { "@tk-shirasaka" }, + maintainers = { "@tk-shirasaka", "@calebdw" }, } -- Parsers for injections @@ -1908,6 +1946,15 @@ list.scss = { maintainers = { "@elianiva" }, } +list.sflog = { + install_info = { + url = "https://github.com/aheber/tree-sitter-sfapex", + files = { "src/parser.c" }, + location = "sflog", + }, + maintainers = { "@aheber", "@xixiaofinland" }, +} + list.slang = { install_info = { url = "https://github.com/theHamsta/tree-sitter-slang", @@ -1966,7 +2013,7 @@ list.soql = { files = { "src/parser.c" }, location = "soql", }, - maintainers = { "@aheber" }, + maintainers = { "@aheber", "@xixiaofinland" }, } list.sosl = { @@ -1975,7 +2022,7 @@ list.sosl = { files = { "src/parser.c" }, location = "sosl", }, - maintainers = { "@aheber" }, + maintainers = { "@aheber", "@xixiaofinland" }, } list.sourcepawn = { @@ -2499,10 +2546,10 @@ list.zathurarc = { list.zig = { install_info = { - url = "https://github.com/maxxnino/tree-sitter-zig", + url = "https://github.com/tree-sitter-grammars/tree-sitter-zig", files = { "src/parser.c" }, }, - maintainers = { "@maxxnino" }, + maintainers = { "@amaanq" }, } list.templ = { diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/query.lua b/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/query.lua index 51310545..4aba9f2f 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/query.lua +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/query.lua @@ -248,7 +248,7 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row) return t end - local matches = query:iter_matches(qnode, bufnr, start_row, end_row) + local matches = query:iter_matches(qnode, bufnr, start_row, end_row, { all = false }) local function iterator() local pattern, match, metadata = matches() diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/query_predicates.lua b/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/query_predicates.lua index 2d61ca6b..5caaaa8b 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/query_predicates.lua +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/query_predicates.lua @@ -15,6 +15,9 @@ local non_filetype_match_injection_language_aliases = { ts = "typescript", } +-- compatibility shim for breaking change on nightly/0.11 +local opts = vim.fn.has "nvim-0.10" == 1 and { force = true, all = false } or true + local function get_parser_from_markdown_info_string(injection_alias) local match = vim.filetype.match { filename = "a." .. injection_alias } return match or non_filetype_match_injection_language_aliases[injection_alias] or injection_alias @@ -57,7 +60,7 @@ query.add_predicate("nth?", function(match, _pattern, _bufnr, pred) end return false -end, true) +end, opts) ---@param match (TSNode|nil)[] ---@param _pattern string @@ -91,9 +94,9 @@ local function has_ancestor(match, _pattern, _bufnr, pred) return false end -query.add_predicate("has-ancestor?", has_ancestor, true) +query.add_predicate("has-ancestor?", has_ancestor, opts) -query.add_predicate("has-parent?", has_ancestor, true) +query.add_predicate("has-parent?", has_ancestor, opts) ---@param match (TSNode|nil)[] ---@param _pattern string @@ -117,7 +120,7 @@ query.add_predicate("is?", function(match, _pattern, bufnr, pred) local _, _, kind = locals.find_definition(node, bufnr) return vim.tbl_contains(types, kind) -end, true) +end, opts) ---@param match (TSNode|nil)[] ---@param _pattern string @@ -137,7 +140,7 @@ query.add_predicate("kind-eq?", function(match, _pattern, _bufnr, pred) end return vim.tbl_contains(types, node:type()) -end, true) +end, opts) ---@param match (TSNode|nil)[] ---@param _ string @@ -158,7 +161,7 @@ query.add_directive("set-lang-from-mimetype!", function(match, _, bufnr, pred, m local parts = vim.split(type_attr_value, "/", {}) metadata["injection.language"] = parts[#parts] end -end, true) +end, opts) ---@param match (TSNode|nil)[] ---@param _ string @@ -173,10 +176,10 @@ query.add_directive("set-lang-from-info-string!", function(match, _, bufnr, pred end local injection_alias = vim.treesitter.get_node_text(node, bufnr):lower() metadata["injection.language"] = get_parser_from_markdown_info_string(injection_alias) -end, true) +end, opts) -- Just avoid some annoying warnings for this directive -query.add_directive("make-range!", function() end, true) +query.add_directive("make-range!", function() end, opts) --- transform node text to lower case (e.g., to make @injection.language case insensitive) --- @@ -197,7 +200,7 @@ query.add_directive("downcase!", function(match, _, bufnr, pred, metadata) metadata[id] = {} end metadata[id].text = string.lower(text) -end, true) +end, opts) -- Trim blank lines from end of the region -- Arguments are the captures to trim. @@ -235,4 +238,4 @@ query.add_directive("trim!", function(match, _, bufnr, pred, metadata) metadata[id].range = { start_row, start_col, end_row, end_col } end end -end, true) +end, opts) diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/shell_command_selectors.lua b/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/shell_command_selectors.lua index a386226e..48f61016 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/shell_command_selectors.lua +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/lua/nvim-treesitter/shell_command_selectors.lua @@ -1,5 +1,6 @@ local fn = vim.fn local utils = require "nvim-treesitter.utils" +local uv = vim.uv or vim.loop -- Convert path for cmd.exe on Windows. -- This is needed when vim.opt.shellslash is in use. @@ -303,10 +304,11 @@ function M.select_download_commands(repo, project_name, cache_folder, revision, "GIT_PREFIX", "GIT_WORK_TREE", } do - if vim.uv.os_getenv(k) then + if uv.os_getenv(k) then vim.api.nvim_err_writeln( string.format( "Cannot install %s with git in an active git session. Exit the session and run ':TSInstall %s' manually", + project_name, project_name ) ) diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/c_sharp/highlights.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/c_sharp/highlights.scm index 20cc8074..90d0d340 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/c_sharp/highlights.scm +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/c_sharp/highlights.scm @@ -358,6 +358,9 @@ (preproc_pragma (identifier) @constant) +(preproc_if + (identifier) @constant) + [ "if" "else" @@ -367,15 +370,6 @@ "when" ] @keyword.conditional -(preproc_pragma - (identifier) @constant) - -(preproc_if - (identifier) @constant) - -(preproc_if - (identifier) @constant) - [ "while" "for" diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/cpp/highlights.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/cpp/highlights.scm index e39a2925..85ff2dc4 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/cpp/highlights.scm +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/cpp/highlights.scm @@ -230,7 +230,7 @@ "private" "protected" "final" - (virtual) + "virtual" ] @keyword.modifier [ diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/diff/folds.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/diff/folds.scm new file mode 100644 index 00000000..3560abb3 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/diff/folds.scm @@ -0,0 +1,5 @@ +[ + (block) + (hunks) + (hunk) +] @fold diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/ecma/highlights.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/ecma/highlights.scm index 37913f65..038df561 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/ecma/highlights.scm +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/ecma/highlights.scm @@ -43,10 +43,6 @@ (statement_identifier) @label -(glimmer_opening_tag) @tag.builtin - -(glimmer_closing_tag) @tag.builtin - ; Function and method definitions ;-------------------------------- (function_expression diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/ecma/injections.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/ecma/injections.scm index 93cf7067..04abafcd 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/ecma/injections.scm +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/ecma/injections.scm @@ -7,11 +7,7 @@ ; html(`...`), html`...`, sql(`...`), etc. (call_expression - function: [ - (await_expression - (identifier) @injection.language) - (identifier) @injection.language - ] + function: (identifier) @injection.language arguments: [ (arguments (template_string) @injection.content) @@ -27,13 +23,8 @@ ; svg`...` or svg(`...`) (call_expression - function: [ - (await_expression - (identifier) @_name - (#eq? @_name "svg")) - ((identifier) @_name - (#eq? @_name "svg")) - ] + function: (identifier) @_name + (#eq? @_name "svg") arguments: [ (arguments (template_string) @injection.content) @@ -46,13 +37,8 @@ ; Vercel PostgreSQL ; foo.sql`...` or foo.sql(`...`) (call_expression - function: [ - (await_expression - (member_expression - property: (property_identifier) @injection.language)) - (member_expression - property: (property_identifier) @injection.language) - ] + function: (member_expression + property: (property_identifier) @injection.language) arguments: [ (arguments (template_string) @injection.content) @@ -63,47 +49,29 @@ (#set! injection.include-children)) (call_expression - function: [ - (await_expression - (identifier) @_name - (#eq? @_name "gql")) - ((identifier) @_name - (#eq? @_name "gql")) - ] - arguments: ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "graphql"))) + function: (identifier) @_name + (#eq? @_name "gql") + arguments: (template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "graphql")) (call_expression - function: [ - (await_expression - (identifier) @_name - (#eq? @_name "hbs")) - ((identifier) @_name - (#eq? @_name "hbs")) - ] - arguments: ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "glimmer"))) - -((glimmer_template) @injection.content + function: (identifier) @_name + (#eq? @_name "hbs") + arguments: (template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) (#set! injection.language "glimmer")) ; css``, keyframes`` (call_expression - function: [ - (await_expression - (identifier) @_name - (#any-of? @_name "css" "keyframes")) - ((identifier) @_name - (#any-of? @_name "css" "keyframes")) - ] - arguments: ((template_string) @injection.content - (#offset! @injection.content 0 1 0 -1) - (#set! injection.include-children) - (#set! injection.language "styled"))) + function: (identifier) @_name + (#any-of? @_name "css" "keyframes") + arguments: (template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "styled")) ; styled.div`` (call_expression diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/editorconfig/highlights.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/editorconfig/highlights.scm index fd69bc4c..feb0a524 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/editorconfig/highlights.scm +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/editorconfig/highlights.scm @@ -1,8 +1,7 @@ (comment) @comment @spell -; consistency with toml and ini (section - (section_name) @type) + (section_name) @string.special.path) (character_choice (character) @constant) diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/folds.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/folds.scm new file mode 100644 index 00000000..7cf0888b --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/folds.scm @@ -0,0 +1,12 @@ +[ + (if_statement) + (elif_clause) + (else_clause) + (while_statement) + (repeat_statement) + (for_statement) + (atomic_statement) + (lambda) + (function) + (atomic_function) +] @fold diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/highlights.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/highlights.scm new file mode 100644 index 00000000..6c0c856c --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/highlights.scm @@ -0,0 +1,208 @@ +(identifier) @variable + +; Functions +(assignment_statement + left: (identifier) @function + right: (function)) + +(assignment_statement + left: (identifier) @function + right: (atomic_function)) + +(assignment_statement + left: (identifier) @function + right: (lambda)) + +(call + function: (identifier) @function.call) + +((call + function: (identifier) @function.builtin) + (#any-of? @function.builtin "Assert" "Info" "IsBound" "Unbind" "TryNextMethod")) + +(parameters + (identifier) @variable.parameter) + +(qualified_parameters + (identifier) @variable.parameter) + +(qualified_parameters + (qualified_identifier + (identifier) @variable.parameter)) + +(lambda_parameters + (identifier) @variable.parameter) + +; arg is treated specially when it is the only parameter of a function +((parameters + . + (identifier) @variable.parameter.builtin .) + (#eq? @variable.parameter.builtin "arg")) + +((qualified_parameters + . + (identifier) @variable.parameter.builtin .) + (#eq? @variable.parameter.builtin "arg")) + +((qualified_parameters + . + (qualified_identifier + (identifier) @variable.parameter.builtin) .) + (#eq? @variable.parameter.builtin "arg")) + +((lambda_parameters + . + (identifier) @variable.parameter.builtin .) + (#eq? @variable.parameter.builtin "arg")) + +; Literals +(bool) @constant.builtin + +(integer) @number + +(float) @number.float + +(string) @string + +(char) @character + +(escape_sequence) @string.escape + +[ + (help_topic) + (help_book) +] @string.special + +(tilde) @variable.builtin + +; Record selectors +(record_entry + left: [ + (identifier) + (integer) + ] @variable.member) + +(record_selector + selector: [ + (identifier) + (integer) + ] @variable.member) + +(component_selector + selector: [ + (identifier) + (integer) + ] @variable.member) + +(function_call_option + [ + (identifier) + (record_entry ;Record entries specify global properties in function calls + left: [ + (identifier) + (integer) + ]) + ] @property) + +(help_statement + (help_selector) @property) + +; Operators +[ + "+" + "-" + "*" + "/" + "^" + "->" + ":=" + "<" + "<=" + "<>" + "=" + ">" + ">=" + ".." + (ellipsis) +] @operator + +(help_statement + (help_operator) @operator) + +; Keywords +[ + (break_statement) + (continue_statement) + "atomic" + (quit_statement) +] @keyword + +[ + "function" + "local" + "end" +] @keyword.function + +[ + "and" + "in" + "mod" + "not" + "or" +] @keyword.operator + +"rec" @keyword.type + +[ + "readonly" + "readwrite" +] @keyword.modifier + +(atomic_function + "atomic" @keyword.modifier) + +[ + "for" + "while" + "do" + "od" + "repeat" + "until" +] @keyword.repeat + +[ + "if" + "then" + "elif" + "else" + "fi" +] @keyword.conditional + +"return" @keyword.return + +(pragma) @keyword.directive + +;Punctuation +[ + "," + ";" + "." + "!." + ":" +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "![" + "]" + "{" + "}" +] @punctuation.bracket + +(help_statement + "?" @punctuation.special) + +;Comments +(comment) @comment @spell diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/injections.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/injections.scm new file mode 100644 index 00000000..2f0e58eb --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/locals.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/locals.scm new file mode 100644 index 00000000..d695d1f2 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gap/locals.scm @@ -0,0 +1,43 @@ +[ + (lambda) + (function) + (atomic_function) +] @local.scope + +(parameters + (identifier) @local.definition.parameter) + +(qualified_parameters + (identifier) @local.definition.parameter) + +(qualified_parameters + (qualified_identifier + (identifier) @local.definition.parameter)) + +(lambda_parameters + (identifier) @local.definition.parameter) + +(locals + (identifier) @local.definition.var) + +(record_entry + left: [ + (identifier) + (integer) + ] @local.definition.field) + +(assignment_statement + left: (identifier) @local.definition.var) + +(for_statement + identifier: (identifier) @local.definition.var) + +(assignment_statement + left: (identifier) @local.definition.function + right: [ + (lambda) + (function) + (atomic_function) + ]) + +(identifier) @local.reference diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/folds.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/folds.scm new file mode 100644 index 00000000..0ec72d13 --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/folds.scm @@ -0,0 +1,7 @@ +[ + (if_statement) + (else_clause) + (local_statement) + (exec_statement) + (test_case) +] @fold diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/highlights.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/highlights.scm new file mode 100644 index 00000000..22ab2d0a --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/highlights.scm @@ -0,0 +1,19 @@ +(output_line) @markup.raw.block + +[ + "#@local" + "#@exec" +] @keyword + +[ + "gap> " + "> " +] @keyword.debug + +[ + "#@if" + "#@else" + "#@fi" +] @keyword.conditional + +(comment) @comment @spell diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/injections.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/injections.scm new file mode 100644 index 00000000..bdcba35d --- /dev/null +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gaptst/injections.scm @@ -0,0 +1,9 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((gap_expression) @injection.content + (#set! injection.language "gap")) + +((input_line) @injection.content + (#set! injection.language "gap") + (#set! injection.combined)) diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/git_config/highlights.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/git_config/highlights.scm index 3423e1b0..6b37e909 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/git_config/highlights.scm +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/git_config/highlights.scm @@ -1,5 +1,5 @@ ; Sections -(section_name) @type +(section_name) @markup.heading ((section_name) @keyword.import (#eq? @keyword.import "include")) diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gleam/locals.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gleam/locals.scm index ba0632c0..39909a4a 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gleam/locals.scm +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/gleam/locals.scm @@ -24,6 +24,9 @@ ; References (identifier) @local.reference +; Block Scope +(block) @local.scope + ; Function Body Scope (function_body) @local.scope diff --git a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer/injections.scm b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer/injections.scm index d0400c30..30b43868 100644 --- a/config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer/injections.scm +++ b/config/neovim/store/lazy-plugins/nvim-treesitter/queries/glimmer/injections.scm @@ -1,2 +1,21 @@ +; comments ((comment_statement) @injection.content (#set! injection.language "comment")) + +;