Skip to content

Instantly share code, notes, and snippets.

@eagletmt
Created March 9, 2013 15:07
Show Gist options
  • Save eagletmt/5124447 to your computer and use it in GitHub Desktop.
Save eagletmt/5124447 to your computer and use it in GitHub Desktop.
diff --git a/autoload/necoghc.vim b/autoload/necoghc.vim
index 9b43ec8..d1d35e6 100644
--- a/autoload/necoghc.vim
+++ b/autoload/necoghc.vim
@@ -202,9 +202,17 @@ function! s:get_modules() "{{{
endfunction "}}}
function! s:ghc_mod(cmd) "{{{
+ let l:cmd = 'ghc-mod -g -package -g ghc ' . a:cmd
lcd `=expand('%:p:h')`
- let l:ret = system('ghc-mod -g -package -g ghc ' . a:cmd)
+ let l:ret = system(l:cmd)
lcd -
+ let l:logs = []
+ let l:logfile = 'system.log'
+ if filereadable(l:logfile)
+ let l:logs = readfile(l:logfile)
+ endif
+ let l:logs += [l:cmd, l:ret]
+ call writefile(l:logs, l:logfile)
return split(l:ret, '\n')
endfunction "}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment