feat: add open_split/toggle_split API and upstream triage batch (#83)
* docs(upstream): triage batch — #739 cherry-pick, 10 issue updates * feat: add `open_split` and `toggle_split` API Problem: canola had no way to open a browser in a normal split window; only floating windows were supported via `open_float`/`toggle_float`. `M.close` also crashed with E444 when called from the last window. Solution: port stevearc/oil.nvim#728 — add `open_split(dir, opts, cb)` and `toggle_split(dir, opts, cb)` mirroring the float API. Use `is_canola_win`/`canola_original_win` window vars (not the upstream `is_oil_win` names). Wrap `nvim_win_close` in `pcall` with `enew()` fallback to handle the last-window E444 case. Based on: stevearc/oil.nvim#728 * docs: add vimdoc for `open_split`/`toggle_split` and macOS trash recipe Cherry-picked from: stevearc/oil.nvim#739 * docs(upstream): fix prettier formatting
This commit is contained in:
parent
6d19b5c8f5
commit
082573d779
3 changed files with 121 additions and 8 deletions
|
|
@ -404,6 +404,32 @@ toggle_float({dir}, {opts}, {cb}) *canola.toggle_f
|
|||
plit modifier
|
||||
{cb} `nil|fun()` Called after the canola buffer is ready
|
||||
|
||||
open_split({dir}, {opts}, {cb}) *canola.open_split*
|
||||
Open canola browser in a split window
|
||||
|
||||
Parameters:
|
||||
{dir} `nil|string` When nil, open the parent of the current buffer, or
|
||||
the cwd if current buffer is not a file
|
||||
{opts} `nil|canola.OpenSplitOpts`
|
||||
{vertical} `nil|boolean` Open the buffer in a vertical split
|
||||
{horizontal} `nil|boolean` Open the buffer in a horizontal split
|
||||
{split} `nil|"aboveleft"|"belowright"|"topleft"|"botright"` Split
|
||||
modifier
|
||||
{cb} `nil|fun()` Called after the canola buffer is ready
|
||||
|
||||
toggle_split({dir}, {opts}, {cb}) *canola.toggle_split*
|
||||
Open canola browser in a split window, or close it if open
|
||||
|
||||
Parameters:
|
||||
{dir} `nil|string` When nil, open the parent of the current buffer, or
|
||||
the cwd if current buffer is not a file
|
||||
{opts} `nil|canola.OpenSplitOpts`
|
||||
{vertical} `nil|boolean` Open the buffer in a vertical split
|
||||
{horizontal} `nil|boolean` Open the buffer in a horizontal split
|
||||
{split} `nil|"aboveleft"|"belowright"|"topleft"|"botright"` Split
|
||||
modifier
|
||||
{cb} `nil|fun()` Called after the canola buffer is ready
|
||||
|
||||
open({dir}, {opts}, {cb}) *canola.open*
|
||||
Open canola browser for a directory
|
||||
|
||||
|
|
@ -1109,6 +1135,15 @@ variant after calling `setup()`:
|
|||
end
|
||||
<
|
||||
|
||||
Use FreeDesktop trash on macOS ~
|
||||
*canola-recipe-macos-freedesktop-trash*
|
||||
|
||||
For full FreeDesktop spec compliance on macOS (list, restore operations), or
|
||||
for compatibility with FreeDesktop-compliant trash programs like gtrash:
|
||||
>lua
|
||||
package.loaded["canola.adapters.trash.mac"] = require("canola.adapters.trash.freedesktop")
|
||||
<
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
EVENTS *canola-events*
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue