Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In a function, heredoc instructions after a block of commands grouped with curly braces break outline view #245

Open
jerdoe opened this issue Oct 13, 2021 · 1 comment
Assignees
Labels

Comments

@jerdoe
Copy link

jerdoe commented Oct 13, 2021

When using the following examples, outline view does not show all the functions.
This seems to occur when heredoc instructions in a function, follow a block of commands that was grouped with curly braces.

#!/bin/bash

myfunc1() {
    { 
        echo "one"
        echo "two"
    }
    
    source /dev/stdin <<- SOURCED
        echo "three"
	SOURCED
}

myfunc2() {
    echo "myfunc2"
}

myfunc1
myfunc2
#!/bin/bash

print_article() {
    local body="$1"
    [ -z "$1" ] && { 
        local msg="arg1 must not be empty"
        echo "${msg}"
        exit 1
    }
    
    add_datetime_and_print <<- SOURCED
        "$body"
        Footer
	SOURCED
}

add_datetime_and_print() {
    local my_stdin
    
    printf "%(%Y-%m-%d %H:%M:%S)T\n"
    while read my_stdin
    do
        printf '%s\n' "${my_stdin}"
    done
}

print_article 'Hello World!'
@de-jcup
Copy link
Owner

de-jcup commented Dec 30, 2021

Thanx for reporting - yes this is a bug.

@de-jcup de-jcup added the bug label Dec 30, 2021
@de-jcup de-jcup self-assigned this Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants