Loading ...
Sorry, an error occurred while loading the content.

55185Re[2]: Folding with shell syntax

Expand Messages
  • Sonic_Wind
    Nov 30, 2004
      Hello Gary,
      I've already sent a letter with suggestion how to fix it.
      But now I have to correct myself. The bug was not there.
      4 lines below:
      line 334:
      syn match bkshFunction "^\s*\<\h\w*\>\s*()" skipwhite skipnl contains=bkshFunctionParen
      " someone forgoten to add <contained> key word so the pattenr maches
      "and the start pattern fails to match.

      Now it looks like this and work:

      syn match bkshFunction "^\s*\<\h\w*\>\s*()" contained skipwhite skipnl contains=bkshFunctionParen

      Tuesday, November 30, 2004, 5:11:23 AM, you wrote:

      GJ> I can't get this to work, either. More precisely, the folding of
      GJ> "here" documents works fine but the folding of functions does not.
      GJ> I tried to isolate the problem to something in my setup, but even a
      GJ> minimal configuration still exhibits the problem.

      GJ> I created the following test file, syn_test.sh:

      GJ> ----------------------------------------------------------------

      GJ> cat << EOF > /dev/null
      GJ> this
      GJ> that
      GJ> EOF

      GJ> fix_path() {
      GJ> some_path=""
      GJ> other_path=""
      GJ> }

      GJ> ----------------------------------------------------------------

      GJ> started vim with this command:

      GJ> vim -N -u NONE syn_test.sh

      GJ> and executed these commands within vim:

      GJ> set foldmethod=syntax
      GJ> let g:sh_fold_enabled=1
      GJ> so $VIMRUNTIME/syntax/sh.vim

      GJ> The result was that the four lines of the "here" document were
      GJ> folded but the function was not. It looks like a bug in
      GJ> syntax/sh.vim to me.

      Best regards,
      Sonic_Wind mailto:sonic_wind@...
    • Show all 9 messages in this topic