irongit

A Neovim plugin enabling you to solve LeetCode problems.

Allow users to wipe buffers before running :Leet

Optional and enabled by default with config field allow_bufwipe
huncholanehuncholaneauthored
parent 10f63d6commit 1de7d42d169b6ea13032b94fcce66aeec6f4bbc4Browse files

3 files changed, +12 -0

+4-0README.md
@@ -160,6 +160,10 @@ To see full configuration types see [template.lua](./lua/leetcode/config/templat
160160
161161 ---@type boolean
162162 image_support = false,
163+
164+ ---Wipes buffers just before opening with :Leet
165+ ---@type boolean
166+ allow_bufwipe = true,
163167 }
164168 ```
165169
+4-0lua/leetcode/command/init.lua
@@ -169,6 +169,10 @@ function cmd.random_question(opts)
169169 end
170170
171171 function cmd.start_with_cmd()
172+ if require("leetcode.config").user.allow_bufwipe then
173+ vim.cmd([[silent %bd]])
174+ end
175+
172176 local leetcode = require("leetcode")
173177 if leetcode.start(false) then
174178 cmd.menu()
+4-0lua/leetcode/config/template.lua
@@ -137,6 +137,10 @@ local M = {
137137
138138 ---@type boolean
139139 image_support = false,
140+
141+ ---Wipes buffers just before opening with :Leet
142+ ---@type boolean
143+ allow_bufwipe = true,
140144 }
141145
142146 return M