sdiehl / vim-ormolu

Plugin for formatting Haskell source code
MIT License
39 stars 3 forks source link

Missing `--stdin-input-file` option when using recent Ormolu versions #14

Open NicolasT opened 1 year ago

NicolasT commented 1 year ago

I've always used vim-ormolu with Ormolu 0.1.4.1, which worked fine. However, since I check Ormolu formatting of projects in CI, and some more recent version of Ormolu has a different opinion on some layout rules, I need to upgrade.

When running with 0.5.3.0, vim-ormolu fails, since it looks like Ormolu now wants some more info when running with stdin input: :messages shows

The --stdin-input-file option is necessary when using input from stdin and accounting for .cabal files

I tried looking into the source-code of this plugin to figure out how to fix this, but at this point I did find where to add which code, but not which code exactly (i.e., how to know the filename of the current buffer), so I'm stuck :smiley:

stepa1000 commented 1 year ago

i write let g:ormolu_options=["--no-cabal"], and helped me get around the error.