Skip to content

Commit ad67c47

Browse files
committed
add expression break chars and prevent completions for numbers
1 parent 21d3e97 commit ad67c47

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
@@ -1220,15 +1220,17 @@ See variable `inf-clojure-buffer'."
12201220
(inf-clojure--read-or-nil)
12211221
(inf-clojure--list-or-nil))))
12221222

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

12251225
(defun inf-clojure-completion-bounds-of-expr-at-point ()
12261226
"Return bounds of expression at point to complete."
12271227
(when (not (memq (char-syntax (following-char)) '(?w ?_)))
12281228
(save-excursion
12291229
(let ((end (point)))
12301230
(skip-chars-backward (concat "^" inf-clojure-clojure-expr-break-chars))
1231-
(cons (point) end)))))
1231+
(let ((first-char (substring-no-properties (thing-at-point 'symbol) 0 1)))
1232+
(when (string-match-p "[^0-9]" first-char)
1233+
(cons (point) end)))))))
12321234

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

0 commit comments

Comments
 (0)