From 94652a356645b1207a0f36302d6efdebe484599a Mon Sep 17 00:00:00 2001 From: "Igor Zornik (Mocheryl)" Date: Wed, 6 Dec 2017 20:42:56 +0100 Subject: [PATCH] Append Go file type when creating temporary file A lot of scripts filter files based on their name to make sure they operate only on the appropriate content. By appending a Go file type to a temporary file when running a formatter, we add support for a broader range of Go formating tools. Fixes #208 --- autoload/go/fmt.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/go/fmt.vim b/autoload/go/fmt.vim index 380034f136..cd1245607d 100644 --- a/autoload/go/fmt.vim +++ b/autoload/go/fmt.vim @@ -58,7 +58,7 @@ function! go#fmt#Format(withGoimport) abort endif " Write current unsaved buffer to a temp file - let l:tmpname = tempname() + let l:tmpname = tempname() . '.go' call writefile(go#util#GetLines(), l:tmpname) if go#util#IsWin() let l:tmpname = tr(l:tmpname, '\', '/')