File tree 3 files changed +19
-0
lines changed
3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ This plugin provides the following user commands:
92
92
:AocGetTodayPuzzleInput
93
93
:AocClearCache
94
94
:AocInspectConfig
95
+ :AocReloadSession
95
96
```
96
97
97
98
### AocGetPuzzleInput
@@ -143,6 +144,15 @@ This command allows you to quickly inspect the current plugin configuration.
143
144
}
144
145
```
145
146
147
+ ### AocReloadSession
148
+
149
+ This command reloads session token should your session token change.
150
+
151
+ ``` vim
152
+ :AocReloadSession
153
+ Session token loaded
154
+ ```
155
+
146
156
## Contribution
147
157
148
158
All contributions are most welcome! Please open a PR or create an [ issue] ( https://github.com/csessh/aoc.nvim/issues ) .
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ local get_session_id = function()
46
46
47
47
local f = io.open (cfg .options .session_filepath , " r" )
48
48
if not f then
49
+ vim .api .nvim_err_writeln (" Unable to open session file" .. cfg .options .session_filepath )
49
50
return nil
50
51
end
51
52
@@ -99,4 +100,11 @@ M.save_puzzle_input = function(day, year)
99
100
end
100
101
end
101
102
103
+ M .reload_session_token = function ()
104
+ M .session_id = get_session_id ()
105
+ if M .session_id then
106
+ vim .notify " Session token reloaded"
107
+ end
108
+ end
109
+
102
110
return M
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ M.setup = function(args)
29
29
30
30
vim .api .nvim_create_user_command (" AocClearCache" , cache .clear_cache , {})
31
31
vim .api .nvim_create_user_command (" AocInspectConfig" , cfg .debug , {})
32
+ vim .api .nvim_create_user_command (" AocReloadSession" , api .reload_session_token , {})
32
33
end
33
34
34
35
return M
You can’t perform that action at this time.
0 commit comments