From a4dd2347ff472bfb20da07dcf20b82fb2faa834e Mon Sep 17 00:00:00 2001 From: Ilia Choly Date: Sun, 10 Mar 2024 11:28:34 -0400 Subject: [PATCH] add .editorconfig and .stylua.toml files --- .editorconfig | 7 +++++++ .stylua.toml | 2 ++ lua/lsplinks.lua | 21 +++++++-------------- 3 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 .editorconfig create mode 100644 .stylua.toml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1b922a7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*.lua] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 diff --git a/.stylua.toml b/.stylua.toml new file mode 100644 index 0000000..0435f67 --- /dev/null +++ b/.stylua.toml @@ -0,0 +1,2 @@ +indent_type = "Spaces" +indent_width = 2 diff --git a/lua/lsplinks.lua b/lua/lsplinks.lua index d7c62b4..c5f061b 100644 --- a/lua/lsplinks.lua +++ b/lua/lsplinks.lua @@ -61,9 +61,9 @@ local augroup = api.nvim_create_augroup("lsplinks", { clear = true }) --- Setup autocommands for refreshing links function M.setup() - api.nvim_create_autocmd({"InsertLeave", "BufEnter", "CursorHold", "LspAttach"}, { + api.nvim_create_autocmd({ "InsertLeave", "BufEnter", "CursorHold", "LspAttach" }, { group = augroup, - callback = M.refresh + callback = M.refresh, }) vim.keymap.set("n", "gx", M.gx) end @@ -185,18 +185,11 @@ function M.display() for _, link in ipairs(M.get()) do -- sometimes the buffer is changed before we get here and the link -- ranges are invalid, so we ignore the error. - pcall( - api.nvim_buf_set_extmark, - 0, - ns, - link.range.start.line, - link.range.start.character, - { - end_row = link.range["end"].line, - end_col = link.range["end"].character, - hl_group="Underlined" - } - ) + pcall(api.nvim_buf_set_extmark, 0, ns, link.range.start.line, link.range.start.character, { + end_row = link.range["end"].line, + end_col = link.range["end"].character, + hl_group = "Underlined", + }) end end