Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Version 2.1.2

Fixed a few issues.
 - Now centres (better) on tree window open.
 - Can be opened to default mode.
 - Tree now properly opens directories that are sub.
  • Loading branch information...
commit e5541870077da826a41dc86e439b56240afc6ca6 1 parent 3bc1108
Peter Antoine authored committed
Showing with 36 additions and 22 deletions.
  1. +4 −3 README.md
  2. +10 −2 doc/gitlog.txt
  3. +22 −17 plugin/gitlog.vim
View
7 README.md
@@ -1,7 +1,7 @@
vimgitlog
=========
-Version: 2.1.0
+Version: 2.1.2
Git log and diff plugin for vim.
@@ -44,8 +44,9 @@ Simply copy the contents of the plugin directory to the plugin directory in your
You will need to map the toggle function to use it.
- map <silent> <f7> :call GITLOG_FilpWindows()<cr>
- map <silent> <c-f7> :call GITLOG_ToggleWindows()<cr>
+ let g:GITLOG_default_mode = 2
+ map <silent> <f7> :call GITLOG_ToggleWindows()<cr>
+ map <silent> <c-f7> :call GITLOG_FlipWindows()<cr>
And the should be it.
View
12 doc/gitlog.txt
@@ -10,8 +10,8 @@
Author: Peter Antoine
-Date: March 26, 2013
-Version: 2.1.0
+Date: May 21, 2013
+Version: 2.1.2
HomePage: https://github.com/PAntoine/vimgitlog
@@ -228,6 +228,14 @@ This will install GITLOG on the <f7> key.
==============================================================================
7. History *gitlog-history*
+ 2.1.2: May 21, 2013
+ PA: Fixed tree open.
+ PA: Fixed being able to open in any default mode.
+ PA: Made open tree view a bit better.
+
+ 2.1.1: May 03, 2013
+ PA: Fixed silly start-up issue.
+
2.1.0: March 29, 2013
PA: Fixed empty directory issue.
PA: Added 'refresh' functions for tree.
View
39 plugin/gitlog.vim
@@ -42,7 +42,6 @@
"
" GLOBAL INITIALISERS
" {{{
-
let s:tree_root = 0
let s:current_root = 0
let s:directory_list = [[]]
@@ -74,9 +73,6 @@ else
let s:GITLOG_Open = 'v '
endif
-if !exists("g:GITLOG_default_mode")
- let g:GITLOG_default_mode = 1
-endif
"
" }}}
" PUBLIC FUNCTIONS
@@ -300,6 +296,7 @@ endfunction "}}}
" nothing
"
function! GITLOG_FlipWindows()
+ echo s:gitlog_last_state
if !exists("s:gitlog_loaded")
" load it on
call GITLOG_ToggleWindows(s:gitlog_last_state)
@@ -342,6 +339,12 @@ function! GITLOG_ToggleWindows(...)
let s:gitlog_loaded = 1
endif
else
+ if s:revision_file != ""
+ let s:revision_path = substitute(s:revision_file,s:repository_root,"","")
+ else
+ let s:revision_path = ''
+ endif
+
if s:GITLOG_OpenTreeWindow()
let s:gitlog_loaded = 2
endif
@@ -505,20 +508,9 @@ function! s:GITLOG_OpenTreeToFile(file_path)
endif
if (len(components) > 1)
- let new_path = '.'
+ let new_path = './'
for component in components
let found = 0
- let new_path = new_path . "/" . component
-
- " open the sub-directory if we need too
- if found_item != {} && curent_directory == 0 && found_item.type == 'tree'
- let found_item.child = GITLOG_MakeDirectory(new_path, found_item.parent)
- let curent_directory = found_item.child
-
- if curent_directory == 0
- break
- endif
- endif
" now search the directory
for item in s:directory_list[curent_directory]
@@ -536,6 +528,18 @@ function! s:GITLOG_OpenTreeToFile(file_path)
endif
endfor
+ let new_path = new_path . component . "/"
+
+ " open the sub-directory if we need too
+ if found_item != {} && curent_directory == 0 && found_item.type == 'tree'
+ let found_item.child = GITLOG_MakeDirectory(new_path, found_item.parent)
+ let curent_directory = found_item.child
+
+ if curent_directory == 0
+ break
+ endif
+ endif
+
" did we find it?
if found == 0
break
@@ -599,6 +603,7 @@ function! s:GITLOG_OpenTreeWindow()
if found_item != {}
call setpos('.',[0,found_item.lnum,0,0])
+ exe "normal zz"
endif
" set the keys on the tree window
@@ -1067,7 +1072,7 @@ endfunction "}}}
" nothing
"
function! GITLOG_MakeDirectory(path_name, parent_id)
- let run_command = "git --git-dir=" . s:repository_root . ".git --no-pager ls-tree " . s:gitlog_current_commit . " " . a:path_name . " --abbrev"
+ let run_command = "git --git-dir=" . s:repository_root . ".git --no-pager ls-tree " . s:gitlog_current_commit . " " . a:path_name . " --abbrev"
let search_result = system(run_command)
if v:shell_error
Please sign in to comment.
Something went wrong with that request. Please try again.