Skip to content

bug: gitsigns and dropbar do not load #69

@serhez

Description

@serhez

Did you check the docs and existing issues?

  • I have read the docs
  • I have searched the existing issues

Neovim version (nvim -v)

0.10.0

Operating system/version

MacOS 14.4.1

Describe the bug

I just started using resession as a replacement for another session plugin I used previously. One thing I noticed is that plugins such as gitsigns and dropbar do not load on startup when using resession. Once I use :e, for example, they load. Below, I attach a video showcasing the bug and my config.

Screen.Recording.2024-09-04.at.15.01.58.mov

What is the severity of this bug?

breaking (some functionality is broken)

Steps To Reproduce

As seen in the video.

Expected Behavior

This plugin should not interfere with the loading of other plugins.

Directory structure

No response

Repro

local M = {
	"stevearc/resession.nvim",
	lazy = false,
	cond = not vim.g.started_by_firenvim and not vim.g.vscode,
}

function M.config()
	local resession = require("resession")

	resession.setup({
		-- Options for automatically saving sessions on a timer
		autosave = {
			enabled = false,
			-- How often to save (in seconds)
			interval = 60,
			-- Notify when autosaved
			notify = true,
		},
		-- Save and restore these options
		options = {
			"binary",
			"bufhidden",
			"buflisted",
			"cmdheight",
			"diff",
			"filetype",
			"modifiable",
			"previewwindow",
			"readonly",
			"scrollbind",
			"winfixheight",
			"winfixwidth",
		},
		-- Custom logic for determining if the buffer should be included
		buf_filter = require("resession").default_buf_filter,
		-- Show more detail about the sessions when selecting one to load.
		-- Disable if it causes lag.
		load_detail = true,
		-- List order ["modification_time", "creation_time", "filename"]
		load_order = "modification_time",
		-- Configuration for extensions
		extensions = {
			quickfix = {},
			hbac = {},
			oil = {},
		},
	})

	local function get_session_name()
		local name = vim.fn.getcwd()
		local branch = vim.trim(vim.fn.system("git branch --show-current"))
		if vim.v.shell_error == 0 then
			return name .. branch
		else
			return name
		end
	end
	vim.api.nvim_create_autocmd("VimEnter", {
		callback = function()
			-- Only load the session if nvim was started with no args
			if vim.fn.argc(-1) == 0 then
				resession.load(get_session_name(), { dir = "dirsession", silence_errors = true })
			end
		end,
	})
	vim.api.nvim_create_autocmd("VimLeavePre", {
		callback = function()
			resession.save(get_session_name(), { dir = "dirsession", notify = true })
		end,
	})
end

return M

Did you check the bug with a clean config?

  • I have confirmed that the bug reproduces with nvim -u repro.lua using the repro.lua file above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Not a priority. PRs welcomebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions