Skip to content

Conversation

drchaos
Copy link
Contributor

@drchaos drchaos commented Mar 12, 2013

...as base directory.

@eagletmt
Copy link
Owner

Why did you intentionally change the original semantics of g:ghcmod_use_basedir? Currently it holds a path, but you're changing it to a flag.
I think it is enough that s:system() defaults to be run in ghcmod#basedir().

@drchaos
Copy link
Contributor Author

drchaos commented Mar 12, 2013

For configuration file backward compatibility. So, I can remove this parameter at all.

@eagletmt
Copy link
Owner

For users who define g:ghcmod_use_basedir, your change breaks compatibility because the meaning completely changes. For users who doesn't, the compatibility is kept. Right?

I think it is better to keep the compatibility for g:ghcmod_use_basedir users. Also, the current g:ghcmod_use_basedir is more general because it can simulate the current default behavior by :let g:ghcmod_use_basedir = expand('%:p:h').
My suggestion is like this.

diff --git a/autoload/ghcmod.vim b/autoload/ghcmod.vim
index 08bb3c1..60f1ffc 100644
--- a/autoload/ghcmod.vim
+++ b/autoload/ghcmod.vim
@@ -457,10 +457,10 @@ endfunction"}}}

 function! ghcmod#basedir()"{{{
   let l:use_basedir = get(g:, 'ghcmod_use_basedir', '')
-  if !empty(l:use_basedir) && l:use_basedir ==? 'yes'
+  if empty(l:use_basedir)
     return s:find_basedir()
   else
-    return expand('%:p:h')
+    return l:use_basedir
   endif
 endfunction"}}}

@drchaos
Copy link
Contributor Author

drchaos commented Mar 12, 2013

You are right. I had made changes two month ago and forgot some details. Sorry.

I agree with you.

@eagletmt
Copy link
Owner

Okay. I merge this PR and make such a modification.
Thank you.

eagletmt added a commit that referenced this pull request Mar 12, 2013
Changed g:ghcmod_use_basedir behaviour to use directory with cabal file ...
@eagletmt eagletmt merged commit b642c87 into eagletmt:master Mar 12, 2013
eagletmt added a commit that referenced this pull request Mar 12, 2013
The default directory to execute ghc-mod from has changed.
@drchaos drchaos deleted the use_basedir branch March 13, 2013 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants