Commit graph

139 commits

Author SHA1 Message Date
Steven Arcangeli
62c5683c2e lint: fix typecheck errors 2025-01-22 08:54:47 -08:00
David Marchante
c5f7c56644
fix: set alternate when using floating windows (#526) 2024-12-20 23:18:49 -05:00
Gustavo Sampaio
78ab7ca107
fix: don't take over the preview window until it's opened for oil (#532) 2024-12-20 23:15:47 -05: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
3fa3161aa9 feat: config option to disable previewing a file 2024-11-21 17:36:40 -08:00
Steven Arcangeli
5acab3d8a9 fix: image.nvim previews with preview_method=scratch 2024-11-21 17:36:22 -08:00
cdmill
81cc9c3f62
feat: option to quite vim if oil is closed as last buffer (#491)
* feat: auto-quit vim if oil is closed as last buffer

* rename auto_close_vim to auto_close_last_buffer

* rework actions.close to be more like actions.cd

* fix: configure close action correctly

* add type annotation, future proofing

* fix: typo

* fix: typo

* refactor: better type annotations and backwards compatibility

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2024-11-20 21:06:09 -08:00
Jalal El Mansouri
21705a1deb
feat: use scratch buffer for file previews (#467)
* Initial implementation of scratch based preview

* Fix call to buf is valid in loop

* Fixing call to be made only from the main event loop

* Improve handling of large files from @pkazmier

* Better error handling and simplifying the code

* Default to old behavior

* Add documentation

* Fix readfile

* Fix the configuration

* refactor: single config enum and load real buffer on BufEnter

* doc: regenerate documentation

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-11-19 17:24:24 -08:00
Micah Halter
bbeed86bde
feat: add win_options to preview_win (#514) 2024-11-12 10:38:35 -08:00
Steve Walker
c23fe08e05
feat: disable preview for large files (#511)
* feat: disable preview for large files

fix: update oil.PreviewWindowConfig

* refactor: remove unnecessary shim in config.lua

* refactor: revert changes to shim

---------

Co-authored-by: Steve Walker <65963536+etherswangel@users.noreply.github.com>
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2024-11-12 08:24:39 -08:00
Steven Arcangeli
2f5d4353ee doc: improve type annotations for oil.open_preview 2024-11-10 16:07:29 -08:00
Philipp Oeschger
5d2dfae655
feat: config option to customize floating window title (#482)
* replace cwd path in actual path

* move get_title to utils

* add documentation

* rename

* add method doc

* add comment

* fallback to 0 for winid

* add missing property definition for relative_win_title

* only replace when at the start of the path

* simplify

* minor change

* add entry point to customize floating window title for oil-buffer

* remove config parameter

* cleanup

* add documentation

* move get_win_title to top and pass winid as parameter

* add get_win_title to type definition for oil.setup

* remove empty line

* adjust comment

---------

Co-authored-by: Philipp Oeschger <philippoeschger@Philipps-Air.fritz.box>
2024-10-15 22:22:31 -04:00
Steven Arcangeli
1fe476daf0 doc: more and better type annotations 2024-08-30 17:50:09 -07:00
sleeptightAnsiC
cc2332599f
feat: allow bufnr optional parameter for get_current_dir function (#440)
This allows for using get_current_dir in cases where currently hovered
buffer is not the desired Oil buffer (e.g. displaying directories for
multiple different Oil buffers)
2024-07-06 16:24:33 -07:00
icefed
b0a6cf9898
fix: set floating window win_options when buffer changes (#432)
* fix: set floating window win_options when buffer changes

* fix: set win options even when float border is "none"

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-07-02 10:03:08 -07:00
Philipp Oeschger
59b3dab6f7
feat: support preview from floating window (#403)
* implement floating window

* reset width on closing window

* use gap from new config parameter

* use minimal style for preview in floating

* lower z-index

* add configuration of preview position in floating window

* fix in verions earlier than nvim 0.10

* close preview on opening floating window

Close the any existing preview because otherwise strange errors happen when the preview is open and the floating window is opened at the same time.

* reset formatting changes

* remove empty line

* change z-index of preview window to floating window z-index

* add configurations to oil.txt

* formatting

* add auto configuration

* update oil doc

* refactor: move logic into layout.lua and eliminate flicker

* fix: floating preview window title is file name

* doc: clarify default_file_explorer

* refactor: don't need a preview_gap option

* refactor: only find preview win in current tabpage

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-06-19 21:23:30 -04:00
Steven Arcangeli
d3a365c950 doc: improve documentation for set_sort (#401) 2024-06-02 17:45:22 -07:00
Steven Arcangeli
15e071f203 ci: typechecking no longer requires neodev 2024-06-01 16:38:11 -07:00
Steven Arcangeli
2cb39e838e doc: more detailed type annotations for setup() call 2024-05-22 13:46:11 -07:00
Steven Arcangeli
259b1fbc84 doc: better type annotations for API methods 2024-05-21 19:39:37 -07:00
Steven Arcangeli
06a19f77f1 fix: error opening command window from oil float (#378) 2024-05-17 12:02:35 -07:00
Steven Arcangeli
27d9f37161 ci: run tests against Neovim v0.10.0 2024-05-16 11:09:15 -07:00
Matthew Wilding
f3a31eba24
fix(windows): navigating into drive letter root directories (#341)
* Fixed drive browsing on windows

* Fixed naming

* fix: Uppercase drive letter only

* updated: Filter out network drives on windows

* Update files.lua

* Update files.lua

* fixed: mapped drives

* addslash to check for double slash

* Fixed indents

* Reverted addslash change

* Fixed windows initial buffer name

* Reverted formatting

* Cleaned up callback

* Fix addslash to handle \ too

* Allow running tests workflow from fork

* Fix workflow

* Test

* Tests

* refactor: readability and comments

* fix: convert buffer name to posix when hijacking directory

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-04-23 22:06:59 -07:00
Steven Arcangeli
2bc56ad68a fix: error when opening files from floating oil window (#355) 2024-04-21 07:37:54 -07:00
Steven Arcangeli
f41d7e7cd8 fix: support visual mode when preview window is open (#315) 2024-04-19 16:31:42 -04:00
Steven Arcangeli
fa3820ebf1 feat: can restore Oil progress window when minimized 2024-04-19 16:31:42 -04:00
Steven Arcangeli
2bd71dda88 lint: fix typechecking 2024-04-19 10:44:16 -04:00
Steven Arcangeli
6c48ac7dc6 fix: output suppressed when opening files (#348) 2024-04-19 10:40:35 -04:00
Steven Arcangeli
0de8e60e3d fix: correctly reset bufhidden for formerly previewed buffers (#291) 2024-03-12 20:41:23 -07:00
Steven Arcangeli
17d71eb3d8 fix: window options sometimes not set in oil buffer (#287) 2024-03-12 20:06:02 -07:00
Steven Arcangeli
f259347d4d cleanup: remove old unused logic for transferring window variables 2024-03-12 19:37:57 -07:00
Steven Arcangeli
e045ee3b4e fix: spurious exits from faulty :wq detection (#221)
The previous mechanism used histget() to get the last command or
expression to detect if the user issued a `:wq` or similar. This had the
issue where if a user issued a `:wq`, started vim again, then entered
oil and saved via some mechanism that is _not_ a command (e.g. a
keymap), we would incorrectly detect that `:wq` and exit after saving.
The new mechanism tracks all keypresses and may end up with false
negatives (e.g. ":wqaff<backspace><backspace>ll"), but those are less
frustrating than false positives.
2024-03-12 15:57:57 -07:00
Lucas Eras Paiva
132b4ea074
fix: close preview window when leaving oil buffer (#296)
* fix: close preview window when leaving oil buffer

* refactor: try different approach for closing the preview window

* fix: use util.is_oil_bufnr

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-02-22 22:11:32 -08:00
Lucas Eras Paiva
bf753c3e3f
feat: do not close preview when switching dirs (#277)
* feat: do not close preview when cd into dir

* refactor: add helper method to run function after oil buffer loads

* Keep preview window open

* Remove some test logic

* Use `run_after_load` when moving to parent directory

* Remove unnecessary update of current window

* refactor: create helper function for updating preview

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-01-21 20:32:02 -08:00
TheLeoP
553b7a0ac1
feat(trash): support for deleting to windows recycle bin (#243)
* feat(windows-trash): support for deleting to windows trash

* feat(windows-trash): add support for view, restore and purge

* fix(windows-trash): undefined path on M.list

* chore(windows-trash): modify comments

* fix(windows-trash): show correct original_path

* fix(windows-trash): add self to powershell_date_grammar

* fix(windows-trash-support): parse deleted date as number

* fix(fs): do not add innecesary \\ on Windows

* feat: extend windows trash adapter

* perf(windows-trash): powershell -> libuv (move, purge and copy)

* fix: don't prompt to save when opening trashed file

* lint: fix luacheck error

* lint: fix luacheck errors

* lint: luacheck error

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2024-01-02 22:05:01 -08:00
Steven Arcangeli
22ab2ce1d5 fix: handle opening oil from buffers with foreign schemes (#256) 2023-12-24 11:32:26 -05:00
Shihua Zeng
a173b5776c
feat: allow multiple hlgroups inside one column (#240)
* feat: allow multiple hlgroups inside one column

* types: refactor formatting of highlight types

* types: LuaLS can't infer type information from unpack

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2023-12-07 21:36:52 -08:00
Luka Potočnik
3ffb8309e6
feat: actions for sending oil entries to quickfix (#249)
* Implement actions for sending oil entries to quickfix/location-list

* Use vim.notify instead of vim.notify_once in util quickfix function

* Remove redundant files/directories options for sending to qf

always send just files

* set qflist/loclist with a single call

* Add type annotations and default values for send_to_quickfix

* In visual mode, send only selected items to qf
2023-12-07 21:01:13 -08:00
Micah Halter
b3c24f4b3b
perf: speed up session loading (#246)
* perf: only execute on current buffer since this event is called on each buffer

* fix: only execute `SessionLoadPost` autocommand when a full session is loaded
2023-12-06 23:58:53 -08:00
Steven Arcangeli
636989b603 fix: oil.select respects splitbelow and splitright (#233) 2023-11-30 23:55:43 -08:00
Steven Arcangeli
6566f457e4 fix: preserve buflisted when re-opening oil buffers (#220) 2023-11-19 21:02:06 -08:00
Steven Arcangeli
873d505e5b fix: don't set buflisted on oil buffers (#220) 2023-11-14 22:41:39 -08:00
Steven Arcangeli
af13ce333f fix: quit after mutations when :wq or similar (#221) 2023-11-13 10:46:08 -08:00
Steven Arcangeli
3727410e48
fix: previewing and editing files on windows (#214) 2023-11-09 21:31:23 -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
57db10d748 lint: apply stylua 2023-11-05 07:29:15 -08:00
Steven Arcangeli
126a8a2346 fix: can view drives on Windows 2023-11-05 07:27:28 -08:00
Steven Arcangeli
aea896a880 fix: restore original window when closing floating win (#208) 2023-11-04 11:35:50 -07:00