[vim/vim] Cannot keep leading whitespace in %{} statusline expr (PR #20315)

1 view
Skip to first unread message

glepnir

unread,
May 24, 2026, 7:53:00 AM (18 hours ago) May 24
to vim/vim, Subscribed

Problem:
A leading space in the result of a %{} item is sometimes stripped, and an all-digit result is converted to a number.

Solution:
Add %0{} which inserts the expression result verbatim.

Fix #3898


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20315

Commit Summary

  • 33582ad Cannot keep leading whitespace in %{} statusline expr

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20315@github.com>

glepnir

unread,
May 24, 2026, 7:59:39 AM (18 hours ago) May 24
to vim/vim, Push

@glepnir pushed 1 commit.

  • c1f7b54 Cannot keep leading whitespace in %{} statusline expr


View it on GitHub or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20315/before/33582addfcc92a688a529ee19aa2bee9fbf280f0/after/c1f7b5456704d0e515768e94b0705d8ec0b7f2dc@github.com>

zeertzjq

unread,
May 24, 2026, 8:02:31 AM (18 hours ago) May 24
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In src/buffer.c:

> @@ -5078,7 +5079,7 @@ build_stl_str_hl_local(
 	    do_unlet((char_u *)"g:actual_curbuf", TRUE);
 	    do_unlet((char_u *)"g:actual_curwin", TRUE);
 
-	    if (str != NULL && *str != NUL)
+	    if (zeropad == FALSE && str != NULL && *str != NUL)
⬇️ Suggested change
-	    if (zeropad == FALSE && str != NULL && *str != NUL)
+	    if (!zeropad && str != NULL && *str != NUL)


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20315/review/4352430087@github.com>

glepnir

unread,
May 24, 2026, 8:05:59 AM (18 hours ago) May 24
to vim/vim, Push

@glepnir pushed 1 commit.

  • 5288a14 Cannot keep leading whitespace in %{} statusline expr


View it on GitHub or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20315/before/c1f7b5456704d0e515768e94b0705d8ec0b7f2dc/after/5288a1498b56cf6584684c59f0096297dc4aac75@github.com>

Reply all
Reply to author
Forward
0 new messages