Skip to content

Commit

Permalink
Update for highlight changed text.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbbill committed Aug 30, 2012
1 parent d8770c1 commit fb621a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -15,6 +15,8 @@ Now this plug-in will free you from those commands and bring back the power of u
* The next change that will be restored by `:redo` or `<ctrl-r>` is marked as **{seq}**, it's the same as *curhead* returned by *undotree()*
* The **[seq]** marks the last change and where further changes will be added, it's the same as *newhead* returned by *undotree()*
* Saved changes are marked as **s** and the current change is **S**
1. Live updated diff panel.
1. Highlight changed text.
1. Revert to a specific change by mouse click or enter key.
1. Hotkey support.
1. Display changes in diff panel.
Expand Down
8 changes: 7 additions & 1 deletion plugin/undotree.vim
Expand Up @@ -63,6 +63,12 @@ if !exists('g:undotree_HighlightChangedText')
let g:undotree_HighlightChangedText = 1
endif

" Highlight linked syntax type.
" You may chose your favorite through ":hi" command
if !exists('g:undotree_HighlightSyntax')
let g:undotree_HighlightSyntax = "UnderLined"
endif

"Custom key mappings: add this function to your vimrc.
"You can define whatever mapping as you like, this is a hook function which
"will be called after undotree window initialized.
Expand Down Expand Up @@ -975,7 +981,7 @@ function! s:diffpanel.HighlightDiff(diffresult,targetBufnr)
if empty(a:diffresult)
return
endif
hi link UndotreeChangedText Underlined
exec "hi link UndotreeChangedText ".g:undotree_HighlightSyntax
" clear previous highlighted syntax
if has_key(self.diffmatches,a:targetBufnr)
for i in self.diffmatches[a:targetBufnr]
Expand Down

0 comments on commit fb621a8

Please sign in to comment.