Skip to content
This repository was archived by the owner on Jul 6, 2024. It is now read-only.

Commit 07751fe

Browse files
authored
Merge pull request #14 from LintaoAmons/dev
Fix: utils methods and error msg
2 parents 6c65a2f + c2ed803 commit 07751fe

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

lua/easy-commands/config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ end
3737
local function formErrorMsg(cmd, err)
3838
local msg = "Something went wrong when calling [" .. cmd.name .. "]\n"
3939
if cmd.dependencies then
40-
msg = msg .. "\nPlease check dependencies firstly" .. "\n"
40+
msg = msg .. "\nPlease check dependencies firstly(required by this command)" .. "\n"
4141
for _, d in ipairs(cmd.dependencies) do
4242
msg = msg .. " - " .. d .. "\n"
4343
end

lua/easy-commands/impl/debug.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ local M = {
4747
{
4848
name = "DebugTest",
4949
callback = function()
50-
require("easy-commands.impl.util.lang").CallLanguageSpecificFunc("DebugTest")
50+
require("easy-commands.impl.util.lang").call_language_specific_func("DebugTest")
5151
end,
5252
dependencies = {
5353
"https://github.com/leoluz/nvim-dap-go",
@@ -56,7 +56,7 @@ local M = {
5656
{
5757
name = "DebugLastTest",
5858
callback = function()
59-
require("easy-commands.impl.util.lang").CallLanguageSpecificFunc("DebugLastTest")
59+
require("easy-commands.impl.util.lang").call_language_specific_func("DebugLastTest")
6060
end,
6161
dependencies = {
6262
"https://github.com/leoluz/nvim-dap-go",

lua/easy-commands/impl/lang/go.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ M.GoToTestFile = function()
66
local current_file = vim.fn.expand("%:p")
77

88
local jump_to_file
9-
if strings.EndsWithSuffix(current_file, test_suffix) then
10-
jump_to_file = strings.ReplacePattern(current_file, test_suffix, ".go")
9+
if strings.ends_with_suffix(current_file, test_suffix) then
10+
jump_to_file = strings.replace_pattern(current_file, test_suffix, ".go")
1111
else
1212
jump_to_file = vim.fn.expand("%:p:r") .. test_suffix
1313
end

lua/easy-commands/impl/navigation/split_vertical.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ end
1515

1616
function M.easy_command_split()
1717
if vim.g.eacy_command_two_split_mode == true then
18-
require("easy-commands.impl.util.editor").close_all_other_windows()
18+
require("easy-commands.impl.util.editor").window.close_all_other_windows({
19+
"filesystem",
20+
"Trouble",
21+
})
1922
end
2023
vim.cmd("rightbelow vsplit")
2124
end

lua/easy-commands/impl/util/lang.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ local editor = require("easy-commands.impl.util.editor")
22

33
---@functionName string
44
local call_language_specific_func = function(functionName)
5-
require("easy-commands.impl.lang." .. editor.getFiletype())[functionName]()
5+
require("easy-commands.impl.lang." .. editor.buf.read.get_buf_filetype())[functionName]()
66
-- local ok, _ = pcall(require("easy-commands.impl.lang." .. editor.getFiletype())[functionName])
77
-- if not ok then
88
-- vim.notify("There's some error or may not be implemented yet for [" .. editor.getFiletype() .. "] type")

0 commit comments

Comments
 (0)