[vim/vim] runtime(sh): function which name is `doFOOBAR` is not folded (Issue #19619)

2 views
Skip to first unread message

KSR-Yasuda

unread,
Mar 9, 2026, 1:49:31 AMMar 9
to vim/vim, Subscribed
KSR-Yasuda created an issue (vim/vim#19619)

Steps to reproduce

Shell functions which names begin with do are not folded with foldmethod=syntax.

function foo() {        # - OK: fold lv.1
    return 0            # |
}                       # | until here

function dofoo() {      # - NG: fold lv.1 expected, but unfolded
    return 0            # |
}                       # | until here

shFunction{Two,Four} are supposed to be excluding functions named doFOOBAR.
https://github.com/vim/vim/blob/b8b7df29c418b93fa3d8607ae22f10701fa168d6/runtime/syntax/sh.vim#L653-L683

In bash, function doFOOBAR does work, at least.

If the region patterns just expect to avoid do ... done, the part \%(do\) shouldn't be something else?
(\%(\<do\>\)\@! or such, maybe.)

Expected behaviour

Functions named doFOOBAR() are folded.

Version of Vim

9.1.1997-1

Environment

Operating system: Windows 11 25H2 [Version 10.0.26200.7462] (msys2-runtime 3.6.5-1)
Terminal: xterm-256color
Shell: bash

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/19619@github.com>

Christian Brabandt

unread,
4:41 PM (7 hours ago) 4:41 PM
to vim/vim, Subscribed

Closed #19619 as completed via 9c0d057.


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/19619/issue_event/23866652401@github.com>

KSR-Yasuda

unread,
8:37 PM (3 hours ago) 8:37 PM
to vim/vim, Subscribed
KSR-Yasuda left a comment (vim/vim#19619)

Thank you for the patch!


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/19619/4122352535@github.com>

Reply all
Reply to author
Forward
0 new messages