File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -116,10 +116,11 @@ find a symbol if there isn't one at point."
116
116
(unless (text-property-any 0 (length str) 'field 'cider-repl-prompt str)
117
117
str))
118
118
(when look-back
119
- (ignore-errors
120
- (while (not (looking-at " \\ sw\\ |\\ s_\\ |\\ `" ))
121
- (forward-sexp -1 )))
122
- (cider-symbol-at-point))))
119
+ (save-excursion
120
+ (ignore-errors
121
+ (while (not (looking-at " \\ sw\\ |\\ s_\\ |\\ `" ))
122
+ (forward-sexp -1 )))
123
+ (cider-symbol-at-point)))))
123
124
124
125
125
126
; ;; sexp navigation
Original file line number Diff line number Diff line change
1
+ (require 'cider )
2
+ (require 'cider-util )
3
+ (require 'ert )
4
+
5
+ ; ;; cider-util tests
6
+ (ert-deftest cider-symbol-at-point-dont-move ()
7
+ (with-temp-buffer
8
+ (clojure-mode)
9
+ (insert " something else\n " )
10
+ (should (not (cider-symbol-at-point)))
11
+ (should (equal " else" (cider-symbol-at-point 'lookback )))
12
+ (should (= (point ) (point-max )))))
You can’t perform that action at this time.
0 commit comments