File tree Expand file tree Collapse file tree 5 files changed +25
-8
lines changed Expand file tree Collapse file tree 5 files changed +25
-8
lines changed Original file line number Diff line number Diff line change 1
- return {
1
+ local defaults = {
2
2
autostart = true , -- Automatically start the plugin on load?
3
3
4
4
-- Function to determine if a session should be saved
@@ -33,3 +33,22 @@ return {
33
33
},
34
34
},
35
35
}
36
+
37
+ local M = {
38
+ config = vim .deepcopy (defaults ),
39
+ }
40
+
41
+ --- @param opts ? table
42
+ M .setup = function (opts )
43
+ opts = opts or {}
44
+ M .config = vim .tbl_deep_extend (" force" , vim .deepcopy (defaults ), opts )
45
+ end
46
+
47
+ return setmetatable (M , {
48
+ __index = function (_ , key )
49
+ if key == " setup" then
50
+ return M .setup
51
+ end
52
+ return rawget (M .config , key )
53
+ end ,
54
+ })
Original file line number Diff line number Diff line change
1
+ local config = require (" persisted.config" )
1
2
local utils = require (" persisted.utils" )
2
3
3
4
local M = {}
4
5
5
- local config
6
6
local start_args = vim .fn .argc () > 0 or vim .g .started_with_stdin
7
7
8
8
local e = vim .fn .fnameescape
220
220
--- Setup the plugin
221
221
--- @param opts ? table
222
222
function M .setup (opts )
223
- config = vim .tbl_deep_extend (" force" , require (" persisted.config" ), opts or {})
224
- M .config = config
223
+ config .setup (opts )
225
224
226
225
vim .fn .mkdir (config .save_dir , " p" )
227
226
Original file line number Diff line number Diff line change @@ -7,10 +7,9 @@ local _actions = require("telescope._extensions.persisted.actions")
7
7
local _finders = require (" telescope._extensions.persisted.finders" )
8
8
9
9
local persisted = require (" persisted" )
10
+ local config = require (" persisted.config" )
10
11
local utils = require (" persisted.utils" )
11
12
12
- local config = persisted .config
13
-
14
13
local telescope_opts = {}
15
14
16
15
--- Escapes special characters before performing string substitution
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ local actions_state = require("telescope.actions.state")
2
2
local transform_mod = require (" telescope.actions.mt" ).transform_mod
3
3
4
4
local persisted = require (" persisted" )
5
- local config = persisted .config
5
+ local config = require ( " persisted.config" )
6
6
7
7
local M = {}
8
8
Original file line number Diff line number Diff line change 1
- local config = require (" persisted" ) .config
1
+ local config = require (" persisted.config" )
2
2
local finders = require (" telescope.finders" )
3
3
4
4
local M = {}
You can’t perform that action at this time.
0 commit comments