Skip to content

Commit b048358

Browse files
hlollibbatsov
authored andcommitted
Add expression break chars and prevent completions for numbers (#110)
1 parent 864356a commit b048358

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

inf-clojure.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,15 +1239,17 @@ See variable `inf-clojure-buffer'."
12391239
(inf-clojure--read-or-nil)
12401240
(inf-clojure--list-or-nil))))
12411241

1242-
(defconst inf-clojure-clojure-expr-break-chars " \t\n\"\'`><,;|&{(")
1242+
(defconst inf-clojure-clojure-expr-break-chars " \t\n\"\'`><,;|&{()[]")
12431243

12441244
(defun inf-clojure-completion-bounds-of-expr-at-point ()
12451245
"Return bounds of expression at point to complete."
12461246
(when (not (memq (char-syntax (following-char)) '(?w ?_)))
12471247
(save-excursion
12481248
(let ((end (point)))
12491249
(skip-chars-backward (concat "^" inf-clojure-clojure-expr-break-chars))
1250-
(cons (point) end)))))
1250+
(let ((first-char (substring-no-properties (thing-at-point 'symbol) 0 1)))
1251+
(when (string-match-p "[^0-9]" first-char)
1252+
(cons (point) end)))))))
12511253

12521254
(defun inf-clojure-completion-expr-at-point ()
12531255
"Return expression at point to complete."

0 commit comments

Comments
 (0)