Skip to content

Commit

Permalink
Merge pull request #14 from amesgen/stdin-input-file
Browse files Browse the repository at this point in the history
Add option to use --cabal-default-extensions
  • Loading branch information
vyorkin authored Oct 20, 2021
2 parents c40264f + b08fa17 commit 1941a8c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ormolu.el
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
:type 'sexp
:safe #'listp)

(defcustom ormolu-cabal-default-extensions nil
"Whether to use the --cabal-default-extensions flag."
:group 'ormolu
:type 'boolean
:safe #'booleanp)

(defvar ormolu-mode-map (make-sparse-keymap)
"Local keymap used for `ormolu-format-on-save-mode`.")

Expand All @@ -56,7 +62,9 @@
;;;###autoload (autoload 'ormolu-format-on-save-mode "ormolu" nil t)
(reformatter-define ormolu-format
:program ormolu-process-path
:args ormolu-extra-args
:args (append (if (and ormolu-cabal-default-extensions buffer-file-name)
`("--cabal-default-extensions" "--stdin-input-file" ,buffer-file-name)
'()) ormolu-extra-args)
:group 'ormolu
:lighter " Or"
:keymap ormolu-mode-map)
Expand Down

0 comments on commit 1941a8c

Please # to comment.