Commit graph

78 commits

Author SHA1 Message Date
4ab4765a84 feat: pass entry to is_hidden_file and is_always_hidden callbacks
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
2026-02-20 16:29:08 -05:00
29239d56fb feat: emit OilReadPost user event after each buffer render
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
2026-02-20 16:27:09 -05:00
malewicz1337
6b59a6cf62
feat: add support for column text alignment (#711)
* 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>
2026-01-13 21:28:16 -08:00
jake-stewart
756dec855b
feat: support multicursor.nvim (#696)
* support multicursor.nvim

* lint: apply stylua

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2025-12-21 12:26:10 -08:00
XeroOl
07f80ad645
fix: support natural ordering for numbers with >12 digits (#652)
* 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
2025-08-20 18:22:30 -07:00
skshetry
54fe7dca36
fix: pass bufnr to constrain_cursor (#574)
* 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>
2025-03-04 16:44:26 -08:00
Steven Arcangeli
d7c61c7084 fix: silent handling when buffer has no oil adapter (#573) 2025-03-04 12:57:01 -08:00
Ian Wright
8abc58b038
feat: add support for bufnr in column rendering functions (#575)
This is primarily for user-defined custom columns, which may want access
to the current path or similar information
2025-02-12 16:49:43 -08:00
Steven Arcangeli
c80fa5c415 fix: more consistent cursor position when entering a new directory (#536) 2025-01-22 15:10:41 -08:00
Ian Wright
f5c563a074
feat: pass oil bufnr to custom filename highlight function (#552)
This enables you to determine the full directory path, enabling e.g.,
HL groups for Git
2025-01-07 18:56:03 -08:00
Ian Wright
a6a4f48b14
fix: directory rendering with custom highlights (#551)
These would loose their trailing '/', making them unusable
2025-01-06 21:11:10 -08:00
Steven Arcangeli
dba0375988 fix: handle files with newlines in the name (#534) 2024-12-10 15:22:24 -08:00
Steven Arcangeli
da93d55e32 fix: work around performance issue with treesitter, folds, and large directories 2024-11-24 15:04:00 -08:00
Foo-x
99ce32f4a2
feat: config option to customize filename highlight group (#508)
* feat: highlight config

Refs #402

* perf: minimize perf impact when option not provided

* doc: regenerate documentation

* fix: symbolic link rendering

* refactor: simplify conditional

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-11-22 10:23:08 -08:00
Ezekiel Warren
60e68967e5
feat: highlight groups for hidden files (#459)
* feat: hidden highlights

* feat: OilHidden for hidden highlights instead of Comment

* fix: add the new combinatoric highlight groups

* perf: get rid of a call to is_hidden_file

* fix: tweak the default highlight group links

* fix: update function call in unit tests

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-11-22 08:55:55 -08:00
Foo-x
740b8fd425
feat: add highlight group for orphaned links (#502)
* feat: add highlight for orphan links

Closes #501

* feat: add OilOrphanLinkTarget highlight group

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-11-22 08:17:50 -08:00
Steven Arcangeli
8ea40b5506 fix: cursor sometimes does not hover previous file 2024-11-14 22:21:11 -08:00
Steven Arcangeli
c96f93d894 perf: optimize rendering cadence 2024-11-14 19:29:22 -08:00
Steven Arcangeli
792f0db6ba perf: only sort entries after we have them all 2024-11-14 19:29:22 -08:00
Steven Arcangeli
01b0b9d8ef perf: change default view_options.natural_order behavior to disable on large directories 2024-11-14 19:29:22 -08:00
Micah Halter
bbeed86bde
feat: add win_options to preview_win (#514) 2024-11-12 10:38:35 -08:00
Steven Arcangeli
eb5497f0ac refactor: rename 'preview' config to 'preview_win' 2024-11-10 15:57:31 -08:00
Steven Arcangeli
1f5b002270 refactor: rename action preview window to 'confirmation' window 2024-11-10 15:57:27 -08:00
Steven Arcangeli
1fe476daf0 doc: more and better type annotations 2024-08-30 17:50:09 -07:00
csponge
30e0438ff0
fix: ensure win_options are being set on correct window (#469)
* Added check for filetype before setting win_options in initialize

* refactor: use nvim_buf_call to set window options

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2024-08-28 17:54:03 -07:00
Micah Halter
0fcd1263a2
perf(view): avoid running is_hidden_file when show_hidden is set (#471) 2024-08-28 17:13:57 -07:00
Julian
b39a78959f
fix: add compatibility for Lua 5.1 (#456)
Some architectures don't support LuaJIT.
Remove the goto's from the code to be compatible
with Neovim built without LuaJIT.

Signed-off-by: Julian Ruess <julianonline+github@posteo.de>
2024-08-16 21:33:59 -07:00
Steven Arcangeli
fcca212c2e fix: handle rare case where file watcher outlives buffer 2024-07-29 17:12:25 -07:00
Steven Arcangeli
c7c7ce5bd4 feat: rename experimental_watch_for_changes -> watch_for_changes
I've been using this for a while now and haven't seen any issues. We can
take "experimental" out of the name.
2024-07-01 11:34:04 -07:00
Steven Arcangeli
f6df58ad37 fix: bug in buffer rendering race condition handling 2024-06-20 22:45:28 -04:00
Steven Arcangeli
15e071f203 ci: typechecking no longer requires neodev 2024-06-01 16:38:11 -07:00
csponge
8ac4ba4e0a
Return from delete_hidden_buffers when win type is command (#394)
* Return from delete_hidden_buffers when win type is command

* lint: apply stylua formatting

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-06-01 12:39:14 -07:00
Steven Arcangeli
f41d7e7cd8 fix: support visual mode when preview window is open (#315) 2024-04-19 16:31:42 -04:00
Lucas Eras Paiva
71b076b3af
feat: use natural sort order by default (#328)
* Sort entries with natural sorting

* refactor: move natural ordering logic and add config option

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-03-12 19:21:54 -07:00
Steven Arcangeli
c437f3c5b0 fix: potential leak in experimental file watcher 2024-03-02 18:56:18 -08:00
Steven Arcangeli
bcfe7d1ec5 feat: experimental option to watch directory for changes (#292) 2024-02-19 23:27:27 -08:00
Steven Arcangeli
71b1ef5edf feat: constrain_cursor option (closes #257) 2023-12-23 19:16:53 -05:00
Steven Arcangeli
a60c6d10fd fix: constrain cursor when entering insert mode
The main use case for this is hitting `I` from normal mode will now put
the cursor in insert mode at the beginning of the first editable column.
2023-12-23 19:02:09 -05:00
umlx5h
ea612fe926
feat: add 'update_on_cursor_moved' option to preview window (#250) 2023-12-09 19:02:04 -08:00
Steven Arcangeli
303f31895e fix: buffer data cleared when setting buflisted = false
For posterity: this was a very painful lesson. Turns out "BufDelete"
doesn't mean "buffer was deleted", it means "buffer was deleted from the
buffer list". If you set nobuflisted, BufDelete will be triggered even
though the buffer is still loaded and active.
2023-11-19 21:10:41 -08:00
Steven Arcangeli
4df43ad5f5 test: fix flaky tests 2023-11-19 21:02:06 -08:00
Steven Arcangeli
af13ce333f fix: quit after mutations when :wq or similar (#221) 2023-11-13 10:46:08 -08:00
Steven Arcangeli
6175bd6462
feat: trash support for linux and mac (#165)
* wip: skeleton code for trash adapter

* refactor: split trash implementation for mac and linux

* fix: ensure we create the .Trash/$uid dir

* feat: code complete linux trash implementation

* doc: write up trash features

* feat: code complete mac trash implementation

* cleanup: remove previous, terrible, undocumented trash feature

* fix: always disabled trash

* feat: show original path of trashed files

* doc: add a note about calling actions directly

* fix: bugs in trash implementation

* fix: schedule_wrap in mac trash

* doc: fix typo and line wrapping

* fix: parsing of arguments to :Oil command

* doc: small documentation tweaks

* doc: fix awkward wording in the toggle_trash action

* fix: warning on Windows when delete_to_trash = true

* feat: :Oil --trash can open specific trash directories

* fix: show all trash files in device root

* fix: trash mtime should be sortable

* fix: shorten_path handles optional trailing slash

* refactor: overhaul the UI

* fix: keep trash original path vtext from stacking

* refactor: replace disable_changes with an error filter

* fix: shorten path names in home directory relative to root

* doc: small README format changes

* cleanup: remove unnecessary preserve_undo logic

* test: add a functional test for the freedesktop trash adapter

* test: more functional tests for trash

* fix: schedule a callback to avoid main loop error

* refactor: clean up mutator logic

* doc: some comments and type annotations
2023-11-05 12:40:58 -08:00
Steven Arcangeli
d8f0d91b10 feat: display ../ entry in oil buffers (#166) 2023-11-05 08:00:38 -08:00
Steven Arcangeli
2e6996b075 fix: disable swapfile for oil buffers (#190) 2023-11-01 08:09:04 -07:00
vE5li
a9f7f6927d
feat: make buffer cleanup delay configurable (#191) 2023-10-03 09:08:28 -07:00
Steven Arcangeli
977da9ac66 feat: keymaps can specify mode (#187) 2023-09-28 09:18:15 -07:00
Steven Arcangeli
9e036c6a48 cleanup: remove unnecessary option restore_win_options
This was only necessary to begin with because I was using `vim.wo` to
set window options. I mistakenly thought that would set the option as
window-local, but it did not. This was fixed in
6f8bf067c0. Now all the window options
should function as expected without the extra logic.
2023-09-12 10:53:11 -07:00
Steven Arcangeli
d4eb4f3bbf fix: lock cursor to first mutable column
Previously we were forcing the cursor to be after the hidden ID at the
start, but that still meant that it would end up on top of the icon.
This made rename operations slightly more annoying than necessary, since
you would need to first move the cursor forward to the file name. Now,
the cursor will be locked to the beginning of the filename unless there
is a mutable column earlier in the row.
2023-09-09 13:20:18 -07:00
Steven Arcangeli
879d280617 feat: api to sort directory contents (#169) 2023-09-08 21:56:34 -07:00