Commit graph

628 commits

Author SHA1 Message Date
9f3177d9e8
fix(view): constrain cursor in insert mode
Problem: `constrain_cursor` only fired on `CursorMoved` and
`ModeChanged`, so arrow key navigation in insert mode could move
the cursor into the concealed ID prefix area.

Solution: add `CursorMovedI` to the autocmd event list. The
`constrain_cursor()` function is already mode-agnostic.
2026-03-08 16:00:53 -04:00
Barrett Ruth
ac48ce20f5
docs(upstream): collapse issue sections into single table (#91)
Problem: issues were split across four separate sections by status,
requiring moves between sections on every status change.

Solution: merge all issues into one `## Issues` table sorted by number
with an inline status column. Update digest script heading and row
format to match.
2026-03-08 15:52:25 -04:00
Barrett Ruth
0424ab3e65
fix(ci): update digest script for reorganized upstream tracker (#90)
Problem: the upstream digest script referenced old section headings
(`## Open upstream PRs`, `## Upstream issues`) and a 3-column issue
row format that no longer exist after the tracker reorganization.

Solution: update headings to `## Upstream PRs` and `## Issues — open`,
and change issue row format to the new 2-column layout.
2026-03-08 15:44:32 -04:00
Barrett Ruth
76e1aacde0
docs(upstream): reorganize tracker into grouped tables (#89)
Problem: the upstream tracker had duplicate entries across tables,
fragile commit hash references, a 108-row flat table mixing all
statuses, and inconsistent formatting.

Solution: merge PR tables into one, split issues by status (fixed,
resolved, open, not actionable), drop all commit hashes in favor of
stable PR numbers, and eliminate duplication so each entry appears
exactly once.
2026-03-08 15:41:37 -04:00
Barrett Ruth
94db584f81
feat: add toggle() API for regular windows (#88)
* feat: add `toggle()` API for regular windows

Problem: `toggle_float()` and `toggle_split()` exist but there is no
`toggle()` for regular windows, forcing users to write their own
filetype-checking wrapper.

Solution: add `M.toggle()` that delegates to `close()` or `open()`
based on whether the current buffer is a canola buffer. Includes
vimdoc entry.

* docs(upstream): mark #621 fixed
2026-03-08 15:33:45 -04:00
Barrett Ruth
fc43684bbd
fix(columns): hide misleading directory sizes (#87)
* fix(columns): hide misleading directory sizes in size column

Problem: the size column shows the filesystem inode size (typically
4096 = 4.1k) for directories, which is misleading — users expect no
size for directories.

Solution: add an early return for directory entries in the size render
function of the files, SSH, and S3 adapters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs(upstream): mark #486 fixed

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 15:31:43 -04:00
Barrett Ruth
abc4879688
Fix require statement for oil.nvim setup 2026-03-07 21:12:45 -05:00
Barrett Ruth
91562016c8
docs(upstream): mark #380 not actionable (#86) 2026-03-07 17:05:46 -05:00
Barrett Ruth
4a8d57a269
feat: add max_file_size preview limit and show_hidden_when_empty (#85)
* feat(preview): add `max_file_size` config to skip large file previews

Problem: previewing large files (e.g. 500 MB logs, binaries) loads them
into a buffer and can freeze or OOM Neovim. `disable_preview` only
receives the filename, so users cannot gate on file size.

Solution: add `preview_win.max_file_size` (number, MB, default 10). In
`open_preview`, check `entry.meta.stat.size` and fall back to
`vim.uv.fs_stat` when the cached stat is absent. If the file exceeds
the limit and a preview window is already open, render "File too large
to preview" in it; if not, emit a WARN notify and return early. The
cursor-moved auto-update path only fires when a window already exists,
so no flag threading is needed to distinguish explicit from implicit.

Based on: stevearc/oil.nvim#213

* feat(view): add `show_hidden_when_empty` for hidden-only directories

Problem: with `show_hidden = false`, a directory containing only
dotfiles renders as just `..`, giving no indication that entries exist.

Solution: add `view_options.show_hidden_when_empty` (boolean, default
false). After the main filter loop in `render_buffer`, if the option is
set and `#line_table <= 1`, iterate `entry_list` again and render any
entry not matched by `is_always_hidden`, using `is_hidden = true` so
they render with the dimmed hidden style.

Based on: stevearc/oil.nvim#473

* docs(upstream): fix formatting

* docs(upstream): update #213 and #473 with PR and commit links
2026-03-07 16:52:57 -05:00
Barrett Ruth
a9a06b8f3b
feat: add auto_save_on_select_new_entry config option (#84)
Problem: users who want hands-off behaviour had no way to skip the
`prompt_save_on_select_new_entry` confirmation dialog — enabling the
prompt meant always being asked, with no silent auto-save path.

Solution: add `auto_save_on_select_new_entry` (default `false`) which,
when true, calls `M.save()` and proceeds immediately instead of showing
the confirm dialog. Includes type annotations, vimdoc, and upstream
tracker update for stevearc/oil.nvim#393.
2026-03-07 16:08:34 -05:00
Barrett Ruth
082573d779
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
2026-03-07 15:45:23 -05:00
Barrett Ruth
6d19b5c8f5
correct canola q&a format 2026-03-06 17:58:41 -05:00
Barrett Ruth
5b74210894
docs(upstream): mark #615 fixed, #650 and #682 resolved (#80) 2026-03-06 16:43:55 -05:00
Barrett Ruth
01f10e1d79
refactor: drop nvim 0.8/0.9 compat shims from init.lua (#79) 2026-03-06 16:36:37 -05:00
Barrett Ruth
0f386bb69c
fix: show float title when border is nil (#78)
* fix: show float title when border is nil

Problem: the float title was only shown via the native `nvim_win_set_config`
path, which requires a border to render. The guard `config.float.border ~=
'none'` did not account for `nil`, which is the default — so users with no
explicit `border` config never saw the path title in the floating window.

Solution: require both `~= nil` and `~= 'none'` before using the native
title. In all other cases (border nil, 'none', or nvim < 0.9), fall back to
`util.add_title_to_win`, which renders a child floating window for the title.

Based on: stevearc/oil.nvim#683

* refactor: drop nvim-0.9 version checks in float title logic
2026-03-06 16:29:47 -05:00
Barrett Ruth
ba49f76e91
feat: add skip_confirm_for_delete option (#77)
feat: add \`skip_confirm_for_delete\` option

Problem: there was no way to suppress the confirmation popup when the
only pending operations are deletes. \`skip_confirm_for_simple_edits\`
explicitly excludes deletes, so users who delete frequently had no opt-out.

Solution: add \`skip_confirm_for_delete = false\` config option. When true,
\`confirmation.show()\` skips the popup if every pending action is a delete.

Based on: stevearc/oil.nvim#392
2026-03-06 16:29:12 -05:00
Barrett Ruth
7a46246062
fix: escape on save prompt cancels select (#76)
Problem: when `prompt_save_on_select_new_entry` is enabled and the user
presses Escape on the "Save changes?" confirm dialog, `vim.fn.confirm`
returns 0, but the select continued as if the user had chosen "No".

Solution: add an explicit `choice == 0` branch that returns immediately,
aborting the select without saving or opening any files.
2026-03-06 16:28:57 -05:00
Barrett Ruth
a74747e1f5
feat: emit CanolaFileCreated autocmd on file creation (#75)
* feat: emit \`CanolaFileCreated\` autocmd on file creation

Problem: no way to hook into individual file creation to populate
initial contents, without a plugin-specific config callback.

Solution: fire \`User CanolaFileCreated\` with \`data.path\` after each
successful \`fs.touch\` in the files adapter. Users listen with
\`nvim_create_autocmd\` and write to the path however they like.

* build: gitignore `doc/upstream.html`

* docs(upstream): mark #721 fixed, triage #735

* docs(upstream): simplify #735 note
2026-03-06 15:54:01 -05:00
Barrett Ruth
c7a55fd787
docs(upstream): triage PRs #721 and #735 (#74)
* docs(upstream): triage PRs #721 and #735

* docs(upstream): fix #721 status to deferred

* docs(upstream): remove status key legend

* docs(upstream): s/addressing/fixing in #721 note
2026-03-06 15:48:07 -05:00
Barrett Ruth
1ee6c6b259
feat: add cleanup_buffers_on_delete option (#73)
Problem: When files are deleted via canola, any open Neovim buffers
for those files remain alive, polluting the jumplist with stale
entries.

Solution: Add an opt-in `cleanup_buffers_on_delete` config option
(default `false`). When enabled, `finish()` in `mutator/init.lua`
iterates completed delete actions and wipes matching buffers via
`nvim_buf_delete` before `CanolaActionsPost` fires. Only local
filesystem deletes are handled (guarded by the `files` adapter
check).
2026-03-06 15:19:32 -05:00
Barrett Ruth
69d85b8de1
feat(view): position cursor at name column on new empty lines (#72)
Problem: pressing `o`/`O` in a canola buffer placed the cursor at
column 0, requiring manual navigation past concealed ID prefixes and
column text (icons, permissions) to reach the name column.

Solution: add `show_insert_guide()` which temporarily sets
`virtualedit=all` on empty lines and positions the cursor at the
name column. Computes the correct virtual column by measuring the
visible column prefix width via `nvim_strwidth`, adjusting for
`conceallevel` (0=full ID width, 1=replacement char, 2/3=hidden).
Restores `virtualedit` on `TextChangedI` or `InsertLeave`.
2026-03-06 14:40:10 -05:00
Barrett Ruth
41f375ee9e
fix: restore buflisted on jumplist buffer re-entry (#71)
* fix: restore `buflisted` on jumplist buffer re-entry

Problem: Neovim's jumplist machinery re-enters canola buffers via an
internal `:edit`-equivalent path, which unconditionally sets
`buflisted = true`. The existing workaround in `open()` and
`open_float()` only covers canola-initiated navigation, leaving
`<C-o>` and `<C-i>` unhandled.

Solution: Apply the same `buf_options.buflisted` guard in the
`BufEnter` autocmd, directly after `set_win_options()`. This fires
on every buffer entry — including all jumplist paths — and mirrors
the pattern already used at the two `:edit` callsites.

* docs: mark upstream #302 as fixed in tracker
2026-03-06 11:55:37 -05:00
c3de0004d1
ci: format 2026-03-05 14:53:30 -05:00
Barrett Ruth
0d3088f57e
refactor: rename oil to canola across entire codebase (#70)
Problem: the codebase still used the upstream \`oil\` naming everywhere —
URL schemes, the \`:Oil\` command, highlight groups, user events, module
paths, filetypes, buffer/window variables, LuaCATS type annotations,
vimdoc help tags, syntax groups, and internal identifiers.

Solution: mechanical rename of every reference. URL schemes now use
\`canola://\` (plus \`canola-ssh://\`, \`canola-s3://\`, \`canola-sss://\`,
\`canola-trash://\`, \`canola-test://\`). The \`:Canola\` command replaces
\`:Oil\`. All highlight groups, user events, augroups, namespaces,
filetypes, require paths, type annotations, help tags, and identifiers
follow suit. The \`upstream\` remote to \`stevearc/oil.nvim\` has been
removed and the \`vim.g.oil\` deprecation shim dropped.
2026-03-05 14:50:10 -05:00
Barrett Ruth
67ad0632a6
Remove acknowledgements section from README
Removed acknowledgements for canola.nvim and its maintainers.
2026-03-05 13:45:12 -05:00
Barrett Ruth
c96dbf8d46
Ci/digest final (#69)
* ci(digest): approve with DIGEST_PAT after disabling require_last_push_approval

require_last_push_approval blocked barrettruth from approving their
own push. Disabled that restriction in the ruleset — 1 approval is
still required for all PRs, but the approver can now be the pusher.
DIGEST_PAT (barrettruth) approves, CI runs via PAT push, auto-merge
fires when checks pass.

* ci: format + scripts

* ci: nix
2026-03-04 14:10:07 -05:00
Barrett Ruth
aee5ea10c6
ci: scripts and format (#68)
* ci(digest): approve with DIGEST_PAT after disabling require_last_push_approval

require_last_push_approval blocked barrettruth from approving their
own push. Disabled that restriction in the ruleset — 1 approval is
still required for all PRs, but the approver can now be the pusher.
DIGEST_PAT (barrettruth) approves, CI runs via PAT push, auto-merge
fires when checks pass.

* ci: format + scripts
2026-03-04 13:49:06 -05:00
github-actions[bot]
9b656387fb
docs(upstream): upstream digest (#67)
docs(upstream): upstream digest 2026-03-03

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-03 21:08:58 +00:00
Barrett Ruth
ad03b3771a
ci(digest): approve with DIGEST_PAT after disabling require_last_push_approval (#66)
require_last_push_approval blocked barrettruth from approving their
own push. Disabled that restriction in the ruleset — 1 approval is
still required for all PRs, but the approver can now be the pusher.
DIGEST_PAT (barrettruth) approves, CI runs via PAT push, auto-merge
fires when checks pass.
2026-03-03 16:07:53 -05:00
Barrett Ruth
244db7531c
ci(digest): drop explicit approve, rely on admin bypass (#64)
The GITHUB_TOKEN has admin-level bypass on the ruleset. When
gh pr merge --auto is called, the bypass satisfies the review
requirement automatically — no explicit approve step needed.
The self-review error is gone. PAT still handles the push so
CI triggers.
2026-03-03 16:01:15 -05:00
Barrett Ruth
6af0172eb3
ci(digest): approve with GITHUB_TOKEN not PAT (#61)
require_last_push_approval blocks barrettruth from approving their
own push. The bot (GITHUB_TOKEN) approves instead — different actor
from the PAT pusher, satisfying the rule.
2026-03-03 15:52:27 -05:00
Barrett Ruth
22d9f521d7
ci(digest): unset checkout extraheader so PAT push triggers CI (#59)
Problem: actions/checkout sets an http.extraheader with GITHUB_TOKEN
that overrides any credentials in the remote URL, so git push uses
GITHUB_TOKEN regardless of the URL — suppressing CI triggers.

Solution: unset the extraheader before pushing, forcing git to use
the DIGEST_PAT embedded in the remote URL.
2026-03-03 15:48:18 -05:00
Barrett Ruth
280b3f0f62
ci(digest): push with PAT to trigger CI and auto-approve as barrettruth (#56)
ci(digest): push branch with PAT so CI triggers

Problem: GITHUB_TOKEN suppresses all downstream workflow triggers
including push events, so CI never runs on the digest branch.

Solution: push with DIGEST_PAT (triggers CI as a real user push),
then reset the remote to GITHUB_TOKEN for PR creation. Admin bypass
on the ruleset handles the review requirement.
2026-03-03 15:43:49 -05:00
Barrett Ruth
9ad67b05a6
ci(digest): run CI on push to ci/upstream-digest branch (#53)
Problem: GITHUB_TOKEN-created PRs suppress pull_request triggers,
so CI never runs and auto-merge stalls.

Solution: add ci/upstream-digest to the push trigger in test and
quality workflows. CI runs on the branch push before the PR exists;
check results attach to the commit SHA so the PR sees them as
passing. The digest workflow reverts to GITHUB_TOKEN for PR
creation — no PAT needed, no contribution inflation.
2026-03-03 15:35:25 -05:00
Barrett Ruth
0c930bda2b
ci(digest): create digest PR with PAT so CI triggers (#50)
Problem: GITHUB_TOKEN-created PRs suppress pull_request workflow
triggers, so CI never runs and auto-merge stalls indefinitely.

Solution: use DIGEST_PAT to create the PR. A PAT-created PR is
treated as a real user action, triggering CI normally. Auto-approve
handles the review requirement, auto-merge fires when checks pass.
2026-03-03 15:29:03 -05:00
Barrett Ruth
b7c65a1d4b
ci(digest): remove PAT approval step (#48)
ci(digest): remove PAT approval step — auto-approve handles it
2026-03-03 15:22:20 -05:00
5025803324
docs(upstream): remove #735 and #736 for digest re-test 2026-03-03 15:19:25 -05:00
Barrett Ruth
71b51746af
ci(digest): auto-approve digest PRs via PAT to satisfy review requirement (#46)
Problem: the main branch ruleset requires 1 approving review, which
blocks auto-merge. The GITHUB_TOKEN cannot approve its own PR.

Solution: after creating the PR, approve it using DIGEST_PAT (a
fine-grained PAT stored as a repo secret), then enable auto-merge.
The approval comes from a different actor than the bot, satisfying
require_last_push_approval.
2026-03-03 15:18:20 -05:00
github-actions[bot]
09acf0c3fe
docs(upstream): upstream digest (#45)
docs(upstream): upstream digest 2026-03-03

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-03 15:08:41 -05:00
Barrett Ruth
20bb43057e
ci(digest): use fixed branch with force-push for weekly digest (#44)
Problem: the workflow creates a new dated branch each run. If a digest
PR is not merged before the next run, duplicate PRs accumulate.

Solution: use a single canonical branch ci/upstream-digest with
--force push. Each run resets to main, applies any new items, and
force-pushes. If a PR is already open for the branch, GitHub updates
it in place. A new PR is only created (with auto-merge) when none
exists. The close-stale step is no longer needed.
2026-03-03 15:06:08 -05:00
Barrett Ruth
61e84bbc5f
ci(digest): close existing open digest PRs before creating new one (#42)
Problem: if a digest PR is not merged before the next weekly run, a
second PR is created for the same items plus any new ones, leading
to duplicate open PRs.

Solution: before fetching upstream activity, close any open PRs
labeled upstream/digest (deleting their branches). The new run
re-fetches all items since the last merged baseline and produces a
single up-to-date PR.
2026-03-03 14:59:08 -05:00
Barrett Ruth
56d1745415
ci(digest): update to PR-based upstream tracker workflow (#40) 2026-03-03 14:49:30 -05:00
Barrett Ruth
c4d827070e
ci: add weekly upstream digest workflow (#37)
Problem: new upstream issues and PRs slip through because there's no
mechanism to surface them — manual polling of stevearc/oil.nvim is
required and easy to forget.

Solution: add a Monday 9am UTC scheduled workflow that reads the
highest stevearc/oil.nvim number from doc/upstream.md, fetches merged
PRs and new open issues/PRs above that threshold via the gh CLI, and
creates a structured digest issue in barrettruth/canola.nvim. No issue
is created when there's nothing new. Falls back to a 30-day window if
doc/upstream.md can't be parsed.
2026-03-03 14:15:46 -05:00
63fb912d52
fix(icons): use nonicons hl groups 2026-03-02 20:21:47 -05:00
05234a67ba
fix: use guard clause 2026-03-02 19:26:02 -05:00
262bf8710e
fix: ensure nvim-web-devicoins exists 2026-03-02 19:25:08 -05:00
e90508c459
ci: add bit luajit global 2026-02-23 18:18:35 -05:00
3140c152ea
ci: migrate to nix 2026-02-23 18:13:51 -05:00
b87c665ccb
fix(icon): use fill directory by default 2026-02-23 17:20:44 -05:00
60bfbe05da fix: preserve devicons highlight groups in nonicons icon provider
Problem: when the nonicons direct API was detected, all icons were
returned with the generic 'OilFileIcon' highlight group, losing
per-filetype colors from nvim-web-devicons.

Solution: resolve highlight groups from devicons when available so
nonicons glyphs retain their per-filetype colors.
2026-02-23 15:16:25 -05:00