5c4fa6b1aad7

Fix: only run AnsiEsc when creating the Clam window

The AnsiEsc command toggles escape sequence highlighting, this causes ClamRefresh to disable it.
[view raw] [browse files]
author Daiderd Jordan <daiderd@gmail.com>
date Tue, 30 Jul 2013 11:02:38 +0200
parents 8533fffd9fbb
children 556dbee6b283
branches/tags (none)
files plugin/clam.vim

Changes

--- a/plugin/clam.vim	Sat Sep 08 14:09:27 2012 -0400
+++ b/plugin/clam.vim	Tue Jul 30 11:02:38 2013 +0200
@@ -34,6 +34,11 @@
     " Open the new window (or move to an existing one).
     if winnr < 0
         silent! execute g:clam_winpos . ' new ' . buffer_name
+
+        " Highlight ANSI color codes if the AnsiEsc plugin is present.
+        if exists("g:loaded_AnsiEscPlugin")
+            silent! execute 'AnsiEsc'
+        endif
     else
         silent! execute winnr . 'wincmd w'
     endif
@@ -64,11 +69,6 @@
 
     " Map <localleader>p to "pipe" the buffer into a new command.
     silent! execute 'nnoremap <buffer> <LocalLeader>p ggVG!'
-
-    " Highlight ANSI color codes if the AnsiEsc plugin is present.
-    if exists("g:loaded_AnsiEscPlugin")
-        silent! execute 'AnsiEsc'
-    endif
 endfunction " }}}
 function! s:ReplaceCurrentBuffer(contents) " {{{
     normal! ggdG