Skip to content

Commit

Permalink
add .editorconfig and .stylua.toml files
Browse files Browse the repository at this point in the history
  • Loading branch information
icholy committed Mar 10, 2024
1 parent 8427385 commit a4dd234
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*.lua]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
2 changes: 2 additions & 0 deletions .stylua.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
indent_type = "Spaces"
indent_width = 2
21 changes: 7 additions & 14 deletions lua/lsplinks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit a4dd234

Please sign in to comment.