Skip to content

Commit 02dfe27

Browse files
committed
Merge pull request #1149 from mrBliss/cabal-word-breaks
Fix #1146 by treating . as punctuation
2 parents 3d3dac7 + 8887ac8 commit 02dfe27

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

haskell-cabal.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
;; We could use font-lock-syntactic-keywords, but is it worth it?
8181
;; (modify-syntax-entry ?- ". 12" st)
8282
(modify-syntax-entry ?\n ">" st)
83-
(modify-syntax-entry ?. "w" st)
8483
(modify-syntax-entry ?- "w" st)
8584
st))
8685

tests/haskell-cabal-tests.el

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,24 @@
5050
(haskell-cabal-previous-subsection)
5151
(haskell-cabal-previous-section))))
5252

53+
(ert-deftest haskell-cabal-period-is-a-word-break ()
54+
(with-temp-buffer
55+
(insert "Executable bin
56+
Main-Is: Main
57+
Exposed-Modules: Some.Internal.Type
58+
")
59+
(haskell-cabal-mode)
60+
(goto-char (point-min))
61+
(search-forward "Modules:")
62+
(skip-chars-forward " ")
63+
(should (looking-at-p "Some"))
64+
(forward-word)
65+
(should (looking-at-p ".Internal"))
66+
(forward-word)
67+
(should (looking-at-p ".Type"))
68+
(backward-word)
69+
(should (looking-at-p "Internal"))))
70+
5371
(ert-deftest haskell-cabal-subsection-arrange-lines-keep-trailing-commas ()
5472
(should (with-temp-buffer
5573
(insert "Executable bin-1

0 commit comments

Comments
 (0)