Skip to content

Commit

Permalink
autoload/magit/state.vim: by default, do not show untracked/deleted/a…
Browse files Browse the repository at this point in the history
…dded/renamed files diffs (ref #28)
  • Loading branch information
jreybert committed Nov 10, 2015
1 parent 51e6edd commit b719b7b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ It takes 3 parameters:
- 'h', curent window is split horizontally, and magit is displayed in
new buffer
- 'c', magit is displayed in current buffer
* show_all_files: define is file diffs are shown by default for this session
* show_all_files: define how file diffs are shown by default for this session
(see [g:magit_default_show_all_files](#gmagit_default_show_all_files))
* foldlevel: set default magit buffer foldlevel for this session
(see [g:magit_default_fold_level](#gmagit_default_fold_level))
Expand Down Expand Up @@ -206,7 +206,8 @@ To disable chatty inline help in magit buffer (default 1)
#### g:magit_default_show_all_files

When this variable is set to 0, all diff files are hidden by default.
When this variable is set to 1, all diff files are shown by default.
When this variable is set to 1, all diff for modified files are shown by default.
When this variable is set to 2, all diff for all files are shown by default.
Default value is 0.
NB: for repository with large number of differences, display may be slow.
> let g:magit_default_show_all_files=[01]
Expand Down
4 changes: 3 additions & 1 deletion autoload/magit/state.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ function! magit#state#init_file_visible() dict
if ( !self.new )
return self.is_visible()
else
call self.set_visible(b:magit_default_show_all_files)
if ( self.status == 'M' || b:magit_default_show_all_files > 1 )
call self.set_visible(b:magit_default_show_all_files)
endif
return self.is_visible()
endif
endfunction
Expand Down
7 changes: 4 additions & 3 deletions doc/vimagit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ It takes 3 parameters:
- 'h', curent window is split horizontally, and magit is displayed in
new buffer
- 'c', magit is displayed in current buffer
* show_all_files: define is file diffs are shown by default for this session
* show_all_files: define how file diffs are shown by default for this session
(see |vimagit-g:magit_default_show_all_files|)
* foldlevel: set default magit buffer foldlevel for this session
(see |vimagit-g:magit_default_fold_level|)

*:Magit* *magit#show_magit('v')*
*:Magit* *magit#show_magit('v')*
:Magit open magit buffer


Expand Down Expand Up @@ -263,7 +263,8 @@ let g:magit_show_help=[01]

*vimagit-g:magit_default_show_all_files*
When this variable is set to 0, all diff files are hidden by default.
When this variable is set to 1, all diff files are shown by default.
When this variable is set to 1, all diff for modified files are shown by default.
When this variable is set to 2, all diff for all files are shown by default.
Default value is 0.
NB: for repository with large number of differences, display may be slow.
let g:magit_default_show_all_files=[01]
Expand Down

0 comments on commit b719b7b

Please sign in to comment.