[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 125a4da 009/173: company-show-location: Mirror the latest
From: |
Dmitry Gutov |
Subject: |
[elpa] master 125a4da 009/173: company-show-location: Mirror the latest change to company-show-doc-buffer |
Date: |
Thu, 23 Jun 2016 00:28:34 +0000 (UTC) |
branch: master
commit 125a4dad231b2681c93a20f214a11bdcf22989e1
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
company-show-location: Mirror the latest change to company-show-doc-buffer
Closes #312
---
company.el | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/company.el b/company.el
index 3ef045d..a95f7f3 100644
--- a/company.el
+++ b/company.el
@@ -2059,20 +2059,22 @@ character, stripping the modifiers. That character
must be a digit."
(defun company-show-location ()
"Temporarily display a buffer showing the selected candidate in context."
(interactive)
- (company--electric-do
- (let* ((selected (nth company-selection company-candidates))
- (location (company-call-backend 'location selected))
- (pos (or (cdr location) (error "No location available")))
- (buffer (or (and (bufferp (car location)) (car location))
- (find-file-noselect (car location) t))))
- (with-selected-window (display-buffer buffer t)
- (save-restriction
- (widen)
- (if (bufferp (car location))
- (goto-char pos)
- (goto-char (point-min))
- (forward-line (1- pos))))
- (set-window-start nil (point))))))
+ (let (other-window-scroll-buffer)
+ (company--electric-do
+ (let* ((selected (nth company-selection company-candidates))
+ (location (company-call-backend 'location selected))
+ (pos (or (cdr location) (error "No location available")))
+ (buffer (or (and (bufferp (car location)) (car location))
+ (find-file-noselect (car location) t))))
+ (setq other-window-scroll-buffer (get-buffer buffer))
+ (with-selected-window (display-buffer buffer t)
+ (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)
;;; package functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- [elpa] master updated (24149b0 -> 7a2deff), Dmitry Gutov, 2016/06/22
- [elpa] master 448bcd8 007/173: company-show-doc-buffer: Bind other-window-scroll-buffer, Dmitry Gutov, 2016/06/22
- [elpa] master dae79c4 002/173: Merge branch 'search-hl-fix', Dmitry Gutov, 2016/06/22
- [elpa] master 12f55f5 013/173: Buf was unused, Dmitry Gutov, 2016/06/22
- [elpa] master e94f2ec 008/173: company-show-doc-buffer: Still call doc-buffer inside the electric block, Dmitry Gutov, 2016/06/22
- [elpa] master 125a4da 009/173: company-show-location: Mirror the latest change to company-show-doc-buffer,
Dmitry Gutov <=
- [elpa] master 7941f6e 010/173: company-diag: Include Emacs and Company versions, Dmitry Gutov, 2016/06/22
- [elpa] master 5733f2b 011/173: company-diag: Fix the annotation call, Dmitry Gutov, 2016/06/22
- [elpa] master af962d4 012/173: company-diag: Call `annotation' in the right buffer, Dmitry Gutov, 2016/06/22
- [elpa] master 5e107fd 015/173: Accept numeric argument in company-select-next and friends, Dmitry Gutov, 2016/06/22
- [elpa] master 479c676 021/173: Don't use `forward-symbol', apparently it's not in 24.3, Dmitry Gutov, 2016/06/22
- [elpa] master 41f4536 018/173: Add missing require to `company-gtags`, Dmitry Gutov, 2016/06/22
- [elpa] master b0f206a 020/173: Handle function pointers in annotation and template expansion, Dmitry Gutov, 2016/06/22
- [elpa] master d56ddaa 006/173: Allow scrolling the doc window with the mouse wheel, Dmitry Gutov, 2016/06/22
- [elpa] master a7a4ba6 014/173: Merge branch 'release', Dmitry Gutov, 2016/06/22
- [elpa] master 464a458 022/173: company-lighter: dispatch on whether company-candidates is non-nil, Dmitry Gutov, 2016/06/22