brobeson / Tools

Scripts written to aid software development.
2 stars 1 forks source link

Vim comment plugin doesn't account for blank lines #8

Closed brobeson closed 9 years ago

brobeson commented 9 years ago

If a range of lines to comment includes blank lines, the comment markers are at the left margin, instead of against the code. It produces the same incorrect result when the code is folded prior to invocation.

Example:

namespace Foo
{
//    void bar()
//    {
//        std::cout << "fun times\n";
//
//        std::cout << "good times\n";
//    }
}

The correct result is:

namespace Foo
{
    //void bar()
    //{
    //    std::cout << "fun times\n";
    //
    //    std::cout << "good times\n";
    //}
}

This needs to be fixed in

brobeson commented 9 years ago

Correcting the folded code will not be fixed. The fold text reports how many lines are folded; use that as the range to the command.