Permalink
Browse files

vim: narrow: Fix a minor bug on :Widen

  • Loading branch information...
1 parent f1053b3 commit 453cf206c048f0cd0c6a708c215b875e3bcb7f38 @kana committed Feb 28, 2009
Showing with 7 additions and 5 deletions.
  1. +7 −5 autoload/narrow.vim
View
@@ -175,11 +175,13 @@ function! s:load_the_state_of_buffer(original_state) "{{{2
let &l:foldtext = a:original_state.foldtext
" restore folds.
- %foldopen!
- for line in a:original_state.foldstate
- call cursor(line, 0)
- foldclose
- endfor
+ if 0 < len(a:original_state.foldstate)
+ %foldopen! " This raises an error if there is no fold to open.
+ for line in a:original_state.foldstate
+ call cursor(line, 0)
+ foldclose
+ endfor
+ endif
endfunction

0 comments on commit 453cf20

Please sign in to comment.