Skip to content

Conversation

@jimmy54
Copy link
Contributor

@jimmy54 jimmy54 commented Sep 25, 2025

Pull request

Issue tracker

Fixes will automatically close the related issue

Fixes #

Feature

Describe feature of pull request

Unit test

  • Done

Manual test

  • Done

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

jimmy54 and others added 8 commits March 13, 2025 21:04
Add support for inserting elements at specific positions in config lists
using the syntax "/N+" where N is the insertion index.

Changes:
- Add ParseIndexedAppend() function to parse "/N+" syntax from config keys
- Extend AppendToList() to accept optional insert_pos parameter
- Update IsAppending(), IsMerging(), and StripOperator() to handle indexed insertion
- Add bounds checking for insertion position with error logging
- Support both append and insert operations in EditNode()

Examples:
- "key/0+" inserts at beginning of list
- "key/2+" inserts at index 2
- "key+" continues to append at end (backward compatible)

This enhancement allows more precise control over list element positioning
in RIME configuration files while maintaining backward compatibility.
Remove the Chinese documentation file that detailed Rime input method
transformation rules (xlit, xform, derive, erase, fuzz, abbrev).

This document was likely added for temporary reference and is not part
of the core librime documentation structure. The official documentation
should be maintained in the appropriate upstream repositories.
@jimmy54
Copy link
Contributor Author

jimmy54 commented Sep 25, 2025

"含列表的設定項/+": 與列表合併的設定值(必須爲列表)
"含字典的設定項/+": 與字典合併的設定值(必須爲字典,注意YAML字典的無序性)

在上面的基础上添加向指定位置插入列表:
"含列表的設定項/index+": 與列表合併的設定值(必須爲列表)
"含字典的設定項/index+": 與字典合併的設定值(必須爲字典,注意YAML字典的無序性)

例如:

patch:
  speller/algebra/0+:
    - derive/^([c])([^h])/$1h$2/ # c => ch
    - derive/^([c])h/$1/ # ch => c
    - derive/^([z])h/$1/ # zh => z
    - derive/^([z])([^g])/$1h$2/ # z => zh

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.

2 participants