# HG changeset patch # User Ludovic Chabant # Date 1406676889 25200 # Node ID 001b341ab8adb3b7cfa05d4812f842591dad10d5 # Parent e5ac6464a76793097719808cf5f1987073c66c89 Fix for Lawrencium files having folded sections deleted incorrectly. diff -r e5ac6464a767 -r 001b341ab8ad plugin/lawrencium.vim --- a/plugin/lawrencium.vim Tue Jul 29 16:34:17 2014 -0700 +++ b/plugin/lawrencium.vim Tue Jul 29 16:34:49 2014 -0700 @@ -366,8 +366,12 @@ let l:was_buffer_empty = (line('$') == 1 && getline(1) == '') execute '0read!' . escape(a:command_line, '%#\') if l:was_buffer_empty " (Always true?) - " '0read' inserts before the cursor, leaving a blank line which needs to be deleted: - normal! Gdd + " '0read' inserts before the cursor, leaving a blank line which + " needs to be deleted... but if there are folds in this thing, we + " must open them all first otherwise we could delete the whole + " contents of the last fold (since Vim may close them all by + " default). + normal! zRGdd endif endfunction