Skip to content

Commit

Permalink
fix(nvim): Strip newlines from session file names
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Aug 28, 2023
1 parent 762721c commit 8d2f797
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions nvim/lua/my/configure/session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ return {
local function get_session_name()
local name = vim.fn.getcwd()
local branch = vim.fn.system('git branch --show-current')
if vim.v.shell_error == 0 then
return name .. branch
else
return name
if vim.v.shell_error ~= 0 then
branch = ''
end
vim.trim(string.format('%s%s', name, branch))
end

local resession = require('resession')
Expand Down

0 comments on commit 8d2f797

Please sign in to comment.