Skip to content

Commit 072f7d7

Browse files
authored
fix: parse_argv error with nest_if_no_args=true (#114)
Closes #108
1 parent 7252779 commit 072f7d7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lua/flatten/core.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ end
5252

5353
---@param argv string[]
5454
---@return string[] pre_cmds, string[] post_cmds
55-
local function parse_argv(argv)
55+
function M.parse_argv(argv)
5656
local pre_cmds, post_cmds = {}, {}
5757
local is_cmd = false
5858
for _, arg in ipairs(argv) do
@@ -76,7 +76,7 @@ end
7676
function M.run_commands(opts)
7777
local argv = opts.argv
7878

79-
local pre_cmds, post_cmds = parse_argv(argv)
79+
local pre_cmds, post_cmds = M.parse_argv(argv)
8080

8181
for _, cmd in ipairs(pre_cmds) do
8282
vim.api.nvim_exec2(cmd, {})
@@ -152,7 +152,7 @@ function M.edit_files(opts)
152152
local stdin_lines = #stdin
153153

154154
--- commands passed through with +<cmd>, to be executed after opening files
155-
local pre_cmds, post_cmds = parse_argv(argv)
155+
local pre_cmds, post_cmds = M.parse_argv(argv)
156156

157157
if
158158
nfiles == 0

0 commit comments

Comments
 (0)