[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6e88174 053/173: Don't cut off the last character from a w
From: |
Dmitry Gutov |
Subject: |
[elpa] master 6e88174 053/173: Don't cut off the last character from a wrapped line |
Date: |
Thu, 23 Jun 2016 00:28:37 +0000 (UTC) |
branch: master
commit 6e88174dae252d2fc1605ed84cb7252fd37ab98f
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Don't cut off the last character from a wrapped line
Reported by Eli Zaretskii at
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20847#68
---
company.el | 2 +-
test/frontends-tests.el | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/company.el b/company.el
index f0b1f1d..5c20c05 100644
--- a/company.el
+++ b/company.el
@@ -2350,7 +2350,7 @@ If SHOW-VERSION is non-nil, show the version in the echo
area."
(while (and (not (eobp)) ; http://debbugs.gnu.org/19553
(> (setq lines-moved (vertical-motion 1)) 0)
(<= (point) end))
- (let ((bound (min end (1- (point)))))
+ (let ((bound (min end (point))))
;; A visual line can contain several physical lines (e.g. with
outline's
;; folding overlay). Take only the first one.
(push (buffer-substring beg
diff --git a/test/frontends-tests.el b/test/frontends-tests.el
index 613856e..63f881e 100644
--- a/test/frontends-tests.el
+++ b/test/frontends-tests.el
@@ -299,7 +299,7 @@
(insert (propertize "a" 'display "bbb\nccc\ndddd\n"))
(insert "eee\nfff\nggg")
(should (equal (company-buffer-lines (point-min) (point-max))
- '("" "" "" "eee" "fff" "ggg")))))
+ '("a" "" "" "eee" "fff" "ggg")))))
(ert-deftest company-buffer-lines-with-multiline-after-string-at-eob ()
:tags '(interactive)
@@ -310,6 +310,16 @@
(should (equal (company-buffer-lines (point-min) (point-max))
'("a" "b" "c")))))
+(ert-deftest company-buffer-lines-with-line-wrapping ()
+ :tags '(interactive)
+ (with-temp-buffer
+ (let ((ww (company--window-width)))
+ (insert (make-string (* 3 ww) ?a))
+ (should (equal (company-buffer-lines (point-min) (point-max))
+ (list (make-string ww ?a)
+ (make-string ww ?a)
+ (make-string ww ?a)))))))
+
(ert-deftest company-modify-line ()
(let ((str "-*-foobar"))
(should (equal-including-properties
- [elpa] master 27c913a 040/173: Don't use `require-match t' in normal backends, (continued)
- [elpa] master 27c913a 040/173: Don't use `require-match t' in normal backends, Dmitry Gutov, 2016/06/22
- [elpa] master 4ba4264 047/173: company--begin-new: Reorder statements, Dmitry Gutov, 2016/06/22
- [elpa] master 9c8364d 049/173: company-keywords: Support scala-mode, Dmitry Gutov, 2016/06/22
- [elpa] master d2ff1dc 046/173: company--begin-new: Call `company-cancel' in the unique case, Dmitry Gutov, 2016/06/22
- [elpa] master a053848 050/173: Sort alphabetically, to appease a test, Dmitry Gutov, 2016/06/22
- [elpa] master 25cf452 060/173: Don't start automatically during macro recording, Dmitry Gutov, 2016/06/22
- [elpa] master 7419d5f 058/173: Update the tests, Dmitry Gutov, 2016/06/22
- [elpa] master 8202638 041/173: Document ignore-case backend command, Dmitry Gutov, 2016/06/22
- [elpa] master d463642 062/173: company-etags-find-table: fix fallback tags file expansion, Dmitry Gutov, 2016/06/22
- [elpa] master 5f8e6eb 066/173: Merge pull request #397 from bremner/make-elpa-fix, Dmitry Gutov, 2016/06/22
- [elpa] master 6e88174 053/173: Don't cut off the last character from a wrapped line,
Dmitry Gutov <=
- [elpa] master 1079d1a 057/173: Use cl-labels instead of cl-flet, for cl-lib shim compatibility, Dmitry Gutov, 2016/06/22
- [elpa] master 3aa806f 063/173: company-etags-find-table: check that TAGS is a regular file, cf. #222, Dmitry Gutov, 2016/06/22
- [elpa] master 93aa472 064/173: Merge pull request #382 from ilohmar/etags-fix, Dmitry Gutov, 2016/06/22
- [elpa] master 46d4455 071/173: Merge pull request #402 from vspinu/sorted, Dmitry Gutov, 2016/06/22
- [elpa] master 050c0c1 070/173: Improvements of the `company-backends` docstring, Dmitry Gutov, 2016/06/22
- [elpa] master 4646d35 078/173: Allow advising company-dabbrev(-code)? regex generation, Dmitry Gutov, 2016/06/22
- [elpa] master ed3e711 084/173: company-yasnippet: Disable cache (#422), Dmitry Gutov, 2016/06/22
- [elpa] master 7d14350 051/173: company-eclim-executable: Pick up the value of eclim-executable, if present, Dmitry Gutov, 2016/06/22
- [elpa] master 9e66366 067/173: Fix #404 by blanking out line-prefix again, Dmitry Gutov, 2016/06/22
- [elpa] master 433ae92 072/173: Retouch the docstring further, Dmitry Gutov, 2016/06/22