]> code.delx.au - gnu-emacs-elpa/commitdiff
Don't use goto-line.
authorNikolaj Schumacher <git@nschum.de>
Mon, 22 Feb 2010 20:50:52 +0000 (21:50 +0100)
committerNikolaj Schumacher <git@nschum.de>
Tue, 23 Feb 2010 14:17:08 +0000 (15:17 +0100)
company.el

index f654039481a3cc078b5d1cc454502a7b52bfcfb3..8bdba31b02562718be895255acd3a221fe06264b 100644 (file)
@@ -1466,9 +1466,12 @@ To show the number next to the candidates in some back-ends, enable
            (buffer (or (and (bufferp (car location)) (car location))
                        (find-file-noselect (car location) t))))
       (with-selected-window (display-buffer buffer t)
-        (if (bufferp (car location))
-            (goto-char pos)
-          (goto-line pos))
+        (save-restriction
+          (widen)
+          (if (bufferp (car location))
+              (goto-char pos)
+            (goto-char (point-min))
+            (forward-line (1- pos))))
         (set-window-start nil (point))))))
 (put 'company-show-location 'company-keep t)