Big Refactor #145
olimorris
announced in
Announcements
Replies: 3 comments 6 replies
-
Seems like a sound decision Oli! I take it |
Beta Was this translation helpful? Give feedback.
4 replies
-
Following the guide you linked, this is what I have to achieve the previous behavior, -- Persisted does not autoload unless nvim is opened with a file. This
-- will force auto-loading if nvim has no arguments or is passed a
-- single argument that is a directory, otherwise persisted will kick in
-- like normal.
vim.api.nvim_create_autocmd("VimEnter", {
nested = true,
callback = function()
if vim.g.started_with_stdin then
return
end
local forceload = false
if vim.fn.argc() == 0 then
forceload = true
elseif vim.fn.argc() == 1 then
local dir = vim.fn.expand(vim.fn.argv(0))
if dir == '.' then
dir = vim.fn.getcwd()
end
if vim.fn.isdirectory(dir) ~= 0 then
forceload = true
end
end
persisted.autoload({ force = forceload })
end,
}) |
Beta Was this translation helpful? Give feedback.
1 reply
-
@olimorris could you also include in your description above that the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
tl;dr
What’s the impact?
Config items and/or features that have been removed:
default_branch
removedbranch_separator
removed (I've searched GitHub and reached out to the two users it may impact)silent
removedtelescope.reset_prompt
removedautosave
becomesautostart
(backwards compatible)should_autosave
becomesshould_save
(backwards compatible)PersistedStateChange
hook has been renamed toPersistedStart
andPersistedStop
(thanks @neandrake)ignored_branches
removedRegarding the removal of autoloading with args (7944b9a) and ignored branches (ce9d621); this added a lot of bloat to the plugin and is something that is relatively trivial to add to a user's config. As a result, I've outlined how to accomplish both of these in the README.
I've made all the functions in the
init.lua
andutils.lua
files public. This allows you to extend the plugin to suit your needs without having to merge any PRs (hopefully!). Settingautostart = false
, a user can perform some logic and other steps before usingpersisted.start()
.Future deprecations
A heads up for people who have copied the plugin's config and placed it in their config...soon, the following settings will cause an error:
To resolve this, simply delete them or set them to
{}
.Beta Was this translation helpful? Give feedback.
All reactions