Do not enforce autoformat in ocaml

This commit is contained in:
Maxim Baz 2018-07-28 12:27:27 +02:00
parent bd9895ea86
commit 451c72cc33
No known key found for this signature in database
GPG Key ID: 011FDC52DA839335

View File

@ -1,8 +1,6 @@
# http://ocaml.org
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
# require ocp-indent
# Detection
# ‾‾‾‾‾‾‾‾‾
@ -18,30 +16,13 @@ add-highlighter shared/ocaml/code default-region group
add-highlighter shared/ocaml/string region '"' (?<!\\)(\\\\)*" fill string
add-highlighter shared/ocaml/comment region \Q(* \Q*) fill comment
# Commands
# ‾‾‾‾‾‾‾‾
define-command -hidden ocaml-indent-on-char %{
evaluate-commands -no-hooks -draft -itersel %{
execute-keys ";i<space><esc>Gg|ocp-indent --config base=%opt{indentwidth} --indent-empty --lines %val{cursor_line}<ret>"
}
}
# Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook -group ocaml-highlight global WinSetOption filetype=ocaml %{ add-highlighter window/ocaml ref ocaml }
hook global WinSetOption filetype=ocaml %{
hook window InsertChar [|\n] -group ocaml-indent ocaml-indent-on-char
}
hook -group ocaml-highlight global WinSetOption filetype=(?!ocaml).* %{ remove-highlighter window/ocaml }
hook global WinSetOption filetype=(?!ocaml).* %{
remove-hooks window ocaml-indent
}
# Macro
# ‾‾‾‾‾