Mercurial > vim-lawrencium
comparison plugin/lawrencium.vim @ 99:001b341ab8ad
Fix for Lawrencium files having folded sections deleted incorrectly.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 29 Jul 2014 16:34:49 -0700 |
parents | e5ac6464a767 |
children | 596f94a7e0fd |
comparison
equal
deleted
inserted
replaced
98:e5ac6464a767 | 99:001b341ab8ad |
---|---|
364 function! s:HgRepo.ReadCommandOutput(command, ...) abort | 364 function! s:HgRepo.ReadCommandOutput(command, ...) abort |
365 function! s:PutOutputIntoBuffer(command_line) | 365 function! s:PutOutputIntoBuffer(command_line) |
366 let l:was_buffer_empty = (line('$') == 1 && getline(1) == '') | 366 let l:was_buffer_empty = (line('$') == 1 && getline(1) == '') |
367 execute '0read!' . escape(a:command_line, '%#\') | 367 execute '0read!' . escape(a:command_line, '%#\') |
368 if l:was_buffer_empty " (Always true?) | 368 if l:was_buffer_empty " (Always true?) |
369 " '0read' inserts before the cursor, leaving a blank line which needs to be deleted: | 369 " '0read' inserts before the cursor, leaving a blank line which |
370 normal! Gdd | 370 " needs to be deleted... but if there are folds in this thing, we |
371 " must open them all first otherwise we could delete the whole | |
372 " contents of the last fold (since Vim may close them all by | |
373 " default). | |
374 normal! zRGdd | |
371 endif | 375 endif |
372 endfunction | 376 endfunction |
373 | 377 |
374 let l:all_args = [a:command] + a:000 | 378 let l:all_args = [a:command] + a:000 |
375 let l:hg_command = call(self['GetCommand'], l:all_args, self) | 379 let l:hg_command = call(self['GetCommand'], l:all_args, self) |