Repository navigation
[6034] 实现统一的编辑器只读模式与视图菜单开关 - #4791
Merged
Merged
Conversation
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.
变更说明
editor_rep中提供is_read_only(),统一聚合三种只读来源:typeset_in_progress())manual_read_only)tmfs(!has_permission(src, "w")设置buf->buf->read_only)edit_announce中统一拦截非MOD_SET_CURSOR、非系统文档装载(in_system_document_load())的文档树修改,弹出对应原因的左下角气泡提示并抛出string("read-only"),由键盘、菜单、鼠标顶层入口统一捕获并清理临时状态,不污染撤销历史。SLOT_READONLY_TIP(气泡驻留 3 秒,绑定readonlyTipLabel生命周期防止悬空this)。测试验证
xmake r unified_readonly_test:3/3 通过xmake r progressive_typeset_test:7/7 通过xmake r edit_table_test:14/14 通过tests/mogan/python/6034.py(文件权限只读 + 视图只读模式开关):全部通过