1

Fold 3 below fold in lines below the end of the function. How can I make this fold in the expected way (to preserve the lines below the end of function):

Code :

(function() {
        var w = window; // <-- FOLD 1 pressed HERE
        function pqdoitall () {
                // insertScript
                // fr2window 
                // pqinsert2windowDoc
                // pqinsert2window
                // runit
                //runit(); // <-- FOLD 2 pressed HERE
        } // pqdoitall
        w.addEventListener("load",pqtdoitall);
        pqtdoitall(); // <-- FOLD 3 pressed HERE
})();

Fold 1 Result:

(function() {----------------------------------------------------------------------------

Fold 2 Result:

(function() {
        var w = window;
  function pqdoitall () {----------------------------------------------------------------

Fold 3 Result:

(function() {
        var w = window;
  function pqdoitall () {----------------------------------------------------------------

This is quite annoying since I would like to see the two lines below the function terminating brace when I fold it.

Foldmethod lines in ~/.vimrc (as per this answer) :

set foldmethod=syntax
set foldlevelstart=1

let javaScript_fold=1         " JavaScript
let perl_fold=1               " Perl
let php_folding=1             " PHP
let r_syntax_folding=1        " R
let ruby_fold=1               " Ruby
let sh_fold_enabled=1         " sh
let vimsyn_folding='af'       " Vim script
let xml_syntax_folding=1      " XML 
Community
  • 1
  • 1
Cris Stringfellow
  • 3,714
  • 26
  • 48

1 Answers1

2

OK. While this is not a real answer to your question, I've found the syntax folding method a lot more disappointing than the "dumber" indent method which produces more coherent results across languages.

set foldmethod=indent is all I use.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • 1
    Well, it suggests the question is itself kind of ill-posed, since the method I'm asking for an answer for, is actually inferior to the one your propose. I'd say that's *as real as it gets.* :) – Cris Stringfellow Mar 04 '13 at 14:49