Skip to content

fix: resume any "normal"-like mode#2682

Merged
phanen merged 1 commit intomainfrom
resume-to-normal
Apr 18, 2026
Merged

fix: resume any "normal"-like mode#2682
phanen merged 1 commit intomainfrom
resume-to-normal

Conversation

@phanen
Copy link
Copy Markdown
Collaborator

@phanen phanen commented Apr 18, 2026

Fix #2681

Summary by CodeRabbit

  • Bug Fixes
    • Improved terminal-mode restoration during window closure to properly handle various terminal modes and prevent potential errors.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 03458821-9e6f-451a-9158-fc4602a95c8a

📥 Commits

Reviewing files that changed from the base of the PR and between 83f7195 and 48e299a.

📒 Files selected for processing (1)
  • lua/fzf-lua/win.lua

📝 Walkthrough

Walkthrough

The PR modifies terminal-mode restoration logic in the window close function to use pattern matching instead of exact equality checking, broadening the condition to detect modes starting with "n" and preventing nil-reference errors.

Changes

Cohort / File(s) Summary
Terminal Mode Restoration
lua/fzf-lua/win.lua
Changed ctx.mode == "nt" to ctx.mode:match("^n") in FzfWin:close() to use pattern matching for terminal-normal mode detection and safely handle nil values.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A pattern match, so simple and kind,
Replaces strict checks that once caused bind,
Terminal buffers now rest with care,
Insert mode stops with gentler flair!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: resume any "normal"-like mode' is specific and clearly describes the main change, which involves modifying terminal-mode restoration logic to handle normal-like modes.
Linked Issues check ✅ Passed The code change addresses issue #2681 by fixing the terminal-mode restoration logic to prevent terminal buffers from closing when selected via :FzfLua buffers.
Out of Scope Changes check ✅ Passed All changes are within scope—the modification to terminal-mode restoration logic directly addresses the reported issue of terminal buffers closing unexpectedly.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch resume-to-normal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@phanen phanen merged commit bd9ead9 into main Apr 18, 2026
10 of 11 checks passed
@phanen phanen deleted the resume-to-normal branch April 18, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: FzfLua buffers closes/deletes terminal buffers

1 participant