From 0540d52ba64d0ec7677ec1ef14b3624c95a2aaba Mon Sep 17 00:00:00 2001 From: jonatashashimoto <74205244+jonatashashimoto@users.noreply.github.com> Date: Thu, 9 May 2024 01:31:01 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20added=20bookmark=5Fclear=5F?= =?UTF-8?q?all=20method=20(#23)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + lua/bookmarks/actions.lua | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 3f0fc4b..ced46f8 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ require('bookmarks').setup { map("n","mn",bm.bookmark_next) -- jump to next mark in local buffer map("n","mp",bm.bookmark_prev) -- jump to previous mark in local buffer map("n","ml",bm.bookmark_list) -- show marked file list in quickfix window + map("n","mx",bm.bookmark_clear_all) -- removes all bookmarks end } ``` diff --git a/lua/bookmarks/actions.lua b/lua/bookmarks/actions.lua index e87c2ad..97c9c22 100644 --- a/lua/bookmarks/actions.lua +++ b/lua/bookmarks/actions.lua @@ -1,4 +1,5 @@ local config = require("bookmarks.config").config +local schema = require("bookmarks.config").schema local uv = vim.loop local Signs = require "bookmarks.signs" local utils = require "bookmarks.util" @@ -208,4 +209,9 @@ function M.saveBookmarks() end end +function M.bookmark_clear_all() + config.cache = schema.cache.default + M.saveBookmarks() +end + return M