From b6bf6ecdbc692f05f0f89eee31018c2d659b35aa Mon Sep 17 00:00:00 2001 From: w0rp Date: Fri, 2 Mar 2018 20:57:55 +0000 Subject: [PATCH] Try to fix it again --- ale_linters/cs/mcsc.vim | 2 +- test/handler/test_mcsc_handler.vader | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ale_linters/cs/mcsc.vim b/ale_linters/cs/mcsc.vim index f16e4b4..8a78d3b 100644 --- a/ale_linters/cs/mcsc.vim +++ b/ale_linters/cs/mcsc.vim @@ -10,7 +10,7 @@ function! s:GetWorkingDirectory(buffer) abort return l:working_directory endif - return fnamemodify(bufname(a:buffer), ':p:h') + return expand('#' . a:buffer . ':p:h') endfunction function! ale_linters#cs#mcsc#GetCommand(buffer) abort diff --git a/test/handler/test_mcsc_handler.vader b/test/handler/test_mcsc_handler.vader index 6d6c4ba..8ae4735 100644 --- a/test/handler/test_mcsc_handler.vader +++ b/test/handler/test_mcsc_handler.vader @@ -4,6 +4,7 @@ Before: unlet! g:ale_cs_mcsc_source call ale#test#SetDirectory('/testplugin/test/handler') + call ale#test#SetFilename('Test.cs') runtime ale_linters/cs/mcsc.vim @@ -25,7 +26,7 @@ Execute(The mcs handler should work with the default of the buffer's directory): \ 'filename': ale#path#Simplify(g:dir . '/Test.cs'), \ }, \ ], - \ ale_linters#cs#mcsc#Handle(347, [ + \ ale_linters#cs#mcsc#Handle(bufnr(''), [ \ 'Test.cs(12,29): error CS1001: ; expected', \ 'Compilation failed: 2 error(s), 1 warnings', \ ]) @@ -60,7 +61,7 @@ Execute(The mcs handler should handle cannot find symbol errors): \ 'filename': ale#path#Simplify('/home/foo/project/bar/Test.cs'), \ }, \ ], - \ ale_linters#cs#mcsc#Handle(347, [ + \ ale_linters#cs#mcsc#Handle(bufnr(''), [ \ 'Test.cs(12,29): error CS1001: ; expected', \ 'Test.cs(101,0): error CS1028: Unexpected processor directive (no #if for this #endif)', \ 'Test.cs(10,12): warning CS0123: some warning',