mirror of
https://github.com/neovide/neovide.git
synced 2026-09-10 07:16:25 -04:00
chore: format and add stylua.toml (#2823)
This commit is contained in:
parent
b277f7bc99
commit
6d0aa1acbd
|
|
@ -1,15 +1,14 @@
|
|||
local dap = require('dap')
|
||||
local dap = require("dap")
|
||||
|
||||
dap.adapters.rust = {
|
||||
type = 'server',
|
||||
type = "server",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = 'codelldb.cmd',
|
||||
command = "codelldb.cmd",
|
||||
args = { "--port", "${port}" },
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
dap.configurations.rust = {
|
||||
{
|
||||
name = "debug",
|
||||
|
|
|
|||
26
lua/init.lua
26
lua/init.lua
|
|
@ -10,7 +10,6 @@
|
|||
---@type Args
|
||||
local args = ...
|
||||
|
||||
|
||||
vim.g.neovide_channel_id = args.neovide_channel_id
|
||||
vim.g.neovide_version = args.neovide_version
|
||||
|
||||
|
|
@ -35,7 +34,7 @@ end
|
|||
local function get_clipboard(register)
|
||||
return function()
|
||||
return rpcrequest("neovide.get_clipboard", register)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if args.register_clipboard and not vim.g.neovide_no_custom_clipboard then
|
||||
|
|
@ -49,14 +48,12 @@ if args.register_clipboard and not vim.g.neovide_no_custom_clipboard then
|
|||
["+"] = get_clipboard("+"),
|
||||
["*"] = get_clipboard("*"),
|
||||
},
|
||||
cache_enabled = false
|
||||
cache_enabled = false,
|
||||
}
|
||||
vim.g.loaded_clipboard_provider = nil
|
||||
vim.cmd.runtime("autoload/provider/clipboard.vim")
|
||||
end
|
||||
|
||||
|
||||
|
||||
if args.register_right_click then
|
||||
vim.api.nvim_create_user_command("NeovideRegisterRightClick", function()
|
||||
rpcnotify("neovide.register_right_click")
|
||||
|
|
@ -70,27 +67,30 @@ vim.api.nvim_create_user_command("NeovideFocus", function()
|
|||
rpcnotify("neovide.focus_window")
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_exec([[
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
function! WatchGlobal(variable, callback)
|
||||
call dictwatcheradd(g:, a:variable, a:callback)
|
||||
endfunction
|
||||
]], false)
|
||||
]],
|
||||
false
|
||||
)
|
||||
|
||||
for _,global_variable_setting in ipairs(args.global_variable_settings) do
|
||||
for _, global_variable_setting in ipairs(args.global_variable_settings) do
|
||||
local callback = function()
|
||||
rpcnotify("setting_changed", global_variable_setting, vim.g["neovide_" .. global_variable_setting])
|
||||
end
|
||||
vim.fn.WatchGlobal("neovide_" .. global_variable_setting, callback)
|
||||
end
|
||||
|
||||
for _,option_setting in ipairs(args.option_settings) do
|
||||
for _, option_setting in ipairs(args.option_settings) do
|
||||
vim.api.nvim_create_autocmd({ "OptionSet" }, {
|
||||
pattern = option_setting,
|
||||
once = false,
|
||||
nested = true,
|
||||
callback = function()
|
||||
rpcnotify("option_changed", option_setting, vim.o[option_setting])
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
|
|
@ -100,12 +100,12 @@ vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
|||
once = true,
|
||||
nested = true,
|
||||
callback = function()
|
||||
for _,option_setting in ipairs(args.option_settings) do
|
||||
for _, option_setting in ipairs(args.option_settings) do
|
||||
if option_setting ~= "lines" and option_setting ~= "columns" then
|
||||
rpcnotify("option_changed", option_setting, vim.o[option_setting])
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Create auto command for retrieving exit code from neovim on quit.
|
||||
|
|
@ -115,5 +115,5 @@ vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
|
|||
nested = true,
|
||||
callback = function()
|
||||
rpcrequest("neovide.quit", vim.v.exiting)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
3
stylua.toml
Normal file
3
stylua.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
indent_type = "Spaces"
|
||||
indent_width = 4
|
||||
column_width = 120
|
||||
Loading…
Reference in a new issue