* Escape all paths for ssh file changes using `vim.fn.shellescape()`
* Change away from `vim.fn.shellescape` to custom implementation
Really, only escape `'` with `'\\''` so that it will:
- exit the single quote mode
- escape out a single quote character
- and get back into the single quote mode
Also format long line so linter doesn't complain
* Adding doc comments to the shellescape function
* Adding actual words to the doc comment
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.
* 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>
* 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>
* perf(trash_windows): use a single powershell instance for operations
* refactor(trash_windows): encapsulate powershell connection logic
* refactor(windows_trash): better name for functions
* fix(windows_trash): set connection error on initializatino if needed
* refactor(windows_trash): simplify initialization code
* refactor: extract some powershell logic into separate file
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
* 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>
* save buffers changed by will_rename_files
* prevent closing already open buffers
* chore: move to config option
* chore: fixes
* fix: a crash and some formatting
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
* 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>
* 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
* 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
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.