Skip to content

Commit c4216ae

Browse files
committed
stylua
1 parent 06a9082 commit c4216ae

File tree

6 files changed

+20
-22
lines changed

6 files changed

+20
-22
lines changed

ftplugin/quarto.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ vim.b.slime_cell_delimiter = '```'
22

33
-- TODO: Workaround while nvim-treesitter doesn't link those anymore
44
-- until our ouwn pandoc grammar is ready
5-
vim.treesitter.language.register("markdown", { "quarto", "rmd" })
5+
vim.treesitter.language.register('markdown', { 'quarto', 'rmd' })
66

77
local config = require('quarto.config').config
88
local quarto = require 'quarto'

lua/quarto/config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ M.defaultConfig = {
1717
},
1818
codeRunner = {
1919
enabled = true,
20-
default_method = "slime", -- "molten", "slime", "iron" or <function>
20+
default_method = 'slime', -- "molten", "slime", "iron" or <function>
2121
ft_runners = {}, -- filetype to runner, ie. `{ python = "molten" }`.
2222
-- Takes precedence over `default_method`
2323
never_run = { 'yaml' }, -- filetypes which are never sent to a code runner

lua/quarto/init.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ function M.quartoPreview(opts)
1717
local cmd
1818
local mode
1919

20-
21-
-- check for
20+
-- check for
2221
--
2322
-- editor:
2423
-- render-on-save: false
@@ -32,7 +31,7 @@ function M.quartoPreview(opts)
3231
local quarto_config = root_dir .. '/_quarto.yml'
3332
lines = vim.fn.readfile(quarto_config)
3433
else
35-
-- assumption: the yaml header is not longer than a generous 500 lines
34+
-- assumption: the yaml header is not longer than a generous 500 lines
3635
lines = vim.api.nvim_buf_get_lines(0, 0, 500, false)
3736
end
3837

@@ -72,14 +71,14 @@ function M.quartoPreview(opts)
7271
local current_tabpage = vim.api.nvim_get_current_tabpage()
7372

7473
-- Open a new tab for the terminal
75-
vim.cmd('tabnew')
74+
vim.cmd 'tabnew'
7675
local term_buf = vim.api.nvim_create_buf(true, false)
7776
vim.api.nvim_set_current_buf(term_buf)
7877

7978
vim.fn.termopen(cmd, {
8079
on_exit = function(_, exit_code, _)
8180
if exit_code ~= 0 then
82-
vim.notify("Quarto preview exited with code " .. exit_code, vim.log.levels.ERROR)
81+
vim.notify('Quarto preview exited with code ' .. exit_code, vim.log.levels.ERROR)
8382
end
8483
end,
8584
})
@@ -106,7 +105,7 @@ function M.quartoPreview(opts)
106105
end
107106

108107
function M.quartoPreviewNoWatch()
109-
M.quartoPreview({ args = '--no-watch-inputs' })
108+
M.quartoPreview { args = '--no-watch-inputs' }
110109
end
111110

112111
function M.quartoUpdatePreview()
@@ -116,7 +115,7 @@ function M.quartoUpdatePreview()
116115
local url = nil
117116
for _, line in ipairs(lines) do
118117
if line:find(query_start) then
119-
url = 'http' .. line:sub(#query_start+1)
118+
url = 'http' .. line:sub(#query_start + 1)
120119
break
121120
end
122121
end

lua/quarto/runner/init.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ local function send(cell, opts)
6969
-- if user passes a fn to config.codeRunner.default_method, we use that.
7070
-- (this also means fns are allowed as values in ft_runners)
7171
-- otherwise we lookup a string for pre-packaged runner function, e.g. "molten"
72-
if type(runner) == "function" then
73-
runner(cell, opts.ignore_cols)
74-
elseif type(runner) == "string" then
75-
require("quarto.runner." .. runner).run(cell, opts.ignore_cols)
72+
if type(runner) == 'function' then
73+
runner(cell, opts.ignore_cols)
74+
elseif type(runner) == 'string' then
75+
require('quarto.runner.' .. runner).run(cell, opts.ignore_cols)
7676
else
7777
vim.notify("[Quarto] couldn't find appropriate code runner for language: " .. cell.lang, vim.log.levels.ERROR)
7878
end

lua/quarto/runner/iron.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
local concat = require('quarto.tools').concat
2-
local iron_send = require("iron.core").send
2+
local iron_send = require('iron.core').send
33

44
---Run the code cell with iron
55
---@param cell CodeCell
66
---@param _ boolean
77
local function run(cell, _)
88
local text_lines = concat(cell.text)
9-
local lang = cell.lang or "quarto"
9+
local lang = cell.lang or 'quarto'
1010
-- forward to iron.send
1111
-- first arg is filetype. if not supplied, iron.core.send would infer "quarto".
1212
-- Iron lets the user map a filetype to a repl binary, e.g. {"python" = "ipython", "r" = "radian"}
@@ -18,4 +18,3 @@ end
1818
local M = { run = run }
1919

2020
return M
21-

plugin/quarto.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ if vim.fn.has 'nvim-0.9.0' ~= 1 then
88
vim.notify_once(msg, vim.log.levels.WARN)
99
end
1010

11-
vim.api.nvim_create_user_command('QuartoPreview', require'quarto'.quartoPreview, { nargs = '*' })
12-
vim.api.nvim_create_user_command('QuartoPreviewNoWatch', require'quarto'.quartoPreviewNoWatch, { nargs = '*' })
13-
vim.api.nvim_create_user_command('QuartoUpdatePreview', require'quarto'.quartoUpdatePreview, { nargs = '*' })
14-
vim.api.nvim_create_user_command('QuartoClosePreview', require'quarto'.quartoClosePreview, {})
15-
vim.api.nvim_create_user_command('QuartoActivate', require'quarto'.activate, {})
16-
vim.api.nvim_create_user_command('QuartoHelp', require'quarto'.searchHelp, { nargs = 1 })
11+
vim.api.nvim_create_user_command('QuartoPreview', require('quarto').quartoPreview, { nargs = '*' })
12+
vim.api.nvim_create_user_command('QuartoPreviewNoWatch', require('quarto').quartoPreviewNoWatch, { nargs = '*' })
13+
vim.api.nvim_create_user_command('QuartoUpdatePreview', require('quarto').quartoUpdatePreview, { nargs = '*' })
14+
vim.api.nvim_create_user_command('QuartoClosePreview', require('quarto').quartoClosePreview, {})
15+
vim.api.nvim_create_user_command('QuartoActivate', require('quarto').activate, {})
16+
vim.api.nvim_create_user_command('QuartoHelp', require('quarto').searchHelp, { nargs = 1 })

0 commit comments

Comments
 (0)