Skip to content

Commit

Permalink
Merge pull request #8 from trunk-io/maverick/fix-nil-workspace-in-fmt
Browse files Browse the repository at this point in the history
fix: don't error in format on save if workspace is nil
  • Loading branch information
puzzler7 authored Oct 12, 2023
2 parents 7b64e87 + 0670ed2 commit 41ace70
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lua/trunk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ local function start()
local filename = vim.api.nvim_buf_get_name(0)
local workspace = findWorkspace()
-- if filename doesn't start with workspace
if filename:sub(1, #workspace) ~= workspace then
logger.debug("early exit")
if workspace == nil or filename:sub(1, #workspace) ~= workspace then
return
end
local bufname = vim.fs.basename(vim.api.nvim_buf_get_name(0))
Expand Down

0 comments on commit 41ace70

Please sign in to comment.