Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix timeout issue with dd command in patch and chaperon buffer #123

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

ogaken-1
Copy link
Contributor

@ogaken-1 ogaken-1 commented Feb 16, 2024

  • Before this fix, dor, dol, and do mappings were available in operator-pending mode in addition to normal and visual modes within the patch buffer. This caused the dd command to wait for a key sequence timeout.
  • This commit removes the operator-pending mode mappings for dor, dol, and do, restricting them to only normal and visual modes. This change addresses the timeout issue when using the dd command in the patch buffer.

Summary by CodeRabbit

  • New Features
    • Enhanced mapping configurations with a new modes constant for greater consistency and flexibility across various commands.

- Before this fix, `dor`, `dol`, and `do` mappings were available in
  operator-pending mode, in addition to normal and visual modes, within
  the patch buffer. This caused the `dd` command to wait for a key
  sequence timeout.
- This commit removes the operator-pending mode mappings for `dor`,
  `dol`, and `do`, restricting them to only normal and visual modes.
  This change addresses the timeout issue when using the `dd` command
  in the patch buffer.
Copy link

coderabbitai bot commented Feb 16, 2024

Walkthrough

The recent updates introduce a new constant modes of type mapping.Mode[] with values ["n", "x"], which is now utilized in mapping configurations for command functions in two different files. This addition aims to enhance consistency and flexibility in specifying modes for mappings, streamlining the process of defining how commands interact within various modes.

Changes

Files Change Summary
.../gin/command/chaperon/command.ts
.../gin/command/patch/command.ts
Added a modes constant (["n", "x"]) and used it in mapping configurations for various commands.

🐇✨
In the realm of code, where commands align,
A rabbit hopped through, making changes fine.
With "n" and "x", modes neatly arrayed,
Consistency's key, in mappings it stayed.
🌟📜 Through patches and chaperons, it danced,
In the world of Denops, flexibility enhanced.
🐇💫

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f97b57d) 58.33% compared to head (899835b) 58.33%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #123   +/-   ##
=======================================
  Coverage   58.33%   58.33%           
=======================================
  Files          17       17           
  Lines         864      864           
  Branches      101      101           
=======================================
  Hits          504      504           
  Misses        360      360           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f97b57d and 899835b.
Files selected for processing (2)
  • denops/gin/command/chaperon/command.ts (13 hunks)
  • denops/gin/command/patch/command.ts (17 hunks)
Additional comments: 16
denops/gin/command/patch/command.ts (8)
  • 131-139: The introduction of the modes constant with values ["n", "x"] for specifying normal and visual modes is a good practice for ensuring consistency and flexibility in defining modes for mappings. This change effectively addresses the issue by limiting the mappings to the intended modes and should prevent the timeout issue with the dd command. The syntax and logic appear correct, and the use of the constant enhances maintainability by centralizing the mode definitions.
  • 149-149: Using the modes constant for the dp mapping configuration is consistent with the previous change and maintains the intended restriction to normal and visual modes. This consistency is beneficial for maintainability and clarity in the codebase.
  • 163-177: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [166-184]

Repeating the use of the modes constant in the initWorktree function for both <Plug>(gin-diffput) and <Plug>(gin-diffget) mappings is a good practice. It ensures that the mappings are consistently applied across different parts of the code, adhering to the intended operational modes and contributing to the overall objective of resolving the timeout issue.

  • 191-197: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [194-203]

The application of the modes constant for the dp and do mappings within the initWorktree function is consistent and maintains the restriction to normal and visual modes. This approach is commendable for its consistency and clarity, ensuring that the mappings are correctly limited to the intended modes.

  • 218-224: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [221-230]

The use of the modes constant in the initIndex function for the <Plug>(gin-diffget-l) mapping is consistent with the changes made in other parts of the file. This consistency in applying the mode restrictions across different functions is beneficial for maintainability and clarity.

  • 236-242: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [239-249]

Applying the modes constant for the dol and do mappings within the initIndex function is consistent with the previous changes and maintains the intended restriction to normal and visual modes. This approach enhances the maintainability and clarity of the codebase by ensuring consistent application of mode restrictions.

  • 268-274: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [271-281]

The repetition of the modes constant usage for the <Plug>(gin-diffput) and <Plug>(gin-diffget-r) mappings in the initIndex function is a good practice. It ensures that the mappings are consistently applied across different parts of the code, adhering to the intended operational modes and contributing to the overall objective of resolving the timeout issue.

  • 287-293: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [290-300]

Using the modes constant for the dp, dor, and do mappings within the initIndex function is consistent with the changes made in other parts of the file. This consistency in applying the mode restrictions across different functions is beneficial for maintainability and clarity, ensuring that the mappings are correctly limited to the intended modes.

denops/gin/command/chaperon/command.ts (8)
  • 157-165: The introduction of the modes constant with values ["n", "x"] for specifying normal and visual modes in the initTheirs function is a good practice for ensuring consistency and flexibility in defining modes for mappings. This change effectively addresses the objective of refining command mappings and should contribute to enhancing the user experience by ensuring that the command operates efficiently without unnecessary delays.
  • 175-175: Using the modes constant for the dp mapping configuration in the initTheirs function is consistent with the previous change and maintains the intended restriction to normal and visual modes. This consistency is beneficial for maintainability and clarity in the codebase.
  • 192-198: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [195-204]

Repeating the use of the modes constant in the initWorktree function for the <Plug>(gin-diffget-l) mapping is a good practice. It ensures that the mappings are consistently applied across different parts of the code, adhering to the intended operational modes and contributing to the overall objective of refining command mappings.

  • 210-216: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [213-223]

The application of the modes constant for the dol and do mappings within the initWorktree function is consistent with the previous changes and maintains the intended restriction to normal and visual modes. This approach enhances the maintainability and clarity of the codebase by ensuring consistent application of mode restrictions.

  • 242-248: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [245-254]

The repetition of the modes constant usage for the <Plug>(gin-diffget-r) mapping in the initWorktree function is a good practice. It ensures that the mappings are consistently applied across different parts of the code, adhering to the intended operational modes and contributing to the overall objective of refining command mappings.

  • 261-267: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [264-273]

Using the modes constant for the dor and do mappings within the initWorktree function is consistent with the changes made in other parts of the file. This consistency in applying the mode restrictions across different functions is beneficial for maintainability and clarity, ensuring that the mappings are correctly limited to the intended modes.

  • 290-298: The introduction of the modes constant in the initOurs function for the <Plug>(gin-diffput) mapping is consistent with the approach taken in other parts of the file. This consistency ensures that the mappings are limited to the intended modes, contributing to the objective of refining command mappings and enhancing the user experience.
  • 308-308: Using the modes constant for the dp mapping configuration in the initOurs function is consistent with the previous changes and maintains the intended restriction to normal and visual modes. This consistency is beneficial for maintainability and clarity in the codebase.

Copy link
Owner

@lambdalisue lambdalisue left a comment

Choose a reason for hiding this comment

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

LGTM

@lambdalisue lambdalisue merged commit 60c3faa into lambdalisue:main Feb 17, 2024
6 of 9 checks passed
@ogaken-1 ogaken-1 deleted the fix-patch-tab branch February 17, 2024 15:01
@ogaken-1
Copy link
Contributor Author

Thank you!

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.

2 participants