Skip to content

Add PreviewTextWrapMode#98

Merged
mdgrs-mei merged 8 commits intomainfrom
support-preview-wrap-mode
Jan 5, 2026
Merged

Add PreviewTextWrapMode#98
mdgrs-mei merged 8 commits intomainfrom
support-preview-wrap-mode

Conversation

@mdgrs-mei
Copy link
Owner

This PR adds an option to wrap preview text.

I've confirmed that the length calculation is correct and complex characters (Surrogate pairs and Combining characters) are not split in the middle in this test code.

$option = Get-PSRunDefaultSelectorOption
$option.Theme.PreviewTextWrapMode = 'Character'
$option.Theme.Cursor = '👉🏻 ' # 1F449, 1F3FB
$option.Theme.Marker = '🙋‍♂️' # 1F64B, 200D(ZWJ), 2642, FE0F(Variation Selector)
$option.Prompt = 'Can you render these 🤷‍♂️? ' # 1F937, 200D(ZWJ), 2642, FE0F(Variation Selector)
Set-PSRunDefaultSelectorOption $option

'A', '𐓏', '😁', '', '👩🏽‍🚒', 'パ', '葛󠄀', '🧑🏻‍💻', '👨‍👩‍👧‍👦' | Invoke-PSRunSelector -Expression {@{
    Name = $_
    Preview = @(
        "A`t0041 - ASCII`tA"
        "𐓏`tD801, DCCF - Surrogate Pair w=1`t𐓏"
        "😁`tD83D, DE01 - Surrogate Pair w=2`t😁"
        "`t0061, 0301 - Combining Acute Accent w=1`t"
        "パ`t30CF, 309A - Combining Katakana-Hiragana Semi-Voiced Sound Mark w=2`tパ"
        "葛󠄀`t845B, DB40, DD00 - Variation Selector w=2`t葛󠄀"
        "👩🏽‍🚒`t1F469, 1F3FD, 200D(ZWJ), 1F692 - Combining Character Sequence w=2`t👩🏽‍🚒"
        "🧑🏻‍💻`t1F9D1, 1F3FB, 200D(ZWJ), 1F4BB - Combining Character Sequence w=2`t🧑🏻‍💻"
        "👨‍👨‍👧‍👦`t1F468, 200D(ZWJ), 1F468, 200D(ZWJ), 1F467, 200D(ZWJ), 1F466 - Combining Character Sequence w=2`t👨‍👨‍👧‍👦"
    )
}} -MultiSelection
image

@mdgrs-mei
Copy link
Owner Author

Solves #95

@mdgrs-mei mdgrs-mei merged commit 837a3ca into main Jan 5, 2026
3 checks passed
@mdgrs-mei mdgrs-mei deleted the support-preview-wrap-mode branch January 5, 2026 12:01
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.

1 participant