Skip to content

Commit fa7770c

Browse files
committed
Restore the original meaning of g:ghcmod_use_basedir (#25)
The default directory to execute ghc-mod from has changed.
1 parent b642c87 commit fa7770c

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

autoload/ghcmod.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,10 @@ endfunction"}}}
457457

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

doc/ghcmod.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,13 @@ g:ghcmod_type_highlight *g:ghcmod_type_highlight*
137137
let g:ghcmod_type_highlight = 'ghcmodType'
138138
<
139139
g:ghcmod_use_basedir *g:ghcmod_use_basedir*
140-
When value is 'yes' ghc-mod is executed from project base directory,
140+
The directory to execute ghc-mod from.
141+
142+
If you do not set it, ghc-mod is executed from project base directory,
141143
e.g. from directory where cabal file is placed. This can have an
142144
effect particularly on template Haskell splices that expect to find
143145
certain files in certain places.
144146

145-
If you do not set it, ghcmod will be executed from the folder the file
146-
current Haskell file is contained in.
147-
148147
g:ghcmod_max_preview_size *g:ghcmod_max_preview_size*
149148
The maximum size in lines of that the preview window will grow to
150149
while under the control of ghcmod. Useful for preventing huge lists

0 commit comments

Comments
 (0)