Skip to content

Commit 0606f3a

Browse files
committed
Merge pull request #946 from gracjan/pr-improve-can-grab-prefix
Improve can grab prefix for completions
2 parents 443c517 + a3e6ed8 commit 0606f3a

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

haskell-completions.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ whitespace or new line, otherwise returns nil.
7474
7575
Returns nil in presense of active region."
7676
(when (not (region-active-p))
77-
(when (looking-at (rx (| space line-end punct)))
77+
(when (looking-at-p (rx (| space line-end punct)))
7878
(when (not (bobp))
7979
(save-excursion
8080
(backward-char)
81-
(not (looking-at (rx (| space line-end)))))))))
81+
(not (looking-at-p (rx (| space line-end)))))))))
8282

8383
(defun haskell-completions-grab-pragma-prefix ()
8484
"Grab completion prefix for pragma completions.

tests/haskell-completions-tests.el

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,9 @@
6262
(save-excursion (insert "bcd"))
6363
(should (eql nil (haskell-completions-can-grab-prefix)))
6464
;; region case
65-
(let ((p (point)))
66-
(goto-char (point-min))
67-
(push-mark)
68-
(goto-char p)
69-
(activate-mark)
70-
(should (eql nil (haskell-completions-can-grab-prefix))))))
65+
(push-mark (point-min) t)
66+
(activate-mark)
67+
(should (eql nil (haskell-completions-can-grab-prefix)))))
7168

7269

7370
(ert-deftest haskell-completions-grab-pragma-prefix-nil-cases-test ()

0 commit comments

Comments
 (0)