File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -236,13 +236,15 @@ execute it inside the buffer. Otherwire, if it's an integer call function
236236`forward-line' instead.
237237
238238Argument SR is the target symbol for us to stop looking for the end of declaration."
239- (let (beg)
239+ (let (beg found )
240240 (save-excursion
241241 (cond ((functionp type) (funcall type))
242242 ((integerp type) (forward-line type)))
243243 (unless (docstr-util-current-line-empty-p)
244244 (setq beg (line-beginning-position ))
245- (re-search-forward sr nil t )
245+ (while (and (not (docstr-util-current-line-empty-p)) (not found))
246+ (setq found (re-search-forward sr (line-end-position ) t ))
247+ (forward-line 1 ))
246248 (backward-char (length (match-string 0 )))
247249 (buffer-substring beg (point ))))))
248250
@@ -252,7 +254,8 @@ Argument SR is the target symbol for us to stop looking for the end of declarati
252254See function `docstr--get-search-string' description for arguments TYPE
253255and SR."
254256 (let (search-string)
255- (setq search-string (docstr--get-search-string type sr)
257+ (setq search-string (or (ignore-errors (docstr--get-search-string type sr))
258+ " " )
256259 search-string (string-trim search-string)
257260 search-string (s-replace " \n " " " search-string))))
258261
You can’t perform that action at this time.
0 commit comments