diff --git a/Makefile b/Makefile deleted file mode 100644 index 71c7c35..0000000 --- a/Makefile +++ /dev/null @@ -1,44 +0,0 @@ -## help: print this help message -.PHONY: help -help: - @echo 'Usage:' - @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /' - -## all: lint and run tests -.PHONY: all -all: lint test - -## test: run tests -.PHONY: test -test: - luarocks test --local - -## lint: run selene and stylua -.PHONY: lint -lint: - selene --display-style quiet . - stylua --check lua spec - -## profile: use LuaJIT profiler to profile the plugin -.PHONY: profile -profile: scripts/benchmark.nvim - nvim --clean -u perf/bootstrap.lua -c 'lua jit_profile()' - -## flame_profile: create a trace in the chrome profiler format -.PHONY: flame_profile -flame_profile: scripts/benchmark.nvim - nvim --clean -u perf/bootstrap.lua -c 'lua flame_profile()' - -## benchmark: benchmark performance opening directory with many files -.PHONY: benchmark -benchmark: scripts/benchmark.nvim - nvim --clean -u perf/bootstrap.lua -c 'lua benchmark()' - @cat perf/tmp/benchmark.txt - -scripts/benchmark.nvim: - git clone https://github.com/stevearc/benchmark.nvim scripts/benchmark.nvim - -## clean: reset the repository to a clean state -.PHONY: clean -clean: - rm -rf perf/tmp profile.json diff --git a/spec/altbuf_spec.lua b/spec/altbuf_spec.lua index b64bfc0..cd2cf4b 100644 --- a/spec/altbuf_spec.lua +++ b/spec/altbuf_spec.lua @@ -22,7 +22,6 @@ describe('Alternate buffer', function() local readme = fs.join(vim.fn.getcwd(), 'README.md') vim.cmd.edit({ args = { 'oil://' .. fs.os_to_posix_path(readme) } }) test_util.wait_for_autocmd('BufEnter') - test_util.wait_for_autocmd('BufEnter') assert.equals(readme, vim.api.nvim_buf_get_name(0)) assert.equals('foo', vim.fn.expand('#')) end) diff --git a/spec/minimal_init.lua b/spec/minimal_init.lua index c070d64..09f0cd3 100644 --- a/spec/minimal_init.lua +++ b/spec/minimal_init.lua @@ -2,7 +2,7 @@ vim.cmd([[set runtimepath=$VIMRUNTIME]]) vim.opt.runtimepath:append('.') vim.opt.packpath = {} vim.o.swapfile = false -vim.cmd('filetype plugin indent on') +vim.cmd('filetype on') vim.fn.mkdir(vim.fn.stdpath('cache'), 'p') vim.fn.mkdir(vim.fn.stdpath('data'), 'p') vim.fn.mkdir(vim.fn.stdpath('state'), 'p') diff --git a/spec/test_util.lua b/spec/test_util.lua index b77f6f1..57f81b1 100644 --- a/spec/test_util.lua +++ b/spec/test_util.lua @@ -12,12 +12,8 @@ M.reset_editor = function() prompt_save_on_select_new_entry = false, }) vim.cmd.tabonly({ mods = { silent = true } }) - for i, winid in ipairs(vim.api.nvim_tabpage_list_wins(0)) do - if i > 1 then - vim.api.nvim_win_close(winid, true) - end - end - vim.api.nvim_win_set_buf(0, vim.api.nvim_create_buf(false, true)) + vim.cmd.new() + vim.cmd.only() for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do vim.api.nvim_buf_delete(bufnr, { force = true }) end