diff --git a/doc/canola.txt b/doc/canola.txt index 641eee5..14c6655 100644 --- a/doc/canola.txt +++ b/doc/canola.txt @@ -1135,6 +1135,22 @@ CanolaMutationComplete *CanolaMutationComp additional data fields. Use this event for post-mutation side effects such as refreshing external status indicators. +CanolaFileCreated *CanolaFileCreated* + Fired after a new file is successfully created on the local filesystem. + The `args.data.path` field contains the absolute path of the created file. + Use this event to populate initial file contents, run formatters, or + perform any other setup on newly created files. >lua + vim.api.nvim_create_autocmd("User", { + pattern = "CanolaFileCreated", + callback = function(args) + local path = args.data.path + if path:match("%.sh$") then + vim.fn.writefile({ "#!/usr/bin/env bash" }, path) + end + end, + }) +< + -------------------------------------------------------------------------------- TRASH *canola-trash* diff --git a/doc/upstream.html b/doc/upstream.html new file mode 100644 index 0000000..9c79514 --- /dev/null +++ b/doc/upstream.html @@ -0,0 +1,1231 @@ + + + + + + + upstream + + + + +

Upstream Tracker

+

+ Triage of + stevearc/oil.nvim PRs + and issues against this fork. +

+

Cherry-picked PRs

+

Upstream PRs cherry-picked or adapted into this fork.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PRDescriptionCommit
+ #495 + Cancel visual/operator-pending mode on close + 16f3d7b +
+ #537 + Configurable file/directory creation permissions + c6b4a7a +
+ #618 + Opt-in filetype detection for icons + ded1725 +
+ #644 + + Pass entry to is_hidden_file/is_always_hidden + + 4ab4765 +
+ #697 + Recipe for file extension column + dcb3a08 +
+ #698 + Executable file highlighting + 41556ec, + 85ed9b8 +
+ #717 + Add oil-git.nvim to extensions + 582d9fc +
+ #720 + Gate BufAdd autocmd behind config check + 2228f80 +
+ #722 + Fix freedesktop trash URL + b92ecb0 +
+ #723 + Emit OilReadPost event after render + 29239d5 +
+ #725 + Normalize keymap keys before config merge + 723145c +
+ #727 + Clarify get_current_dir nil + Telescope recipe + eed6697 +
+

Original fixes

+

Bugs fixed in this fork that remain open upstream.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Upstream issueDescriptionPR
+ #302 + buflisted=true after jumplist nav + #71 + (a078bcf) +
+ #632 + Preview + move = copy + #12 + (fe16993) +
+ #642 + W10 warning under nvim -R + ca834cf +
+ #670 + Multi-directory cmdline args ignored + #11 + (70861e5) +
+ #673 + Symlink newlines crash + 9110a1a +
+ #710 + buftype empty on BufEnter + #10 + (01b860e) +
+

Open upstream PRs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PRDescriptionStatus
+ #488 + Parent directory in a splitnot actionable — empty PR
+ #493 + UNC paths on Windows + not actionable — superseded by + #686 +
+ #591 + release-please changelognot applicable
+ #667 + Virtual text columns + headersdeferred — WIP, conflicting
+ #686 + Windows path conversion fixnot actionable — Windows-only
+ #708 + Move file into new dir by renamingdeferred — needs rewrite
+ #721 + create_hook to populate file contentsdeferred — addressing via autocmd event on file create
+ #728 + open_split for opening oil in a split + tracked — + #2 +
+ #735 + gX opens external program with selection + not actionable — hardcoded Linux-only program list, no config + surface, author-acknowledged incomplete +
+

Upstream issues

+

+ Status key: fixed = original fix in fork, + resolved = addressed by cherry-picked PR, + not actionable = can't/won't fix, tracking = + known/not yet addressed, open = not yet triaged. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IssueStatusNotes
+ #85 + openGit status column (P2)
+ #95 + openUndo after renaming files (P1)
+ #117 + open + Move file into new dir via slash in name (P1, related to + #708) +
+ #156 + openPaste path of files into oil buffer (P2)
+ #200 + openHighlights not working when opening a file (P2)
+ #207 + openSuppress "no longer available" message (P1)
+ #210 + openFTP support (P2)
+ #213 + openDisable preview for large files (P1)
+ #226 + openK8s/Docker adapter (P2)
+ #232 + openCannot close last window (P2)
+ #254 + openBuffer modified highlight group (P2)
+ #263 + openDiff mode (P2)
+ #276 + openArchives manipulation (P2)
+ #280 + openvim-projectionist support (P2)
+ #288 + openOil failing to load (P2)
+ #289 + openShow absolute path toggle (P2)
+ #294 + openCan't handle emojis in filenames (P2)
+ #298 + openOpen float on neovim directory startup (P2)
+ #302 + fixed + buflisted=true after jumplist nav — + #71 + (a078bcf) +
+ #303 + openPreview in float window mode (P2)
+ #325 + openoil-ssh error from command line (P0)
+ #330 + openFile opens in floating modal
+ #332 + openBuffer not fixed to floating window (P2)
+ #335 + openDisable editing outside root dir
+ #349 + openParent directory as column/vsplit (P2)
+ #351 + openPaste deleted file from register
+ #359 + openParse error on filenames differing by space (P1)
+ #360 + openPick window to open file into
+ #362 + open"Could not find oil adapter for scheme" error
+ #363 + open + prompt_save_on_select_new_entry uses wrong prompt +
+ #371 + openConstrain cursor in insert mode
+ #373 + openDir from quickfix with bqf/trouble broken (P1)
+ #375 + openHighlights for file types and permissions (P2)
+ #380 + openShow file in oil when editing hidden file
+ #382 + openRelative path in window title (P2)
+ #392 + openOption to skip delete prompt
+ #393 + openAuto-save new buffer on entry
+ #396 + openCustomize preview content (P2)
+ #399 + openOpen file without closing Oil (P1)
+ #404 + not actionableRestricted UNC paths — Windows-only (P2)
+ #416 + openCannot remap key to open split
+ #431 + openMore SSH adapter documentation
+ #435 + openError previewing with semantic tokens LSP
+ #436 + openOwner and group columns (P2)
+ #444 + openOpening behaviour customization
+ #446 + resolved + Executable highlighting — PR + #698 +
+ #449 + openRenaming TypeScript files stopped working
+ #450 + openHighlight opened file in directory listing
+ #457 + openCustom column API
+ #466 + openSelect into window on right
+ #473 + openShow all hidden files if dir only has hidden
+ #479 + openHarpoon integration recipe
+ #483 + not actionable + Spell downloads depend on netrw — fixed in + neovim#34940 +
+ #486 + openAll directory sizes show 4.1k
+ #492 + not actionablej/k remapping question — answered in comments
+ #507 + openlacasitos.nvim conflict (P1)
+ #521 + openoil-ssh connection issues
+ #525 + openSSH adapter documentation (P2)
+ #531 + not actionableWindows — incomplete drive letters (P1)
+ #533 + not actionableconstrain_cursor — needs repro
+ #570 + openImprove c0/d0 for renaming
+ #571 + openCallback before highlight_filename (P2)
+ #578 + resolved + Hidden file dimming recipe — + 38db6cf +
+ #587 + not actionableAlt+h keymap — user config issue
+ #599 + openuser:group display and manipulation (P2)
+ #607 + openPer-host SCP args (P2)
+ #609 + openCursor placement via Snacks picker
+ #612 + fixed + Delete buffers on file delete — + cleanup_buffers_on_delete option +
+ #615 + openCursor at name column on o/O (P2)
+ #617 + openFiletype by actual filetype (P2)
+ #621 + openToggle function for regular windows (P2)
+ #623 + not actionablebufferline.nvim interaction — cross-plugin
+ #624 + not actionableMutation race — no reliable repro
+ #625 + not actionable + E19 mark invalid line — intractable without neovim API changes +
+ #632 + fixed + Preview + move = copy — + #12 + (fe16993) +
+ #636 + openTelescope picker opens in active buffer
+ #637 + openInconsistent symlink resolution
+ #641 + openFlicker on actions.parent
+ #642 + fixed + W10 warning under nvim -R — + ca834cf +
+ #645 + resolved + close_float action — + f6bcdda +
+ #646 + openget_current_dir nil on SSH
+ #650 + openEmit LSP workspace.fileOperations events
+ #655 + openFile statistics as virtual text
+ #659 + openMark and diff files in buffer
+ #664 + not actionableSession reload extra buffer — no repro
+ #665 + openHot load preview fast-scratch buffers
+ #668 + openCustom yes/no confirmation
+ #670 + fixed + Multi-directory cmdline — + #11 + (70861e5) +
+ #671 + openYanking between nvim instances
+ #673 + fixed + Symlink newlines crash — + 9110a1a +
+ #675 + open + Move file into folder by renaming (related to + #708) +
+ #676 + not actionableWindows — path conversion
+ #678 + tracking + buftype='acwrite' causes mksession to skip + oil windows +
+ #679 + resolved + Executable file sign — PR + #698 +
+ #682 + openget_current_dir() nil in non-telescope context
+ #683 + openPath not shown in floating mode
+ #684 + openUser and group columns
+ #685 + openPlain directory paths in buffer names
+ #690 + resolved + OilFileIcon highlight group — + ce64ae1 +
+ #692 + resolved + Keymap normalization — PR + #725 +
+ #699 + openselect blocks UI with slow FileType autocmd
+ #707 + open + Move file/dir into new dir by renaming (related to + #708) +
+ #710 + fixed + buftype empty on BufEnter — + #10 + (01b860e) +
+ #714 + not actionableSupport question — answered
+ #719 + not actionableNeovim crash on node_modules — libuv/neovim bug
+ #726 + not actionableMeta discussion/roadmap
+ #736 + openfeature request: make icons virtual text
+ + + diff --git a/lua/canola/adapters/files.lua b/lua/canola/adapters/files.lua index 3bb8a89..dff8e1a 100644 --- a/lua/canola/adapters/files.lua +++ b/lua/canola/adapters/files.lua @@ -600,7 +600,19 @@ M.perform_action = function(action, cb) ---@diagnostic disable-next-line: param-type-mismatch uv.fs_symlink(target, path, flags, cb) else - fs.touch(path, config.new_file_mode, cb) + fs.touch( + path, + config.new_file_mode, + vim.schedule_wrap(function(err) + if not err then + vim.api.nvim_exec_autocmds( + 'User', + { pattern = 'CanolaFileCreated', modeline = false, data = { path = path } } + ) + end + cb(err) + end) + ) end elseif action.type == 'delete' then local _, path = util.parse_url(action.url)