[201_96] fix: accent marks tooltip shows option key ⌥ on macOS#2981
Closed
divyansharma001 wants to merge 1 commit intoMoganLab:mainfrom
Closed
[201_96] fix: accent marks tooltip shows option key ⌥ on macOS#2981divyansharma001 wants to merge 1 commit intoMoganLab:mainfrom
divyansharma001 wants to merge 1 commit intoMoganLab:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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_prevailsso it no longer rewritesA-<key>intoescape <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_prevailsis now an identity function, so the initial loop inkbd_system_rewritethat calls it and potentially recurses can never trigger. Consider removingkbd_system_prevailsand 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.
Contributor
|
CI failed, please fix it |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2962
~) was showing a wrong symbol (⊙) instead of the Option key symbol ⌥kbd_system_prevailsintm_config.cppwas converting"A-~"(Option+~) to"escape ~"for display, causing the Escape key symbol to render as ⊙ in the apple-lucida font at small sizekbd_system_prevailsto return the input unchanged, soA-is decoded as⌥(U+2325) via the existing macOS keyboard mapTest plan
等效快捷键: (⌥ ~)with the correct Option key symbol ⌥ instead of ⊙