目录
Arihan Varanasi

Add keyboard shortcut to toggle Markdown rendered/raw view (#16413)

Description

Adds a rebindable keyboard shortcut (default Cmd+E / Ctrl+E) that toggles a Markdown file between the rendered and raw views, as an alternative to clicking the Rendered/Raw control in the pane header.

  • The shortcut is gated by a keymap context (MarkdownDisplayModeToggle) rather than by filtering inside the action handler. FileNotebookView and CodeView each add the context only when the pane shows the Rendered/Raw control, so the binding is not triggerable anywhere else and the keystroke falls through in non-Markdown panes.
  • Both directions are registered under the same binding name and description (the same pattern as “Save file”), so Settings > Keyboard shortcuts shows a single “Toggle Markdown rendered/raw view” row and rebinding it applies to both views.
  • The CodeView binding is behind #[cfg(feature = "local_fs")], matching the existing Rendered/Raw control there.
  • File-type detection is unchanged. CodeView sets the context when its Rendered/Raw control is present, so the shortcut and the control always agree.

Linked Issue

Fixes #11786

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

New tests:

- workspace::view::tests::test_markdown_toggle_shortcut_switches_between_raw_and_rendered_panes dispatches the keystroke through the focused editor and its ancestors, the way a real key press is routed, and checks the round trip raw → rendered → raw, and that the keystroke is unhandled in a .rs pane. - notebooks::file::tests::test_markdown_toggle_shortcut_only_handled_for_toggleable_files checks that the rendered pane only handles the shortcut for files that show the toggle. - util::bindings::tests::test_markdown_display_mode_toggle_is_rebound_in_both_directions checks that rebinding the shortcut applies to both registrations. - notebooks::file::tests::test_markdown_toggle_shortcut_follows_jupyter_notebook_rendering_flag checks that the rendered pane handles the shortcut for an .ipynb file only when JupyterNotebookRendering is enabled.

The first two fail if the keymap context is not inserted.

./script/presubmit was run in full on the first commit: format, clippy, clang-format, wgslfmt and shellcheck pass (PSScriptAnalyzer was skipped, I don’t have PowerShell installed). 12,737 of 12,743 tests passed. The 6 failures were 5 SSH integration tests that need access to the GCP test VM, and ui_tests::test_cloud_agent_shell_respawn, which passed when re-run on its own. After the later commits I re-ran format, cargo clippy -p warp --all-targets --tests and the related tests, not the full suite.

Not covered: the .ipynb toggle shares this shortcut behind JupyterNotebookRendering. It is tested from the rendered pane only. There is no test that presses the shortcut in a raw .ipynb pane, and I did not check notebooks manually.

  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

https://github.com/user-attachments/assets/11d698c4-a41f-4c5d-ac2f-86dfcc3a9f43

Agent Mode

  • Warp Agent Mode - This PR was created via Warp’s AI Agent Mode

CHANGELOG-IMPROVEMENT: Added a keyboard shortcut (Cmd+E / Ctrl+E, rebindable) to toggle Markdown files between rendered and raw view.

Co-Authored-By: Claude Code

1天前2518次提交
Warp Agentic Development Environment product preview  

Built with Warp

Website · Code · Agents · Terminal · Drive · Docs · How Warp Works

[!NOTE] OpenAI is the founding sponsor of the new, open-source Warp repository, and the new agentic management workflows are powered by GPT models.

About

Warp is an agentic development environment, born out of the terminal. Use Warp’s built-in coding agent, or bring your own CLI agent (Claude Code, Codex, Gemini CLI, and others).

Installation

You can download Warp and read our docs for platform-specific instructions.

Warp Contributions Overview Dashboard

Explore build.warp.dev to:

  • Watch thousands of Warp Factory agents triage issues, write specs, implement changes, and review PRs
  • View top contributors and in-flight features
  • Track your own issues with GitHub sign-in
  • Click into active agent sessions in a web-compiled Warp terminal

Automate development with Warp Factories

This repository is driven by Warp Factories: open, flexible infrastructure for teams to build cloud software factories of their own.

Warp Factories are defined in code and easy to deploy on any model or harness, with evals, benchmarks, and self-improvement built in. Get early access or book a demo for a tailored walk-through of the platform. Eligible teams can receive up to $10,000 in free factory usage.

Licensing

Warp’s UI framework (the warpui_core and warpui crates) are licensed under the MIT license.

The rest of the code in this repository is licensed under the AGPL v3.

Open Source & Contributing

Warp’s client codebase is open source and lives in this repository. We welcome community contributions and have designed a lightweight workflow to help new contributors get started. For the full contribution flow, read our CONTRIBUTING.md guide.

[!TIP] Chat with contributors and the Warp team in the #oss-contributors Slack channel — a good place for ad-hoc questions, design discussion, and pairing with maintainers. New here? Join the Warp Slack community first, then jump into #oss-contributors.

Issue to PR

Before filing, search existing issues for your bug or feature request. If nothing exists, file an issue using our templates. Security vulnerabilities should be reported privately as described in CONTRIBUTING.md.

Once filed, a Warp maintainer reviews the issue and may apply a readiness label: ready-to-spec signals the design is open for contributors to spec out, and ready-to-implement signals the design is settled and code PRs are welcome. Anyone can pick up a labeled issue — mention @oss-maintainers on an issue if you’d like it considered for a readiness label.

Building the Repo Locally

To build and run Warp from source:

./script/bootstrap   # platform-specific setup
./script/run         # build and run Warp
./script/presubmit   # fmt, clippy, and tests

See AGENTS.md for the full engineering guide, including coding style, testing, and platform-specific notes.

Joining the Team

Interested in joining the team? See our open roles.

Support and Questions

  1. See our docs for a comprehensive guide to Warp’s features.
  2. Join our Slack Community to connect with other users and get help from the Warp team — contributors hang out in #oss-contributors.
  3. Try our Preview build to test the latest experimental features.
  4. Mention @oss-maintainers on any issue to escalate to the team — for example, if you encounter problems with the automated agents.

Code of Conduct

We ask everyone to be respectful and empathetic. Warp follows the Code of Conduct. To report violations, email warp-coc at warp.dev.

Open Source Dependencies

We’d like to call out a few of the open source dependencies that have helped Warp to get off the ground:

关于
820.4 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号