Skip to content

Commit 65ff324

Browse files
committed
feat: restore unmap_keys
1 parent 02ec372 commit 65ff324

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lua/better_escape.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,16 @@ local function map_keys()
187187
end
188188
end
189189

190+
-- TODO: update this
191+
local function unmap_keys()
192+
for mode, keys in pairs(mapped_keys) do
193+
for key, _ in pairs(mapped_keys) do
194+
pcall(vim.keymap.del, key)
195+
end
196+
end
197+
mapped_keys = {}
198+
end
199+
190200
function M.setup(update)
191201
if update and update.default_mappings == false then
192202
settings.mappings = {}
@@ -214,6 +224,7 @@ function M.setup(update)
214224
settings.keys
215225
end
216226
end
227+
unmap_keys()
217228
map_keys()
218229
end
219230

0 commit comments

Comments
 (0)