Skip to content

split preview#2580

Draft
phanen wants to merge 8 commits intoibhagwan:mainfrom
phanen:split-preview
Draft

split preview#2580
phanen wants to merge 8 commits intoibhagwan:mainfrom
phanen:split-preview

Conversation

@phanen
Copy link
Copy Markdown
Collaborator

@phanen phanen commented Feb 24, 2026

  • tscontext
  • bcache
  • chore: useless check
  • refactor: key_from_entry only related to entry
  • refactor: make cache_buffer buffer previewer only

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @phanen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the previewer logic by introducing dedicated modules for Treesitter context and buffer caching. The changes aim to enhance modularity, improve the specificity of caching mechanisms, and streamline internal functions, leading to a more organized and maintainable codebase for preview functionality.

Highlights

  • Treesitter Context Modularity: The Treesitter context handling logic has been extracted from builtin.lua into its own dedicated module, tscontext.lua, improving code organization and maintainability.
  • Specialized Buffer Caching: A new buffer caching module, bcache.lua, has been introduced. The generic cache_buffer method from the base previewer was removed and replaced with a specialized version within buffer_or_file previewers, allowing for more precise control over buffer caching.
  • Refactored Key Generation: The key_from_entry function, responsible for generating cache keys, has been refactored into a local helper function, making its scope more explicit and reducing potential side effects.
  • Code Cleanup: A redundant check for entry in the do_syntax function was removed, contributing to cleaner and more efficient code.
Changelog
  • lua/fzf-lua/previewer/bcache.lua
    • Added a new module for managing cached preview buffers and their positions.
  • lua/fzf-lua/previewer/builtin.lua
    • Moved Treesitter context handling to a new dedicated module.
    • Removed the generic cache_buffer method from the base previewer.
    • Refactored key_from_entry to be a local helper function.
    • Introduced a specialized cache_buffer method for buffer_or_file previewers.
    • Removed a redundant check in do_syntax.
    • Simplified buffer caching in preview_buf_post.
  • lua/fzf-lua/previewer/tscontext.lua
    • Added a new module to manage Treesitter context functionality.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a nice refactoring effort. It splits out TSContext and a new Bcache implementation into their own modules, improving code organization. The caching logic is also refined and made more specific to the buffer_or_file previewer. These changes make the code cleaner and more maintainable. I have a couple of minor suggestions to improve consistency and clarity.

@phanen phanen force-pushed the split-preview branch 5 times, most recently from deffa27 to ed03e6a Compare February 26, 2026 15:54
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b8e78d49-b6d3-4527-86a9-7b14b469951d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 force-pushed the split-preview branch 3 times, most recently from ab48e2e to 6575140 Compare March 26, 2026 01:47
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.

1 participant