forked from rmagatti/auto-session
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rmagatti#334 from cameronr/percent-encode
Overhauled vim cmds and percent encoding session file names
- Loading branch information
Showing
35 changed files
with
2,182 additions
and
1,241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
local AutoSession = require "auto-session" | ||
|
||
local M = {} | ||
|
||
---@diagnostic disable-next-line: deprecated | ||
local start = vim.health.start or vim.health.report_start | ||
---@diagnostic disable-next-line: deprecated | ||
local ok = vim.health.ok or vim.health.report_ok | ||
---@diagnostic disable-next-line: deprecated | ||
local warn = vim.health.warn or vim.health.report_warn | ||
---@diagnostic disable-next-line: deprecated, unused-local | ||
local error = vim.health.error or vim.health.report_error | ||
---@diagnostic disable-next-line: deprecated | ||
local info = vim.health.info or vim.health.report_info | ||
|
||
local function check_sesssion_options() | ||
if not vim.tbl_contains(vim.split(vim.o.sessionoptions, ","), "localoptions") then | ||
warn( | ||
"`vim.o.sessionoptions` should contain 'localoptions' to make sure\nfiletype and highlighting work correctly after a session is restored.\n\n" | ||
.. "Recommended setting is:\n\n" | ||
.. 'vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"\n' | ||
) | ||
else | ||
ok "vim.o.sessionoptions" | ||
end | ||
end | ||
|
||
function M.check() | ||
start "auto-session" | ||
|
||
info("Session directory: " .. AutoSession.get_root_dir()) | ||
info("Current session: " .. AutoSession.Lib.current_session_name()) | ||
info("Current sesssion file: " .. vim.v.this_session) | ||
check_sesssion_options() | ||
end | ||
|
||
return M |
Oops, something went wrong.