From a19b712dec66a88fc1c3491106eac2f8de07e1fc Mon Sep 17 00:00:00 2001 From: vladevelops Date: Fri, 11 Oct 2024 16:02:06 +0200 Subject: [PATCH] [documentation] Added documentation for visual delete test --- doc/gtestler.txt | 13 +++++++++++++ lua/gtestler/utils.lua | 3 +++ 2 files changed, 16 insertions(+) diff --git a/doc/gtestler.txt b/doc/gtestler.txt index f7122c9..96d5fba 100644 --- a/doc/gtestler.txt +++ b/doc/gtestler.txt @@ -12,6 +12,7 @@ Available Commands: :h gtestler.delete_test :h gtestler.add_favorite_test :h gtestler.execute_favorite_test + :h gtestler.visual_delete ------------------------------------------------------------------------------ open_tests_list() *gtestler.open_tests_list()* @@ -57,6 +58,18 @@ Executes the favorite test. ------------------------------------------------------------------------------ delete_test() *gtestler.delete_test()* Deletes the test under the cursor. + +It will automatically refresh the buffer list. + +------------------------------------------------------------------------------ +visual_delete() *gtestler.visual_delete()* +Deletes the tests selected in visual mode. + +Press *v* to enter visual line mode, in the list buffer the *v* is mapped to *V* +so it will always select the lines. + +Pressing *d* will delete all the selected tests. + It will automatically refresh the buffer list. diff --git a/lua/gtestler/utils.lua b/lua/gtestler/utils.lua index 02bf878..5d82bd9 100644 --- a/lua/gtestler/utils.lua +++ b/lua/gtestler/utils.lua @@ -47,6 +47,7 @@ function M.validate_split_method(method) local case = cases[method] or cases["default"] return case() end + function M.get_command_and_test_name() local pkg_name = get_package_name() local ft = vim.api.nvim_buf_get_option(0, "filetype") @@ -105,12 +106,14 @@ function M.get_working_directory() return t[#t] end + function M.remove_star_if_exists(str) if str:match("^%* ") then return str:gsub("^%* ", "") end return str end + --- in context of gtestler list gets the test name ---@return string function M.get_command_alias()