Repository navigation
Conversation
tm-files.scm 新增:
- cyclic-view-index:环形下标纯函数,单 tab 时原地、空列表返回 #f;
- switch-to-view-offset / switch-to-next-view / switch-to-previous-view:
基于 (tabpage-list #t) 与 (current-view) 定位当前 tab,按偏移回绕切换,
复用已有的 switch-to-view-index 做实际切换。当前 view 不在本窗口 tab
列表或只有一个 tab 时不动作。
generic-kbd.scm 的 std profile 绑定快捷键。Qt 对 Shift+[ 上报的 key 随平台
而异,qt_utilities.cpp 归一为三种形式(Windows/Linux "C-{";macOS "M-S-["
或 "M-S-{"),三种写法都绑以保证各平台一致。
tm-files-test.scm 补充 headless 测试:cyclic-view-index 的前后回绕与边界,
以及 next/previous 往返后 current-view 不变。
Closes MoganLab#4685
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
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.
需求
Closes #4685。新增快捷键在标签页之间快速切换:
两端回绕:最后一个 tab 按「下一个」回到第一个,反之亦然。
改动
TeXmacs/progs/texmacs/texmacs/tm-files.scmcyclic-view-index idx delta len:环形下标纯函数。len <= 0返回#f;单 tab 时原地不动。抽成纯函数是为了 headless 可测。switch-to-view-offset delta:用(tabpage-list #t)取当前窗口 tab 序列,list-index定位(current-view),再交给已有的switch-to-view-index做实际切换(与std 1…std 6同一路径,不另起切换逻辑)。当前 view 不在本窗口 tab 列表或只有一个 tab 时不动作。switch-to-next-view/switch-to-previous-view:偏移 ±1 的薄封装,供快捷键绑定。TeXmacs/progs/generic/generic-kbd.scm在
(kbd-map (:profile std) ...)中、紧随std 1…std 6之后新增绑定。关于为什么绑了三种写法:
qt_utilities.cpp的from_key_press_event对带 Shift 的可打印键按平台归一:C-S-+ Qt 上报的{→C-{M-S-+ 非字母键 →M-S-<key>,而 Qt 在 macOS 上对 Shift+[ 上报的 key 可能是[或{(源码中已有 "M-+ for Qt 6.5 on macOS is M-S-=" 的同类注记)因此分别绑
std {/std }(Windows/Linux)、std S-[/std S-]与std S-{/std S-}(macOS 两种可能)。std前缀按平台展开为C-/M-,多余的组合在对方平台上不会被触发,无副作用。全仓库 grep 确认C-{、C-}、M-S-[、M-S-]此前均未被绑定,无冲突。TeXmacs/progs/texmacs/texmacs/tm-files-test.scm补充两组 headless 测试(
xmake r tm-files-test):cyclic-view-index前后回绕、单 tab 原地、空列表#f;switch-to-next-view后switch-to-previous-view,current-view必须回到原值且不抛错(不依赖 headless 下的 tab 数量)。未做的事
xmake r tm-files-test与gf fmt,烦请以 CI 为准。改动全部在 Scheme 层,无 C++ 变更。🤖 Generated with Claude Code