feat(event): add WillCreateFile, WillRemoveFile (#2273)

node. These are mostly going to be useful for implementing lsp file
operation actions.

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Svetlozar Iliev
2023-06-19 03:00:55 +03:00
committed by GitHub
parent 85ece277bc
commit c3c6544ee0
5 changed files with 25 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ local find_file = require("nvim-tree.actions.finders.find-file").fn
local M = {}
local function create_and_notify(file)
events._dispatch_will_create_file(file)
local ok, fd = pcall(vim.loop.fs_open, file, "w", 420)
if not ok then
notify.error("Couldn't create file " .. file)