diff --git a/lua/possession/commands.lua b/lua/possession/commands.lua index 0488158..5821639 100644 --- a/lua/possession/commands.lua +++ b/lua/possession/commands.lua @@ -40,7 +40,7 @@ vim.api.nvim_create_autocmd('CmdlineLeave', { group = vim.api.nvim_create_augroup('possession.commands.complete', { clear = true }), callback = function() cached_names = nil - end + end, }) local function get_session_names() diff --git a/lua/possession/migrate.lua b/lua/possession/migrate.lua index cb9a25f..39ad8cd 100644 --- a/lua/possession/migrate.lua +++ b/lua/possession/migrate.lua @@ -2,7 +2,6 @@ local M = {} local Path = require('plenary.path') local session = require('possession.session') -local paths = require('possession.paths') local utils = require('possession.utils') --- Migrate mksession-based file to JSON format by loading and saving the session @@ -17,7 +16,6 @@ function M.migrate(vimscript_path, opts) local name = assert(opts.name and opts.name or vim.fn.fnamemodify(Path:new(vimscript_path):absolute(), ':t:r')) local vimscript = Path:new(vimscript_path):read() - -- Try to retrieve cwd from vimscript, fall back to getcwd local cwd for _, line in ipairs(utils.split_lines(vimscript)) do diff --git a/lua/possession/session.lua b/lua/possession/session.lua index ce816f4..4df14d9 100644 --- a/lua/possession/session.lua +++ b/lua/possession/session.lua @@ -215,6 +215,8 @@ local function save_global_options() end local function restore_global_options(options) + -- luacheck thinks vim.o.? is read-only + -- luacheck: push ignore 122 local restore = function() for opt, value in pairs(options) do vim.o[opt] = value @@ -226,6 +228,7 @@ local function restore_global_options(options) utils.try(restore, nil, function() vim.o.eventignore = eventignore end)() + -- luacheck: pop end --- Load session by name (or from raw data) @@ -400,9 +403,11 @@ function M.list(opts) -- Check for name duplicates for name, files in pairs(files_by_name) do if #files > 1 then - utils.warn('Session name "%s" found in multiple session files, please remove one of them:\n%s', + utils.warn( + 'Session name "%s" found in multiple session files, please remove one of them:\n%s', name, - table.concat(files, '\n')) + table.concat(files, '\n') + ) end end