From 8246d8fb64b3bf7c42ee347273cb0564ebc00894 Mon Sep 17 00:00:00 2001 From: Sebastian Wiesner Date: Thu, 25 Dec 2014 14:39:20 +0100 Subject: [PATCH] Sync modified buffers too https://github.com/the-lambda-church/merlin/issues/320 seems to be fixed now, so we can always sync again. Many thanks, @def-lkb --- CHANGES.md | 1 + README.md | 7 ------- flycheck-ocaml.el | 11 +---------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index bb0a356..1522d75 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ master (in development) - Fix warning about parsing messages [GH-1] - Fix error column offsets [GH-2] +- Constantly sync buffer with Merlin to keep error reporting up to date 0.1 (Nov 30, 2014) ================== diff --git a/README.md b/README.md index f66c947..ab73df0 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,6 @@ If you enable Merlin's error checking with `M-x merlin-toggle-view-errors`, Flycheck will not use the `ocaml-merlin` syntax checker anymore, to avoid duplicate overlays. -Known issues ------------- - -Like Merlin itself `ocaml-merlin` only checks buffers on save. While Flycheck -itself is capable of on-the-fly checking while editing, Merlin does not handle -this well, and tends to freeze if the buffer is checked too frequently. - License ------- diff --git a/flycheck-ocaml.el b/flycheck-ocaml.el index 8c8bc9e..7f3e098 100644 --- a/flycheck-ocaml.el +++ b/flycheck-ocaml.el @@ -107,16 +107,7 @@ Return the corresponding `flycheck-error'." "Start a Merlin syntax check with CHECKER. CALLBACK is the status callback passed by Flycheck." - (when (flycheck-buffer-saved-p) - ;; Sync the buffer contents with Merlin, if the buffer is saved, like Merlin - ;; does. Ideally, we'd sync on every check, but Merlin tends to freeze - ;; randomly when synching too frequently (see - ;; https://github.com/the-lambda-church/merlin/issues/320). - ;; - ;; So now we just get the old errors when checking a modified buffer, but at - ;; least we get any errors at all, so that the mode line display and the - ;; error list can show something that's at least half way correct. - (merlin-sync-to-point (point-max) t)) + (merlin-sync-to-point (point-max) t) ;; Put the current buffer into the closure environment so that we have access ;; to it later. (let ((buffer (current-buffer)))