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 enabling/disabling of ctrl-o in commit message panel #3395

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

stefanhaller
Copy link
Collaborator

  • PR Description

This fixes two minor regressions introduced in #3097 related to commands that open a commit message panel but don't set an onSwitchToEditor function (an example is the commit message panel that appears when moving a custom patch to a new commit):

  • the "Press to open menu" hint was hidden. That's wrong, it is still possible to open the menu in this case. (And it still worked, we just wouldn't show the hint.)

  • invoking the "open in editor" menu item would silently do nothing. Now we set a DisabledReason for the item in this case.

  • Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • Docs (specifically docs/Config.md) have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

Previously we would hide it if no onSwitchToEditor function was set; that was
from a time when <c-o> was bound directly to the switch-to-editor command. Now
it is bound to showing a menu, and that menu is always available even if no
onSwitchToEditor function is set. (We rather need to disable the switch to
editor item _within_ that menu, see next commit.)
Some operations don't support switching to the editor from the commit message
panel; an example is the commit message panel that appears when moving a custom
patch into a new commit. Disable the "open in editor" menu entry in this case,
instead of silently doing nothing.
@stefanhaller stefanhaller added the ignore-for-release This will exclude the PR from release notes label Mar 18, 2024
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -2.00%) 50.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (9a3db0d) 49990 42067 84.15%
Head commit (7764e6d) 49991 (+1) 42069 (+2) 84.15% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3395) 8 4 50.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

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

Nice one

@stefanhaller stefanhaller merged commit 318a399 into master Mar 19, 2024
17 checks passed
@stefanhaller stefanhaller deleted the fix-enabling-of-ctrl-o-in-commits-panel branch March 19, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release This will exclude the PR from release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants