Merge remote-tracking branch 'maximbaz/do-not-enforce-autoformat-ocaml'

This commit is contained in:
Maxime Coste 2018-10-21 18:45:16 +11:00
commit 7470c85a1a

View File

@ -1,8 +1,6 @@
# http://ocaml.org # http://ocaml.org
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
# require ocp-indent
# Detection # 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/string region '"' (?<!\\)(\\\\)*" fill string
add-highlighter shared/ocaml/comment region \Q(* \Q*) fill comment 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 # Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook -group ocaml-highlight global WinSetOption filetype=ocaml %{ add-highlighter window/ocaml ref ocaml } 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 -group ocaml-highlight global WinSetOption filetype=(?!ocaml).* %{ remove-highlighter window/ocaml }
hook global WinSetOption filetype=(?!ocaml).* %{
remove-hooks window ocaml-indent
}
# Macro # Macro
# ‾‾‾‾‾ # ‾‾‾‾‾