Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

在overleaf中吞掉选中内容之前的左大括号

Open
#1,920 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
desktop

Research direction

Reproduce the issue in Overleaf using Edge with inline_preedit enabled and the reported Weasel settings in weasel.yaml and weasel.custom.yaml. Trace how selection replacement and multi-character composition are handled, then verify that typing multiple characters preserves the opening brace while replacing the selected text.

Written by the indexing model from the issue text.

Description

Bug

上报前请检查

  • 我遇到的问题没有其他人在 issue 里提到过
  • 我的小狼毫版本于 rime/weasel 下载
  • 我在使用小狼毫的最新发布版本,或最新发布版本后的 CI 构建

操作系统信息

  • OS 详细版本: Windows 11 25H2 26200.9168
  • 小狼毫版本: 0.17.4.0
  • Edge浏览器版本:版本 152.0.4191.53 (正式版本) (64 位)

描述遇到的问题
在overleaf中,使用雾凇拼音或者明月拼音简化字,选中大括号内的文本或者光标在一对空的大括号内,输入新内容时,若超过一个字,则会导致左大括号消失。

复现步骤
重现问题的步骤,如:

  1. 打开overleaf写LaTeX。
  2. 假设已有内容\section{示例标题}或者英文输入\sec由overleaf补全为\section{},光标在大括号内
  3. 鼠标双击选中“示例标题”
  4. 若输入“怎么”,即zen'me或者z'm,“怎么”二字正常上屏,但左大括号{消失,变成\section怎么}
  5. 若输入“怎”,即zen或者z,一切正常,得到\section{怎}

预期行为
无论输入什么内容,都正常替换掉选中的内容,且不影响其他内容。

用户文件
根据 #946 和另一个issue,检查了inline_preedit,值为true。
方案使用的是rime-ice。

用户文件夹下weasel.yaml内容如下

# Weasel settings
# encoding: utf-8

# 感谢 @[Mirtle](https://github.com/mirtlecn) 整理
# Rime 定制指南 <https://github.com/rime/home/wiki/CustomizationGuide#定製指南>
# Weasel 定制文档 <https://github.com/rime/weasel/wiki/Weasel-定制化>
# Weasel 字体设定 <https://github.com/rime/weasel/wiki/字體設定>

# Weasel 特殊行为的命令行选项
# WeaselServer.exe /ascii - CLI 中切换 ASCII 模式
# WeaselServer.exe /nascii - CLI 中切换非 ASCII 模式
# WeaselSetup.exe /toggleime - 设置系统快捷键用于开启/关闭键盘(0.16.1 以上版本)
# WeaselSetup.exe /toggleascii - 设置系统快捷键用于切换 ASCII 模式(0.16.1 以上版本)

# 部分选项需要将 Weasel 更新 16.0 及以上版本才能生效
config_version: "2024-09-25"

# [app_options]
# 针对特定应用的设置
app_options:
  firefox.exe:
    inline_preedit: true   # 行内显示预编辑区:规避 <https://github.com/rime/weasel/issues/946>
  # cmd.exe:               # 带 .exe 的进程名:Weasel 15.0 及之前版本须小写
  #   ascii_mode: true     # 英文模式
  # conhost.exe:
  #   ascii_mode: true
  # windowsterminal.exe:
  #   ascii_mode: true
  # wt.exe:
  #   ascii_mode: true
  # pwsh.exe:
  #   ascii_mode: true
  # powershell.exe:
  #   ascii_mode: true
  # mintty.exe:
  #   ascii_mode: true
  # nvim-qt.exe:
  #   ascii_mode: true
  #   vim_mode: true       # vim 模式, Esc <C-c> <C-[> 切换到 ascii 状态
# [End of <app_options>]

# [global settings]
show_notifications: true                   # 是否显示状态变化的通知:true;false;option_list(方案内的开头 option)
show_notifications_time: 1200              # 通知显示的时间,单位 ms
global_ascii: false                        # 切换为 ascii 模式时,是否影响所有窗口:true;false
# [End of <global settings>]

# [style]
# 字体;候选项、候选窗口的行为、布局及样式
style:
  color_scheme: purity_of_form_custom      # 默认配色方案
  # color_scheme_dark: nord                # 深色模式下,Weasel 的配色方案,Windows 10 1809+ 可用

  # 全局字体
  # 格式:字体1:起始码位:结束码位:字重:字形,字体2……,字体会依次 fallback
  # 详细设定请参考 <https://github.com/rime/weasel/wiki/字體設定>
  font_face: "Segoe UI Emoji:23:23, Segoe UI Emoji:2a:2a, Segoe UI Emoji:30:39, Segoe UI Emoji:fe0f:fe0f, Segoe UI Emoji:20e3:20e3, Segoe UI, Microsoft YaHei, DengXian, Segoe UI Emoji, Noto Color Emoji, Segoe UI Symbol"
  label_font_face: "Microsoft YaHei"       # 标签字体
  comment_font_face: "Microsoft YaHei"     # 注释字体
  font_point: 14                           # 全局字体字号
  label_font_point: 14                     # 标签字体字号,不设定 fallback 到 font_point
  comment_font_point: 13                   # 注释字体字号,不设定 fallback 到 font_point

  inline_preedit: true                     # 行内显示预编辑区:true;false
  preedit_type: composition                # 预编辑区内容:composition(编码); preview(选中的候选);preview_all(全部候选)

  fullscreen: false                        # 候选窗口全屏显示:true;false
  horizontal: true                         # 候选项横排:true;false
  vertical_text: false                     # 竖排文本:true;false
  # text_orientation: horizontal           # 文本排列方向,效果和 `vertical_text` 相同:horizontal;vertical
  vertical_text_left_to_right: false       # 竖排方向是否从左到右:true;false
  vertical_text_with_wrap: false           # 文本竖排模式下,自动换行:true;false
  vertical_auto_reverse: false             # 文本竖排模式下,候选窗口位于光标上方时倒序排列:true;false

  label_format: "%s"                       # 标签字符:例如 %s. 效果为 1. 2. 3. ....
  mark_text: ""                            # 标记字符,显示在选中的候选标签前,需要在配色方案中指定颜色;如该项为空字符串 "" 而配色方案中 hilited_mark_color 非透明色,则显示 Windows 11 输入法风格标记
  ascii_tip_follow_cursor: false           # 切换 ASCII 模式时,提示跟随鼠标,而非输入光标
  enhanced_position: true                  # 无法定位候选框时,在窗口左上角显示候选框:true;false
  display_tray_icon: false                 # 托盘显示独立于语言栏的额外图标:true;false
  antialias_mode: default                  # 次像素反锯齿设定:default;force_dword;cleartype;grayscale;aliased
  candidate_abbreviate_length: 30          # 候选项略写,超过此数字则用省略号代替。设置为 0 则不启用此功能
  mouse_hover_ms: 0                        # ! 已弃用。鼠标悬停选词响应时间(ms),设置为 0 时禁用该功能
  hover_type: none                         # 鼠标在候选窗口悬停时:none(无动作);hilite(选中鼠标下的候选);semi_hilite(高亮鼠标下的候选)

  paging_on_scroll: true                   # 在候选窗口上滑动滚轮的行为:true(翻页);false (选中下一个候选)
  click_to_capture: false                  # 鼠标点击候选项,创建截图:true;false

  layout:
    baseline: 0                            # 字号百分比,与 linespacing 一同设置可解决字体跳动问题,设置为 0 为禁用
    linespacing: 0                         # 字号百分比,参考 <https://github.com/rime/weasel/pull/1177>
    align_type: center                     # 标签、候选文字、注解文字之间的相对对齐方式:top ; center ; bottom
    max_height: 600                        # 候选框最大高度,文本竖排模式下如高度超此尺寸则换列显示候选,设置为 0 不启用此功能
    max_width: 0                           # 候选框最大宽度,horizontal 布局如宽超此尺寸则换行显示候选,设置为 0 不启用此功能
    min_height: 0                          # 候选框最小高度
    min_width: 10                          # 候选框最小宽度
    border_width: 2                        # 边框宽度;又名 border
    margin_x: 8                            # 主体元素和候选框的左右边距;为负值时,不显示候选框
    margin_y: 8                            # 主体元素的上下边距;为负值时,不显示候选框
    spacing: 13                            # inline_preedit 为否时,编码区域和候选区域的间距
    candidate_spacing: 22                  # 候选项之间的间距
    hilite_spacing: 6                      # 候选项和相应标签的间距
    hilite_padding: 8                      # 高亮区域和内部文字的间距,影响高亮区域大小
    # hilite_padding_x: 8                  # 高亮区域和内部文字的左右间距,如无特殊指定则依 hilite_padding 设置
    # hilite_padding_y: 8                  # 高亮区域和内部文字的上下间距,如无特殊指定则依 hilite_padding 设置
    shadow_radius: 0                       # 阴影区域半径,为 0 不显示阴影;需要同时在配色方案中指定非透明的阴影颜色
    shadow_offset_x: 4                     # 阴影左右偏移距离
    shadow_offset_y: 4                     # 阴影上下偏移距离
    corner_radius: 8                       # 候选窗口圆角半径
    round_corner: 8                        # 候选背景色块圆角半径,又名 hilited_corner_radius
    # type: vertical                       # 布局设置,效果和 style 下的设置相同:
                                           # horizontal(横向);vertical(竖向) ; vertical_text(竖排文本) ; vertical+fullscreen(全屏) ; horizontal+fullscreen(横向全屏)
# [End of <style>]

# [preset_color_schemes]
# 配色设定
# 在小狼毫用户目录新建 preview 文件夹,将自定义皮肤的截图重命名为 color_scheme_<name>.png 放入此文件夹,可以在「输入法设定」中看到自定义皮肤效果

# 小狼毫配色在线设计:
# [RIME 西米](https://fxliang.github.io/RimeSeeMe/)
# [小狼毫配色详解](https://github.com/rime/weasel/wiki/定制小狼毫配色)

preset_color_schemes:
  # 以下是一个配色方案示例
  nord:                                      # 在 `style/color_schema` 指定的配色方案值
    name: "远山/Nord"                       # 方案设置中显示的配色名称
    author: Mirtle                           # 配色作者名称
    color_format: rgba                       # 颜色格式:argb(0xaarrggbb);rgba(0xrrggbbaa);abgr(0xaabbggrr 默认)
    # 默认配色
    text_color: 0x2E3440                     # 文字
    shadow_color: 0x000000b4                 # 阴影
    label_color: 0x4C566A                    # 标签
    comment_text_color: 0xD08770             # 注释
    border_color: 0xECEFF4                   # 边框
    back_color: 0xECEFF4                     # 背景
    # 普通候选项配色
    candidate_back_color: 0xECEFF4           # 背景
    # candidate_border_color:                # 边框
    # candidate_shadow_color:                # 阴影
    candidate_text_color: 0x2E3440           # 文字
    # 编码区域配色
    hilited_text_color: 0x000000             # 文字
    hilited_back_color: 0xEBCB8B             # 背景
    # hilited_shadow_color:                  # 阴影
    # 选中的候选区域配色
    hilited_mark_color: 0xBF616A             # 标签前的标记
    hilited_label_color: 0x4C566A            # 标签
    hilited_comment_text_color: 0xBF616A     # 注释
    hilited_candidate_text_color: 0x2E3440   # 文字
    hilited_candidate_border_color: 0x8FBCBB # 边框
    hilited_candidate_back_color: 0x8FBCBB   # 背景
    # hilited_candidate_shadow_color:        # 阴影
    # inline_preedit: false 时翻页箭头颜色,不设置则不显示箭头
    # nextpage_color: 0x000000               # 下一页
    # prevpage_color: 0x000000               # 上一页

  # 修改自鼠须管配色方案
  purity_of_form_custom:
    name: "純粹的形式/Purity of Form Custom"
    author: 雨過之後、佛振
    text_color: 0x808080
    back_color: 0x545554
    label_color: 0xBBBBBB
    border_color: 0x545554
    shadow_color: 0xb4000000
    comment_text_color: 0x808080
    candidate_text_color: 0xEEEEEE
    hilited_text_color: 0xEEEEEE
    hilited_comment_text_color: 0x808080
    hilited_candidate_back_color: 0xE3E3E3
    hilited_candidate_border_color: 0xE3E3E3
    hilited_candidate_label_color: 0x4C4C4C
    hilited_candidate_text_color: 0x000000

  # 以下为 weasel 自带的配色方案
  # source: <https://github.com/rime/weasel/blob/master/output/data/weasel.yaml>

  aqua:
    name: 碧水/Aqua
    author: 佛振 <[email protected]>
    text_color: 0x000000
    back_color: 0xeceeee
    shadow_color: 0x00000000
    border_color: 0xe0e0e0
    hilited_text_color: 0x000000
    hilited_back_color: 0xd4d4d4
    hilited_shadow_color: 0x00000000
    hilited_candidate_text_color: 0xffffff
    hilited_candidate_back_color: 0xfa3a0a
    hilited_candidate_shadow_color: 0x00000000
    candidate_text_color: 0x000000
    candidate_back_color: 0xeceeee
    candidate_shadow_color: 0x00000000

  ......
# [End of <preset_color_schemes>]

weasel.custom.yaml内容如下:

customization:
  distribution_code_name: Weasel
  distribution_version: 0.17.4
  generator: "Weasel::UIStyleSettings"
  modified_time: "Tue Sep  1 11:15:10 2026"
  rime_version: 1.13.1
patch:
  "style/color_scheme": aqua

截图

Image Image Image Image

其他补充说明
如果有其他补充说明,可以写在这里

Dominant language
C++
Stars
8.2k
Forks
840
Avg merge
2d 21h
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rime/weasel

All issues in rime/weasel

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.