mirror of
https://github.com/kristoferssolo/runner.nvim.git
synced 2025-10-21 19:50:34 +00:00
Merge branch 'dev' into StyLua-workflow
This commit is contained in:
commit
92e206ae85
5
.pre-commit-config.yaml
Normal file
5
.pre-commit-config.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
repos:
|
||||
- repo: https://github.com/JohnnyMorganz/StyLua
|
||||
rev: v0.17.1
|
||||
hooks:
|
||||
- id: stylua-github
|
||||
10
.stylua.toml
Normal file
10
.stylua.toml
Normal file
@ -0,0 +1,10 @@
|
||||
column_width = 120
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferSingle"
|
||||
call_parentheses = "NoSingleTable"
|
||||
collapse_simple_statement = "Never"
|
||||
|
||||
[sort_requires]
|
||||
enabled = false
|
||||
@ -1,7 +1,7 @@
|
||||
local M = {}
|
||||
|
||||
local defaults = {
|
||||
position = "right", -- options: top, left, right, bottom
|
||||
position = 'right', -- options: top, left, right, bottom
|
||||
width = 80, -- width of window when position is left or right
|
||||
height = 10, -- height of window when position is top or bottom
|
||||
}
|
||||
|
||||
@ -48,11 +48,11 @@ M.choice = function(handlers)
|
||||
return function(buffer)
|
||||
local picker = pickers.new(
|
||||
{},
|
||||
themes.get_dropdown({
|
||||
prompt_title = "Runner",
|
||||
finder = finders.new_table({
|
||||
themes.get_dropdown {
|
||||
prompt_title = 'Runner',
|
||||
finder = finders.new_table {
|
||||
results = vim.tbl_keys(handlers),
|
||||
}),
|
||||
},
|
||||
sorter = sorters.get_generic_fuzzy_sorter(),
|
||||
attach_mappings = function(prompt_bufnr)
|
||||
actions.select_default:replace(function()
|
||||
@ -62,7 +62,7 @@ M.choice = function(handlers)
|
||||
end)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
}
|
||||
)
|
||||
picker:find()
|
||||
end
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
local helpers = require("runner.handlers.helpers")
|
||||
|
||||
local handlers = {
|
||||
rust = require("runner.handlers.languages.rust"),
|
||||
python = require("runner.handlers.languages.python"),
|
||||
lua = helpers.command_handler("luafile %"),
|
||||
javascript = require("runner.handlers.languages.nodejs"),
|
||||
typescript = require("runner.handlers.languages.nodejs"),
|
||||
vue = require("runner.handlers.languages.nodejs"),
|
||||
rust = require('runner.handlers.languages.rust'),
|
||||
python = require('runner.handlers.languages.python'),
|
||||
lua = helpers.command_handler('luafile %'),
|
||||
javascript = require('runner.handlers.languages.nodejs'),
|
||||
typescript = require('runner.handlers.languages.nodejs'),
|
||||
vue = require('runner.handlers.languages.nodejs'),
|
||||
}
|
||||
|
||||
return handlers
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
local helpers = require("runner.handlers.helpers")
|
||||
local utils = require("runner.handlers.utils")
|
||||
local helpers = require('runner.handlers.helpers')
|
||||
local utils = require('runner.handlers.utils')
|
||||
|
||||
return function(buffer)
|
||||
utils.run_command(utils.script_path() .. "get-scripts.sh", function(output)
|
||||
@ -14,7 +14,7 @@ return function(buffer)
|
||||
end
|
||||
|
||||
local handlers = {
|
||||
["Run current file"] = helpers.shell_handler("node " .. vim.fn.expand("%")),
|
||||
['Run current file'] = helpers.shell_handler('node ' .. vim.fn.expand('%')),
|
||||
}
|
||||
|
||||
for _, bin in pairs(bins) do
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
local helpers = require("runner.handlers.helpers")
|
||||
local utils = require("runner.handlers.utils")
|
||||
local helpers = require('runner.handlers.helpers')
|
||||
local utils = require('runner.handlers.utils')
|
||||
|
||||
return function(buffer)
|
||||
utils.run_command(utils.script_path() .. "get-bins.sh", function(output)
|
||||
|
||||
@ -23,14 +23,14 @@ M.create_window = function()
|
||||
return M._window
|
||||
end
|
||||
|
||||
if config.options.position == "right" then
|
||||
vim.cmd("botright " .. config.options.width .. " vsplit")
|
||||
elseif config.options.position == "left" then
|
||||
vim.cmd("topleft " .. config.options.width .. " vsplit")
|
||||
elseif config.options.position == "bottom" then
|
||||
vim.cmd("botright " .. config.options.height .. "split")
|
||||
elseif config.options.position == "top" then
|
||||
vim.cmd("topleft " .. config.options.height .. "split")
|
||||
if config.options.position == 'right' then
|
||||
vim.cmd('botright ' .. config.options.width .. ' vsplit')
|
||||
elseif config.options.position == 'left' then
|
||||
vim.cmd('topleft ' .. config.options.width .. ' vsplit')
|
||||
elseif config.options.position == 'bottom' then
|
||||
vim.cmd('botright ' .. config.options.height .. 'split')
|
||||
elseif config.options.position == 'top' then
|
||||
vim.cmd('topleft ' .. config.options.height .. 'split')
|
||||
end
|
||||
|
||||
local window = vim.api.nvim_get_current_win()
|
||||
@ -41,8 +41,8 @@ M.create_window = function()
|
||||
wrap = true,
|
||||
spell = false,
|
||||
foldenable = false,
|
||||
signcolumn = "no",
|
||||
colorcolumn = "",
|
||||
signcolumn = 'no',
|
||||
colorcolumn = '',
|
||||
cursorline = true,
|
||||
}
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ M.run = function(bufnr)
|
||||
else
|
||||
buffer = bufnr
|
||||
end
|
||||
local filetype = vim.filetype.match({ buf = buffer })
|
||||
local filetype = vim.filetype.match { buf = buffer }
|
||||
|
||||
local handler = M._handlers[filetype]
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user