olimorris / persisted.nvim

💾 Simple session management for Neovim with git branching, autoloading and Telescope support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing to Detect Git Branch Correctly

bnwa opened this issue · comments

commented

I installed persisted.nvim on my experimental dotfiles branch but the plugin still assigns the default branch name (main) to the session entry instead of the name of the branch.

The config is more or less a duplicate of what's in the README:

  use { 'olimorris/persisted.nvim',
        config = function ()
          require('persisted').setup {}
          require('telescope').load_extension 'persisted'
        end
      }
commented

Hey and thanks for raising an issue. It looks like you don't have git branching enabled and hence aren't seeing this reflected.

use_git_branch = true

The plugin appends main to every session unless git tells it otherwise.

commented

LMAO I must've misread the flag as default true, thanks for pointing it out

commented

No problem 😉. There's a very good case for it being on by default tbh!