File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -34,21 +34,24 @@ M.defaultConfig = {
3434-- use defaultConfig if not setup
3535M .config = M .defaultConfig
3636
37- function M .quartoPreview ()
37+ function M .quartoPreview (opts )
38+ opts = opts or {}
39+ local args = opts .args or ' '
40+
3841 -- find root directory / check if it is a project
3942 local buffer_path = api .nvim_buf_get_name (0 )
4043 local root_dir = util .root_pattern (" _quarto.yml" )(buffer_path )
4144 local cmd
4245 local mode
4346 if root_dir then
4447 mode = " project"
45- cmd = ' quarto preview'
48+ cmd = ' quarto preview' .. ' ' .. args
4649 else
4750 mode = " file"
4851 if vim .loop .os_uname ().sysname == " Windows_NT" then
49- cmd = ' quarto preview \\ "' .. buffer_path .. ' \\ "'
52+ cmd = ' quarto preview \\ "' .. buffer_path .. ' \\ "' .. ' ' .. args
5053 else
51- cmd = ' quarto preview \' ' .. buffer_path .. ' \' '
54+ cmd = ' quarto preview \' ' .. buffer_path .. ' \' ' .. ' ' .. args
5255 end
5356 end
5457
Original file line number Diff line number Diff line change 1616local quarto = require ' quarto'
1717local api = vim .api
1818
19- api .nvim_create_user_command (' QuartoPreview' , quarto .quartoPreview , {})
19+ api .nvim_create_user_command (' QuartoPreview' , quarto .quartoPreview , {nargs = ' * ' })
2020api .nvim_create_user_command (' QuartoClosePreview' , quarto .quartoClosePreview , {})
2121api .nvim_create_user_command (' QuartoActivate' , quarto .activate , {})
2222api .nvim_create_user_command (' QuartoHelp' , quarto .searchHelp , { nargs = 1 })
You can’t perform that action at this time.
0 commit comments