Skip to content

Commit 912c95a

Browse files
committed
When argadd is selected with only one file fallback to other method to support line number
1 parent f906353 commit 912c95a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lua/server/server_functions.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,12 @@ function _G.unception_edit_files(file_args, options)
136136
local open_method = unception_detect_open_method(options)
137137

138138
if (#file_args > 0) then
139-
if (open_method == "argadd") then
140-
unception_open_file_argadd(file_args, options)
141-
else
139+
-- if argadd is selected but we have only one file
140+
-- let's not use argadd so we can use line number specifier
141+
if (open_method ~= "argadd" or #file_args == 1) then
142142
unception_open_file_other(file_args, options, open_method)
143+
else
144+
unception_open_file_argadd(file_args, options)
143145
end
144146
else
145147
if (options.open_in_new_tab) then

0 commit comments

Comments
 (0)