Allow wrapping selected text with backticks instead of replacing it #2879
Zak Siddiqui opened 5 days ago

Summary

When working in text input fields, users frequently need to wrap text in inline code spans using backticks (`). Currently, this requires manually placing a backtick before and after the text. This issue proposes that when text is selected/highlighted and the user presses the backtick key, the selected text should be wrapped with backticks rather than replaced by a single backtick.


Current Behavior

  1. The user types or selects text in a text input field.
  2. To wrap it in backticks, the user must:
    • Position the cursor before the text and type `
    • Then reposition the cursor after the text and type ` again (or vice versa).

This requires multiple cursor movements and key presses.


Expected Behavior

  1. The user highlights/selects any portion of text (via keyboard or mouse — method should not matter).
  2. The user presses the backtick key (`).
  3. Instead of the selected text being replaced with a single backtick character, the selected text is enclosed with a backtick on each side.

Example:

Before KeypressAfter Keypress
someFunction (highlighted)`someFunction`

Motivation

This is a small but meaningful productivity enhancement. Wrapping text in delimiters (like backticks, quotes, or brackets) is a common pattern in code editors and markdown editors. Implementing this behavior for backticks would:

  • Reduce keystrokes and cursor movements — turning a multi-step process into a single keypress.
  • Align with user expectations — This feature is supported by GitLab and is commonly missed by users who come from GitLab.
  • Improve the experience for users who frequently use inline code formatting (e.g., developers writing in markdown).
1/1
Type
Improvement
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (4)
Reference
OD-2879
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover