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

Commit ec7b33f

Browse files
authored
Merge pull request #15 from LintaoAmons/dev
fix: utils ref
2 parents 07751fe + aedf750 commit ec7b33f

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

lua/easy-commands/impl/explorer.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ local M = {
1010
name = "OpenInFinder",
1111
description = "Open the directory of current file in finder",
1212
callback = function()
13-
local dirpath = require("easy-commands.impl.util.editor").get_buf_abs_dir_path()
13+
local dirpath = require("easy-commands.impl.util.editor").buf.read.get_buf_abs_dir_path()
1414
vim.cmd("!open " .. dirpath)
1515
end,
1616
},
1717
{
1818
name = "OpenBySystemDefaultApp",
1919
description = "Open the current file by system default app",
2020
callback = function()
21-
local abspath = require("easy-commands.impl.util.editor").get_buf_abs_path()
21+
local abspath = require("easy-commands.impl.util.editor").buf.read.get_buf_abs_path()
2222
vim.cmd("!open " .. abspath)
2323
end,
2424
},

lua/easy-commands/impl/helper.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ local M = {
2323
name = "PrintSelected",
2424
callback = function()
2525
local lang = require("easy-commands.impl.util.lang")
26-
lang.CallLanguageSpecificFunc("PrintSelected")
26+
lang.call_language_specific_func("PrintSelected")
2727
end,
2828
},
2929
{

lua/easy-commands/impl/nvim.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ local M = {
1111
local string = require("easy-commands.impl.util.base.strings")
1212
local result = vim.api.nvim_exec2("verbose map", { output = true })
1313
local content = string.splitIntoLines(result.output)
14-
editor.splitAndWrite(content, { vertical = true })
14+
editor.split_and_write(content, { vertical = true })
1515
end,
1616
description = "Show all the keymaps and show the location of definition\n"
1717
.. "Can help you to debug keymap configuration",
@@ -35,7 +35,7 @@ local M = {
3535
local string = require("easy-commands.impl.util.base.strings")
3636
local result = vim.api.nvim_exec2("verb command " .. cmdName, { output = true })
3737
local content = string.splitIntoLines(result.output)
38-
editor.splitAndWrite(content, { vertical = true })
38+
editor.split_and_write(content, { vertical = true })
3939
end)
4040
end,
4141
description = "Inspect the commands that provided by easy-commands plugin",

lua/easy-commands/impl/other.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,30 +82,30 @@ local M = {
8282
{
8383
name = "CopyBufRelativePath",
8484
callback = function()
85-
local buf_relative_path = editor.get_buf_relative_path()
85+
local buf_relative_path = editor.buf.read.get_buf_relative_path()
8686
util.CopyToSystemClipboard(buf_relative_path)
8787
end,
8888
},
8989

9090
{
9191
name = "CopyBufRelativeDirPath",
9292
callback = function()
93-
util.CopyToSystemClipboard(editor.get_buf_relative_dir_path())
93+
util.CopyToSystemClipboard(editor.buf.read.get_buf_relative_dir_path())
9494
end,
9595
},
9696

9797
{
9898
name = "CopyCdCommand",
9999
callback = function()
100-
local cmd = "cd " .. editor.get_buf_abs_dir_path()
100+
local cmd = "cd " .. editor.buf.read.get_buf_abs_dir_path()
101101
require("easy-commands.impl.util.base.sys").CopyToSystemClipboard(cmd)
102102
end,
103103
},
104104

105105
{
106106
name = "CopyFilename",
107107
callback = function()
108-
util.CopyToSystemClipboard(editor.get_buf_filename())
108+
util.CopyToSystemClipboard(editor.buf.read.get_buf_filename())
109109
end,
110110
},
111111

@@ -120,7 +120,7 @@ local M = {
120120
{
121121
name = "DeleteCurrentFile",
122122
callback = function()
123-
local filepath = editor.get_buf_abs_path()
123+
local filepath = editor.buf.read.get_buf_abs_path()
124124
local confirm = vim.fn.input("Delete file: " .. filepath .. "? (y/n): ")
125125
local bufnr = vim.fn.bufnr("%")
126126
vim.api.nvim_buf_delete(bufnr, { force = true })

lua/easy-commands/impl/run.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ local M = {
7171
local bufferAbsPath = editor.get_buf_abs_path()
7272
local stdout, _, stderr = sys.run_os_cmd({ "hurl", "--verbose", bufferAbsPath }, ".")
7373
local result = stdout or stderr
74-
editor.splitAndWrite(result, { vertical = true })
74+
editor.split_and_write(result, { vertical = true })
7575
end,
7676
description = "use `hurl` to run current buffer and output to splitted window",
7777
},
@@ -84,7 +84,7 @@ local M = {
8484
local tmpFile = write_to_temp_file(content)
8585
local stdout, _, stderr = sys.run_os_cmd({ "hurl", "--verbose", tmpFile }, ".")
8686
local result = stdout or stderr
87-
editor.splitAndWrite(result, { vertical = true })
87+
editor.split_and_write(result, { vertical = true })
8888
end,
8989
description = "use `hurl` to run current buffer and output to splitted window",
9090
dependencies = { "https://hurl.dev/" },
@@ -126,7 +126,7 @@ local M = {
126126
local absPath = editor.get_buf_abs_path()
127127
local stdout, _, stderr = sys.run_os_cmd({ "jq", pattern, absPath }, ".")
128128
local result = stdout or stderr
129-
editor.splitAndWrite(result, { vertical = true })
129+
editor.split_and_write(result, { vertical = true })
130130
end
131131
)
132132
end,

0 commit comments

Comments
 (0)