                        :parser 'json-read)
         (deferred:nextc it
           (lambda (results)
-	    (run-hook-with-args 'ycmd-file-parse-result-hook results)))))))
+	    (run-hook-with-args 'ycmd-file-parse-result-hook results)
+            (setq ycmd--buffer-needs-parse nil)))))))
 
 (defun ycmd-display-raw-file-parse-results ()
   "Request file-parse results and display them in a buffer in raw form.

  (ycmd--kill-notification-timer)
  (setq ycmd--notification-timer
        (run-with-idle-timer
         2 t (lambda () (ycmd-notify-file-ready-to-parse)))))

(defun ycmd--kill-notification-timer ()
  (when ycmd--notification-timer


(defun ycmd--on-find-file ()
  (when (ycmd--major-mode-to-file-types major-mode)
    (setq ycmd--buffer-needs-parse t)
    (ycmd-notify-file-ready-to-parse)))

(defun ycmd--on-buffer-modified (beginning end length)
  (when (ycmd--major-mode-to-file-types major-mode)
    (setq ycmd--buffer-needs-parse t)))

(add-hook 'find-file-hook 'ycmd--on-find-file)
(add-hook 'after-change-functions 'ycmd--on-buffer-modified)
(add-hook 'kill-emacs-hook 'ycmd-close)

(provide 'ycmd)
