Skip to content

Commit

Permalink
Release 0.19, autogenerated
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Oct 18, 2010
1 parent 56c14ec commit 7cc9258
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 26 deletions.
5 changes: 4 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*histwin.txt* Plugin to browse the undo-tree

Version: 0.17 Sun, 10 Oct 2010 13:54:13 +0200
Version: 0.19 Mon, 18 Oct 2010 21:03:21 +0200
Author: Christian Brabandt <cb@256bit.org>
Copyright: (c) 2009, 2010 by Christian Brabandt *histwin-copyright*
The VIM LICENSE applies to histwin.vim and histwin.txt
Expand Down Expand Up @@ -297,6 +297,9 @@ third line of this document.
*histwin-history*
6. histwin History

0.19 - Make sure the first entry will be tagged "Start Editing"
0.18 - don't leave the buffer in nomodifiable state (reported by Dave
Doran)
0.17 - don't hide the initial entry (for Vim < 7.3.005)
0.16 - more bugfixing. :UB throws errors in Vim before 7.3.005 fix that
0.15 - Fixed bug when no undo-tree was available (partly by Ben Boeckel.
Expand Down
4 changes: 2 additions & 2 deletions autoload/histwin.vim
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
" histwin.vim - Vim global plugin for browsing the undo tree
" -------------------------------------------------------------
" Last Change: Sun, 10 Oct 2010 13:54:13 +0200
" Last Change: Mon, 18 Oct 2010 21:03:21 +0200
" Maintainer: Christian Brabandt <cb@256bit.org>
" Version: 0.17
" Version: 0.19
" Copyright: (c) 2009, 2010 by Christian Brabandt
" The VIM LICENSE applies to histwin.vim
" (see |copyright|) except use "histwin.vim"
Expand Down
2 changes: 1 addition & 1 deletion doc/histwin.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*histwin.txt* Plugin to browse the undo-tree

Version: 0.17 Sun, 10 Oct 2010 13:54:13 +0200
Version: 0.19 Mon, 18 Oct 2010 21:03:21 +0200
Author: Christian Brabandt <cb@256bit.org>
Copyright: (c) 2009, 2010 by Christian Brabandt *histwin-copyright*
The VIM LICENSE applies to histwin.vim and histwin.txt
Expand Down
67 changes: 49 additions & 18 deletions histwin.vba
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ plugin/histwinPlugin.vim [[[1
42
" histwin.vim - Vim global plugin for browsing the undo tree
" -------------------------------------------------------------
" Last Change: Sun, 10 Oct 2010 13:54:13 +0200
" Last Change: Mon, 18 Oct 2010 21:03:21 +0200
" Maintainer: Christian Brabandt <cb@256bit.org>
" Version: 0.17
" Version: 0.19
" Copyright: (c) 2009, 2010 by Christian Brabandt
" The VIM LICENSE applies to histwin.vim
" (see |copyright|) except use "histwin.vim"
" instead of "Vim".
" No warranty, express or implied.
" *** *** Use At-Your-Own-Risk! *** ***
"
" GetLatestVimScripts: 2932 11 :AutoInstall: histwin.vim
" GetLatestVimScripts: 2932 12 :AutoInstall: histwin.vim

" Init:
if exists("g:loaded_undo_browse") || &cp || &ul == -1
Expand All @@ -27,7 +27,7 @@ if v:version < 703
finish
endif

let g:loaded_undo_browse = 0.17
let g:loaded_undo_browse = 0.19
let s:cpo = &cpo
set cpo&vim

Expand All @@ -46,12 +46,12 @@ let &cpo=s:cpo
unlet s:cpo
" vim: ts=4 sts=4 fdm=marker com+=l\:\" fdm=syntax
autoload/histwin.vim [[[1
654
682
" histwin.vim - Vim global plugin for browsing the undo tree
" -------------------------------------------------------------
" Last Change: Sun, 10 Oct 2010 13:54:13 +0200
" Last Change: Mon, 18 Oct 2010 21:03:21 +0200
" Maintainer: Christian Brabandt <cb@256bit.org>
" Version: 0.17
" Version: 0.19
" Copyright: (c) 2009, 2010 by Christian Brabandt
" The VIM LICENSE applies to histwin.vim
" (see |copyright|) except use "histwin.vim"
Expand Down Expand Up @@ -121,6 +121,12 @@ fun! s:Init()"{{{1

" Move to the buffer, we are monitoring
exe bufwinnr(s:orig_buffer) . 'wincmd w'

" initialize the modifiable variable
if !exists("b:modifiable")
let b:modifiable=&l:ma
endif

if !exists("b:undo_customtags")
" TODO: Activate, when viminfo patch has been incorporated into vim
"
Expand Down Expand Up @@ -183,33 +189,34 @@ fun! s:ReturnHistList()"{{{1
" (it's hard to get the right branches, so we parse the :undolist
" command and only take these entries (plus the first and last entry)
let ut=s:GetUndotreeEntries(undotree().entries)
call sort(ut, 's:SortValues')
let templist=map(templist, 'split(v:val)[0]')
let re = '^\%(' . join(templist, '\|') . '\)$'
let first = ut[0]
let first.tag='Start Editing'
if s:undo_tree_dtl
call filter(ut, 'v:val.seq =~ re')
call filter(ut, 'v:val.change =~ re')
else
call filter(ut, 'v:val.seq =~ re || v:val.save > 0')
call filter(ut, 'v:val.change =~ re || v:val.save > 0')
endif
let ut= [first] + ut

for item in ut
if has_key(customtags, item.seq)
let tag=customtags[item.seq].tag
call remove(customtags,item.seq)
if has_key(customtags, item.change)
let tag=customtags[item.change].tag
call remove(customtags,item.change)
else
let tag=(has_key(item, 'tag') ? item.tag : '')
endif
let histdict[item.seq]={'change': item.seq,
let histdict[item.change]={'change': item.change,
\'number': item.number,
\'time': item.time,
\'tag': tag,
\'save': (has_key(item, 'save') ? item.save : 0),
\}
endfor
unlet item
let first_seq = first.seq
let first_seq = first.change
else
" include the starting point as the first change.
" unfortunately, there does not seem to exist an
Expand Down Expand Up @@ -254,7 +261,7 @@ fun! s:ReturnHistList()"{{{1
endfun

fun! s:SortValues(a,b)"{{{1
return (a:a.change+0)==(a:b.change+0) ? 0 : (a:a.change+0) > (a:b.change+0) ? 1 : -1
return (a:a.change)==(a:b.change) ? 0 : (a:a.change) > (a:b.change) ? 1 : -1
endfun

fun! s:MaxTagsLen()"{{{1
Expand Down Expand Up @@ -651,6 +658,7 @@ fun! s:MapKeys()"{{{1
nnoremap <script> <silent> <buffer> D :<C-U>silent :call <sid>DiffUndoBranch()<CR>
nnoremap <script> <silent> <buffer> R :<C-U>call <sid>ReplayUndoBranch()<CR>:silent! :call histwin#UndoBrowse()<CR>
nnoremap <script> <silent> <buffer> Q :<C-U>q<CR>
nnoremap <script> <silent> <buffer> Q :<C-U>silent :call <sid>CloseHistWin()<CR>
nnoremap <script> <silent> <buffer> <CR> :<C-U>silent :call <sid>UndoBranch()<CR>:call histwin#UndoBrowse()<CR>
nmap <script> <silent> <buffer> T :call <sid>UndoBranchTag()<CR>:call histwin#UndoBrowse()<CR>
nmap <script> <silent> <buffer> P :<C-U>silent :call <sid>ToggleDetail()<CR><C-L>
Expand All @@ -668,6 +676,9 @@ fun! histwin#UndoBrowse()"{{{1
let b:undo_tagdict=s:ReturnHistList()
call s:PrintUndoTree(b:undo_win)
call s:MapKeys()
if !exists("#histwin#BufUnload")
call <sid>AuCommandClose()
endif
else
echoerr "Histwin: Undo has been disabled. Check your undolevel setting!"
endif
Expand All @@ -681,7 +692,7 @@ fun! s:GetUndotreeEntries(entry) "{{{1
" Return only entries, that have an 'alt' key, which means, an undo branch
" started there
for item in a:entry
call add(b, { 'seq': item.seq, 'time': item.time, 'number': 1,
call add(b, { 'change': item.seq, 'time': item.time, 'number': 1,
\'save': has_key(item, 'save') ? item.save : 0})
if has_key(item, "alt")
" need to add the last seq. number that was in an alternative
Expand All @@ -692,6 +703,23 @@ fun! s:GetUndotreeEntries(entry) "{{{1
return b
endfun

fun! s:CloseHistWin() "{{{1
call setbufvar(s:orig_buffer, "&ma", getbufvar(s:orig_buffer, "modifiable"))
"exe "au! <buffer=".bufnr('')."> BufUnload *"
aug histwin
au! BufUnload <buffer>
augroup end
aug! histwin
wincmd c
endfun

fun! s:AuCommandClose() "{{{1
aug histwin
au!
au BufUnload <buffer> :call <sid>CloseHistWin()
aug end
endfun

" Debug function, not needed {{{1
fun! SortUndoTreeValues(a,b)"{{{2
return (a:a.seq)==(a:b.seq) ? 0 : (a:a.seq) > (a:b.seq) ? 1 : -1
Expand All @@ -702,10 +730,10 @@ let &cpo=s:cpo
unlet s:cpo
" vim: ts=4 sts=4 fdm=marker com+=l\:\" fdl=0
doc/histwin.txt [[[1
377
380
*histwin.txt* Plugin to browse the undo-tree

Version: 0.17 Sun, 10 Oct 2010 13:54:13 +0200
Version: 0.19 Mon, 18 Oct 2010 21:03:21 +0200
Author: Christian Brabandt <cb@256bit.org>
Copyright: (c) 2009, 2010 by Christian Brabandt *histwin-copyright*
The VIM LICENSE applies to histwin.vim and histwin.txt
Expand Down Expand Up @@ -1002,6 +1030,9 @@ third line of this document.
*histwin-history*
6. histwin History

0.19 - Make sure the first entry will be tagged "Start Editing"
0.18 - don't leave the buffer in nomodifiable state (reported by Dave
Doran)
0.17 - don't hide the initial entry (for Vim < 7.3.005)
0.16 - more bugfixing. :UB throws errors in Vim before 7.3.005 fix that
0.15 - Fixed bug when no undo-tree was available (partly by Ben Boeckel.
Expand Down
8 changes: 4 additions & 4 deletions plugin/histwinPlugin.vim
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
" histwin.vim - Vim global plugin for browsing the undo tree
" -------------------------------------------------------------
" Last Change: Sun, 10 Oct 2010 13:54:13 +0200
" Last Change: Mon, 18 Oct 2010 21:03:21 +0200
" Maintainer: Christian Brabandt <cb@256bit.org>
" Version: 0.17
" Version: 0.19
" Copyright: (c) 2009, 2010 by Christian Brabandt
" The VIM LICENSE applies to histwin.vim
" (see |copyright|) except use "histwin.vim"
" instead of "Vim".
" No warranty, express or implied.
" *** *** Use At-Your-Own-Risk! *** ***
"
" GetLatestVimScripts: 2932 11 :AutoInstall: histwin.vim
" GetLatestVimScripts: 2932 12 :AutoInstall: histwin.vim

" Init:
if exists("g:loaded_undo_browse") || &cp || &ul == -1
Expand All @@ -22,7 +22,7 @@ if v:version < 703
finish
endif

let g:loaded_undo_browse = 0.17
let g:loaded_undo_browse = 0.19
let s:cpo = &cpo
set cpo&vim

Expand Down

0 comments on commit 7cc9258

Please sign in to comment.