[vim/vim] Inconsistent `fo-m` linebreak around semicolons (Issue #19095)

7 views
Skip to first unread message

One-In-Dark

unread,
Jan 5, 2026, 11:50:34 AM (4 days ago) Jan 5
to vim/vim, Subscribed
One-In-Dark created an issue (vim/vim#19095)

Steps to reproduce

vim --clean+Enter
:set tw=9+Enter
i+expect a:b

The expected behaviour is observed:

expect
a:b

Continue editing:
Esc+:set fo+=m+Enter
o+expect a:b

expect a:
b

But :h fo-m is “Also break at a multibyte character above 255. This is useful for Asian text where every character is a word on its own.”

Expected behaviour

Setting fo-m should not allow linebreaks after a semicolon.

Version of Vim

9.1 patch 1-1914

Environment

OS: Windows 11 24H2 26100.7462
Terminal: Windows Terminal

Logs and stack traces


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19095@github.com>

zeertzjq

unread,
Jan 5, 2026, 7:23:43 PM (4 days ago) Jan 5
to vim/vim, Subscribed
zeertzjq left a comment (vim/vim#19095)

This seems to be a regression from patch 8.2.0901.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19095/3712564940@github.com>

Christian Brabandt

unread,
Jan 6, 2026, 4:21:18 AM (4 days ago) Jan 6
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19095)

ping @lilydjwg ?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19095/3713856960@github.com>

依云

unread,
Jan 6, 2026, 5:14:32 AM (4 days ago) Jan 6
to vim/vim, Subscribed
lilydjwg left a comment (vim/vim#19095)

The current behavior is indeed contrary with the doc, but why do you expect a:b to be treated like a word? There are other single byte punctuations involved the patch. Should they all be not handled by fo-m and blame the author who uses them in CJK text intead?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19095/3714077542@github.com>

依云

unread,
Jan 7, 2026, 1:29:05 AM (3 days ago) Jan 7
to vim/vim, Subscribed
lilydjwg left a comment (vim/vim#19095)

Not changing this would allow a colon following a Han character to be break, e.g. 一二三四:b would become

一二三四
:b

(Adding a space before b doesn't change this.)

There are also some other single-byte characters included in the patch this way, e.g. %>]} that are used in formal Chinese writing (i.e. not using the full-width version). So I prefer to not changing the current behavior, but updating the doc instead.

@chrisbra what do you think?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19095/3717501921@github.com>

One-In-Dark

unread,
Jan 7, 2026, 3:44:42 AM (3 days ago) Jan 7
to vim/vim, Subscribed
One-In-Dark left a comment (vim/vim#19095)

With all the format options regarding multibyte characters, it seems to me that Vim is willing for a correct CJK linebreak ruleset.

IMO it's only ok to break after a punctuation that follows a multibyte character. E.g., 中文:eng can be linebreak-ed into 中文:+eng, but not so when I intentionally type no space in en:us.

I am not familiar with the codebase, but I hope it's feasible to add that check. I may submit a patch about this when I'm available, hopefully in weeks...


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19095/3717856229@github.com>

Christian Brabandt

unread,
Jan 7, 2026, 3:22:31 PM (2 days ago) Jan 7
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19095)

the last two messages are contradictory:

Not changing this would allow a colon following a Han character to be break, e.g. 一二三四:b

vs

IMO it's only ok to break after a punctuation that follows a multibyte character. E.g., 中文:eng

Can we first agree on what rule should be followed here?

For now a doc-patch clarifying the current behavior how punctuation characters are handled would be preferable. A patch might be acceptable later, if it comes with test cases and describes the CJK linebreaking rules better and e.g. people using CJK agree on such a change and do not complain about such a change.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19095/3720632096@github.com>

One-In-Dark

unread,
Jan 7, 2026, 7:58:41 PM (2 days ago) Jan 7
to vim/vim, Subscribed
One-In-Dark left a comment (vim/vim#19095)

Yes, updating the doc is the solution to this issue. I should have opened another issue for the "better" CJK libebreaking. Sorry for the noise here.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19095/3721463749@github.com>

依云

unread,
Jan 7, 2026, 10:11:13 PM (2 days ago) Jan 7
to vim/vim, Subscribed
lilydjwg left a comment (vim/vim#19095)

the last two messages are contradictory:

Not changing this would allow a colon following a Han character to be break, e.g. 一二三四:b

vs

IMO it's only ok to break after a punctuation that follows a multibyte character. E.g., 中文:eng

Can we first agree on what rule should be followed here?

I also mean that a break should be after the colon (and some other punctuations), not before. Sorry if it wasn't clear.

I'm not sure about Korean, but Chinese basically has the same idea on breaking around punctuations as English. The differences are mainly caused by Chinese doesn't use spaces to separate words.

IMO using half-width : in Chinese is not good and should be replaced by the full-width , but many people don't care much about half-width vs full-width punctuations, and it's sometimes hard to say which one should be used in mixed language text.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19095/3721695101@github.com>

Christian Brabandt

unread,
Jan 8, 2026, 4:41:47 PM (yesterday) Jan 8
to vim/vim, Subscribed

Closed #19095 as completed via cf8e378.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/19095/issue_event/21933492683@github.com>

Reply all
Reply to author
Forward
0 new messages