[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 07/52: Account for the line continuation column in graphical mode
From: |
Dmitry Gutov |
Subject: |
[elpa] 07/52: Account for the line continuation column in graphical mode |
Date: |
Tue, 01 Jul 2014 11:53:06 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit 0cbd7228ae70abe6c76c9783a3a451f43b652af1
Author: Dmitry Gutov <address@hidden>
Date: Wed Apr 30 12:53:56 2014 +0400
Account for the line continuation column in graphical mode
Fixes #104
---
company.el | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/company.el b/company.el
index a9403cd..75c0f82 100644
--- a/company.el
+++ b/company.el
@@ -2271,16 +2271,19 @@ If SHOW-VERSION is non-nil, show the version in the
echo area."
(- (nth 3 edges) (nth 1 edges))))
(defsubst company--window-width ()
- (- (window-width)
- (cond
- ((display-graphic-p) 0)
- ;; Account for the line continuation column.
- ((version< "24.3.1" emacs-version) 1)
+ (let ((ww (window-width)))
+ ;; Account for the line continuation column.
+ (when (zerop (cadr (window-fringes)))
+ (cl-decf ww))
+ (unless (or (display-graphic-p)
+ (version< "24.3.1" emacs-version))
;; Emacs 24.3 and earlier included margins
;; in window-width when in TTY.
- (t (1+ (let ((margins (window-margins)))
- (+ (or (car margins) 0)
- (or (cdr margins) 0))))))))
+ (cl-decf ww
+ (let ((margins (window-margins)))
+ (+ (or (car margins) 0)
+ (or (cdr margins) 0)))))
+ ww))
(defun company--pseudo-tooltip-height ()
"Calculate the appropriate tooltip height.
- [elpa] branch master updated (9b6551e -> c828ee6), Dmitry Gutov, 2014/07/01
- [elpa] 01/52: Don't require pysmell during compile., Dmitry Gutov, 2014/07/01
- [elpa] 04/52: company-clang: tweak the objc args recognition, Dmitry Gutov, 2014/07/01
- [elpa] 02/52: Fix #103, Dmitry Gutov, 2014/07/01
- [elpa] 05/52: Respect tooltip align annotations in company-yasnippet., Dmitry Gutov, 2014/07/01
- [elpa] 08/52: company-search-map: bind DEL to company-search-other-char, Dmitry Gutov, 2014/07/01
- [elpa] 07/52: Account for the line continuation column in graphical mode,
Dmitry Gutov <=
- [elpa] 09/52: company-sort-by-occurrence: include words on the same line, too, Dmitry Gutov, 2014/07/01
- [elpa] 06/52: Merge pull request #106 from proofit404/master, Dmitry Gutov, 2014/07/01
- [elpa] 11/52: company-clang--build-complete-args: don't call -cc1 directly, Dmitry Gutov, 2014/07/01
- [elpa] 10/52: company--multi-backend-adapter-candidates: compare string values of prefix, Dmitry Gutov, 2014/07/01
- [elpa] 12/52: company-clang--annotation: include method qualifiers in the annotation, Dmitry Gutov, 2014/07/01
- [elpa] 13/52: NEWS: document the change in clang invocation, Dmitry Gutov, 2014/07/01
- [elpa] 14/52: company--continue: don't pass the new prefix to `company-cancel', Dmitry Gutov, 2014/07/01
- [elpa] 15/52: company-files-complete: move files in subdirs to the end, Dmitry Gutov, 2014/07/01
- [elpa] 16/52: Introduce company-tooltip-flip-when-above, Dmitry Gutov, 2014/07/01
- [elpa] 17/52: Fix typo, Dmitry Gutov, 2014/07/01