Skip to content

Commit 09e9025

Browse files
committed
Fixed search string logic.
1 parent ccbae44 commit 09e9025

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docstr.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ Argument SR is the target symbol for us to stop looking for the end of declarati
247247
(while (and (not (docstr-util-current-line-empty-p)) (not found))
248248
(setq found (re-search-forward sr (line-end-position) t))
249249
(forward-line 1))
250+
(when found (goto-char found))
250251
(backward-char (length (match-string 0)))
251252
(buffer-substring beg (point))))))
252253

@@ -259,7 +260,8 @@ and SR."
259260
(setq search-string (or (ignore-errors (docstr--get-search-string type sr))
260261
"")
261262
search-string (string-trim search-string)
262-
search-string (s-replace "\n" " " search-string))))
263+
search-string (s-replace "\n" " " search-string))
264+
search-string))
263265

264266
(defun docstr--c-style-search-string (type)
265267
"Return c-style search string.

0 commit comments

Comments
 (0)