Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

vim stuff:

- WriteSampleConfigScion is global as well now
- stderr is printed when the server dies (eg when using error "..")
- default scion dist direcotry is used by default
true / false can be encoded as well now (There is still no way to decode it)
  • Loading branch information...
commit 06b5af6b7d4a88f8fd0198073f684d4d54f45ef8 1 parent 741fc1f
@MarcWeber MarcWeber authored
View
10 vim_runtime_path/autoload/haskellcomplete.vim
@@ -38,7 +38,8 @@ endf
fun! haskellcomplete#SetCurrentCabalProject()
let configs = haskellcomplete#EvalScion(1,'list-cabal-configurations',
- \ { 'cabal-file' : haskellcomplete#CabalFile()})
+ \ { 'cabal-file' : haskellcomplete#CabalFile()
+ \ , 'scion-default': json#IntToBool(get(g:scion_config, "use_default_scion_cabal_dist_dir", 1)) })
let config = haskellcomplete#ChooseFromList(configs, 'select a cabal configuration')
let result = haskellcomplete#EvalScion(1,'open-cabal-project'
\ ,{'root-dir' : getcwd()
@@ -256,7 +257,7 @@ class ScionServerConnection:
def receive(self):
s = self.scion_o.readline()
if s == "":
- raise "EOF"
+ raise "EOF, stderr lines: \n%s"%self.scion_err.read()
else:
return s[:-1]
@@ -268,6 +269,7 @@ class ScionServerConnectionStdinOut(ScionServerConnection):
shell = False, bufsize = 1, stdin = PIPE, stdout = PIPE, stderr = PIPE)
self.scion_o = p.stdout
self.scion_i = p.stdin
+ self.scion_err = p.stderr
def receive(self):
global scion_log_stdout, scion_stdout
@@ -281,8 +283,8 @@ class ScionServerConnectionStdinOut(ScionServerConnection):
if scion_log_stdout:
scion_stdout.append(s)
scion_stdout = scion_stdout[-200:]
- " should this be printed? It doesn't hurt much but might be useful when
- " trouble shooting..
+ # should this be printed? It doesn't hurt much but might be useful when
+ # trouble shooting..
print "ignoring line", s
s = ScionServerConnection.receive(self)
View
13 vim_runtime_path/autoload/json.vim
@@ -5,6 +5,15 @@
fun! json#NULL()
return function("json#NULL")
endf
+fun! json#True()
+ return function("json#True")
+endf
+fun! json#False()
+ return function("json#False")
+endf
+fun! json#IntToBool(i)
+ return a:i == 1 ? json#True() : json#False()
+endf
fun! json#Encode(thing)
if type(a:thing) == type("")
@@ -23,6 +32,10 @@ fun! json#Encode(thing)
return
elseif string(a:thing) == string(json#NULL())
return "null"
+ elseif string(a:thing) == string(json#True())
+ return "true"
+ elseif string(a:thing) == string(json#False())
+ return "false"
else
throw "unexpected new thing: ".string(a:thing)
endif
View
3  vim_runtime_path/ftplugin/haskell.vim
@@ -72,9 +72,6 @@ command! -buffer ListCabalComponentsScion
command! -buffer ListExposedModulesScion
\ echo haskellcomplete#List('exposed-modules')
-command! -nargs=* -complete=file -buffer WriteSampleConfigScion
- \ echo haskellcomplete#WriteSampleConfig(<f-args>) | e .scion-config
-
command! -nargs=* ListCabalConfigurationsScion
\ echo s:ListCabalConfigurations(<f-args>)
View
7 vim_runtime_path/plugin/haskell_scion.vim
@@ -1,3 +1,7 @@
+if !exists('g:scion_config')
+ let g:scion_config = {}
+ " let g:scion_config['use_default_scion_cabal_dist_dir'] = 0
+endif
" probably more commands should be moved from haskell.vim into this file so
" that the commands can be run even when not editing a haskell file.
@@ -37,3 +41,6 @@ endf
command! -nargs=? -complete=customlist,s:LoadComponentCompletion
\ LoadComponentScion
\ call s:LoadComponentScion(<f-args>)
+
+command! -nargs=* -complete=file -buffer WriteSampleConfigScion
+ \ echo haskellcomplete#WriteSampleConfig(<f-args>) | e .scion-config
Please sign in to comment.
Something went wrong with that request. Please try again.