                  (= live-py-point-line-nr point-line-nr))
       (setq-local live-py-window-start-pos window-start-pos)
       (setq-local live-py-point-line-nr point-line-nr)
-      (if (buffer-live-p (and live-py-output-buffer
-                              (get-buffer live-py-output-buffer)))
+      (if (buffer-live-p (and live-py-trace-buffer
+                              (get-buffer live-py-trace-buffer)))
           (progn
             (unless (window-valid-p live-py-output-window)
               ;; Recreate output window.
               (live-py-show-output-window))
-            (set-window-buffer live-py-output-window live-py-output-buffer)
+            (set-window-buffer live-py-output-window live-py-trace-buffer)
             (live-py-synchronize-scroll
              (line-number-at-pos window-start-pos) point-line-nr))
-        ;; Recreate output buffer and if necessary the output window.
-        (live-py-trace)))))
+        ;; Recreate the trace buffer and if necessary the output window.
+        (live-py-trace-update)))))
 
 (defun live-py-show-output-window ()
   "Show the live-py output window."
   (delete-other-windows)
-  (get-buffer-create live-py-output-buffer)
+  (get-buffer-create live-py-trace-buffer)
   (toggle-truncate-lines 1)
-  (with-current-buffer live-py-output-buffer
+  (with-current-buffer live-py-trace-buffer
     (toggle-truncate-lines 1)
     (setq-local show-trailing-whitespace nil))
   (setq live-py-output-window (split-window-horizontally))
-  (set-window-buffer live-py-output-window live-py-output-buffer))
+  (set-window-buffer live-py-output-window live-py-trace-buffer))
 
 (defun live-py-set-driver()
   "Prompt user to enter the driver command, with input history support.

   (live-py-mode
    (setq live-py-dir (file-name-directory buffer-file-name)
          live-py-version "python")
    ;; Create a unique name for the trace output buffer.
    (setq-local live-py-output-buffer
                (concat "*live-py-output_"
                        (file-name-nondirectory (buffer-file-name))
                        "_"
                        (make-temp-name "")

    (setq-local live-py-timer nil)))

(defun live-py-synchronize-scroll (window-start-line-nr point-line-nr)
  "Synchronize scrolling between Python buffer and trace buffer.

Pass the possibly reused (line-number-at-pos (window-start)) to
WINDOW-START-LINE-NR and (line-number-at-pos) to POINT-LINE-NR,
both are relative to (point-min). Numbering starts at 1 for all
*-LINE-NR in this function signature and body.

When the Python buffer is narrowed the trace buffer remains
aligned but will not hide the part after the narrowing."
  (let ((point-min-pos (point-min))
        (point-min-line-nr 1))
