Skip to content

[201_96] fix: accent marks tooltip shows option key ⌥ on macOS#2981

Closed
divyansharma001 wants to merge 1 commit intoMoganLab:mainfrom
divyansharma001:divyansharma001/201_96/fix-macos-accent-tooltip
Closed

[201_96] fix: accent marks tooltip shows option key ⌥ on macOS#2981
divyansharma001 wants to merge 1 commit intoMoganLab:mainfrom
divyansharma001:divyansharma001/201_96/fix-macos-accent-tooltip

Conversation

@divyansharma001
Copy link
Contributor

@divyansharma001 divyansharma001 commented Mar 15, 2026

Summary

Fixes #2962

  • On macOS, the keyboard shortcut tooltip for accent marks (e.g. the tilde accent ~) was showing a wrong symbol (⊙) instead of the Option key symbol ⌥
  • Root cause: kbd_system_prevails in tm_config.cpp was converting "A-~" (Option+~) to "escape ~" for display, causing the Escape key symbol to render as ⊙ in the apple-lucida font at small size
  • Fix: simplified kbd_system_prevails to return the input unchanged, so A- is decoded as (U+2325) via the existing macOS keyboard map

Test plan

  • Open Mogan on macOS
  • Enter math mode and open the accent insert popup
  • Hover over the tilde accent button
  • Verify tooltip shows 等效快捷键: (⌥ ~) with the correct Option key symbol ⌥ instead of ⊙

Copilot AI review requested due to automatic review settings March 15, 2026 20:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes macOS keyboard shortcut tooltip rendering for accent marks by preventing Option-modified shortcuts (e.g. A-~) from being rewritten into escape ... during system shortcut rendering, so the existing macOS key-symbol mapping can render A- as .

Changes:

  • Simplify kbd_system_prevails so it no longer rewrites A-<key> into escape <key> on macOS.
  • Add a developer note with manual test steps for verifying the accent tooltip shows correctly on macOS.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Texmacs/Server/tm_config.cpp Stops rewriting A-... to escape ... during shortcut rendering so macOS Option () can display correctly.
devel/201_96.md Adds a testing/how-it-works note for the macOS accent tooltip fix.
Comments suppressed due to low confidence (1)

src/Texmacs/Server/tm_config.cpp:343

  • kbd_system_prevails is now an identity function, so the initial loop in kbd_system_rewrite that calls it and potentially recurses can never trigger. Consider removing kbd_system_prevails and the pre-scan loop entirely (or leaving a clear TODO) to avoid dead code and an extra pass over the shortcut string on every render.
static string
kbd_system_prevails (string s) { return s; }

tree
tm_config_rep::kbd_system_rewrite (string s) {
  bool cs= (get_preference ("case sensitive shortcuts") == "on");
  system_kbd_initialize (system_kbd_decode);
  int start= 0, i;
  int s_N  = N (s);
  for (i= 0; i <= s_N; i++) {
    if (i == s_N || s[i] == ' ') {
      string ss= s (start, i);
      string rr= kbd_system_prevails (ss);
      if (rr != ss) {
        return kbd_system_rewrite (s (0, start) * rr * s (i, s_N));
      }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JackYansongLi
Copy link
Contributor

CI failed, please fix it

@Yuki-Nagori
Copy link
Contributor

Thank you, I looked at your code. Making this change might affect Windows and Linux. I think #2982 is better, so this PR is closed. Sorry.

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.

macOS 上重音符号快捷键显示有问题

4 participants