Skip to content

Commit

Permalink
Merge pull request #185 from ckipp01/valid
Browse files Browse the repository at this point in the history
Ensure scala file is on disk
  • Loading branch information
ckipp01 authored Jul 19, 2021
2 parents 4c9ed42 + d4ac631 commit 32fc0b1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/metals/setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ end
-- as we come across them.
local function invalid_scala_file()
local name = vim.api.nvim_buf_get_name(0)
if vim.startswith(name, "fugitive://") or vim.startswith(name, "gitsigns://") then
if not vim.loop.fs_stat(name) then
return true
else
return false
Expand Down Expand Up @@ -340,9 +340,9 @@ M.auto_commands = function()
api.nvim_command([[augroup NvimMetals]])
api.nvim_command([[autocmd!]])
api.nvim_command([[autocmd BufEnter * lua require("metals").did_focus()]])
api.nvim_command([[autocmd CursorHold *.scala lua vim.lsp.buf.document_highlight()]])
api.nvim_command([[autocmd CursorMoved *.scala lua vim.lsp.buf.clear_references()]])
api.nvim_command([[autocmd BufEnter,CursorHold,InsertLeave *.scala lua vim.lsp.codelens.refresh()]])
api.nvim_command([[autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()]])
api.nvim_command([[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]])
api.nvim_command([[autocmd BufEnter,CursorHold,InsertLeave <buffer> lua vim.lsp.codelens.refresh()]])
api.nvim_command([[augroup end]])
end

Expand Down

0 comments on commit 32fc0b1

Please sign in to comment.