Problem: the is_hidden_file and is_always_hidden config callbacks
only received (name, bufnr), making it impossible to filter by entry
type, permissions, or other metadata without reimplementing entry
lookup.
Solution: pass the full oil.Entry as a third argument to both
callbacks. Existing configs that only accept (name, bufnr) are
unaffected since Lua silently ignores extra arguments. The internal
should_display function signature changes from (name, bufnr) to
(bufnr, entry) to reflect its new contract.
Cherry-picked from: stevearc/oil.nvim#644
Problem: when close() is triggered from visual or operator-pending
mode (e.g. pressing q after d in an oil buffer), the buffer closes
instead of canceling the pending operation. This happens because
keymaps without an explicit mode default to "" which covers normal,
visual, select, and operator-pending modes.
Solution: check the current mode at the top of close() and send
<Esc> to cancel the mode instead of proceeding with the close. The
check covers all visual modes (v, V, CTRL-V), select modes (s, S,
CTRL-S), and operator-pending submodes (no, nov, noV, noCTRL-V).
Based on: stevearc/oil.nvim#495
Problem: third-party plugins like oil-git-status.nvim had no way to
know when an oil buffer was re-rendered after a filesystem change,
causing their decorations to be cleared with no signal to refresh.
Solution: emit a User OilReadPost autocmd after every successful
render_buffer_async call. Also document all oil user events
(OilEnter, OilReadPost, OilMutationComplete) in oil.txt since none
were previously documented.
Cherry-picked from: stevearc/oil.nvim#723
Problem: the BufAdd autocmd that hijacks directory buffers was always
created, even when default_file_explorer was false. The guard inside
maybe_hijack_directory_buffer made it a no-op, but the autocmd still
fired on every BufAdd event.
Solution: wrap the BufAdd autocmd creation and initial buffer hijack
in a config.default_file_explorer conditional. The guard inside
maybe_hijack_directory_buffer is kept as defense-in-depth.
Based on: stevearc/oil.nvim#720
Problem: user keymap overrides like <c-t> failed to replace the
default <C-t> because the keys were compared as raw strings during
merge, leaving both entries in the table.
Solution: use nvim_replace_termcodes to compare keymap keys by their
internal representation, removing any default entry that normalizes
to the same key as the user-provided one before inserting it.
Closes#692
Cherry-picked from: stevearc/oil.nvim#725
Problem: get_current_dir returns nil in several cases that were not
documented, causing confusion when used in keymaps that open pickers
like Telescope (#682). Also, posix_to_os_path could crash on Windows
when no drive letter is found.
Solution: expand get_current_dir docs to explain nil return cases, add
a Telescope recipe with nil guards, and add a defensive nil check in
posix_to_os_path.
Cherry-picked from: stevearc/oil.nvim#727
Problem: the old URL specifications.freedesktop.org/trash-spec/1.0/ is
dead and redirects or 404s.
Solution: update to the current URL trash/1.0/ in docs, source, and
the generation script.
Cherry-picked from: stevearc/oil.nvim#722
* feat: `toggle_float` now takes the same params as `open_float`
* docs: update `toggle_float` docs for `opts` and `cb` params
* fix: ensure cb is always called
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
* feat: add support for column text alignment
* refactor(util): replace rpad with pad_align
* refactor(columns): whitespace handling in parse_col
* refactor: small changes
* doc: add align option to doc generation
* refactor: replace lpad with pad_align
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
The `complete` callback checks `err` instead of `err2`, but `err` is
always nil inside the `elseif entries` branch. This silently ignores
child operation errors, causing misleading "directory not empty" failures.
* Added s3 support
* Save work
* Various bug fixes
* Minor cleanup
* Minor bug fixes
* Fix typo
* Update following feedback + minor bug fix
* Fix CI
* Cleanup and remove bucket entry_type
* Make suggested changes
* Better aws existence check
* Fix typo
* refactor: don't bother caching aws executable status
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
Neovim 0.11 introduced the winborder option, which serves the same purpose. By defaulting the border to nil, we will use whatever value the user has configured with winborder.
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
* fix: support natural ordering for numbers with >12 digits
Changes the column ordering code when `view_options.natural_order`
is enabled, so that it can support larger numbers.
The previous 12-digit padding approach breaks for numbers above 12
digits.
This length-prefixed approach can scale to much higher numbers.
I picked %03 (padding 3 digits) because most filesystems don't allow
more than 255 bytes in a path segment, and "255" is 3 digits long.
* add memoization to natural order sorting
* remove call to unpack
* feat: copy/paste to system clipboard on macOS
* stylua
* feat: copy/paste to system clipboard on linux
* force mime type
* fix string.gsub
* vim.uv or vim.loop
* fix stylua
* support gnome directly
* support wayland
* refactor: extract clipboard actions into separate file
* fix: copy/paste in KDE
* refactor: simplify file loading
* fix: copy/paste on x11
* fix: better error message when clipboard command not found
* fix: paste on mac
* fix: pasting in Gnome
* feat: support pasting multiple files
* feat: support copying multiple files to clipboard
---------
Co-authored-by: Steve Walker <65963536+etherswangel@users.noreply.github.com>
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
* pass bufnr to the constrain_cursor
* return early if the oil buffer is not the current buffer
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
* fix bug of disable_preview
file should not loaded if disable_preview is true
* refeactor function open_preview about disable_preview
switch the condition checking `disable_preview` of `if`
move the longer condition to the `elseif`
swap their repective code blocks to maintain the same functionality
* refactor: simplify conditionals
* fix: missing then
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>