File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -828,20 +828,25 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
828
828
(defun xref--read-identifier (prompt )
829
829
" Return the identifier at point or read it from the minibuffer."
830
830
(let* ((backend (xref-find-backend ))
831
- (id (xref-backend-identifier-at-point backend)))
831
+ (def (xref-backend-identifier-at-point backend)))
832
832
(cond ((or current-prefix-arg
833
- (not id )
833
+ (not def )
834
834
(xref--prompt-p this-command))
835
- (completing-read (if id
836
- (format " %s (default %s ): "
837
- (substring prompt 0 (string-match
838
- " [ :]+\\ '" prompt))
839
- id)
840
- prompt)
841
- (xref-backend-identifier-completion-table backend)
842
- nil nil nil
843
- 'xref--read-identifier-history id))
844
- (t id))))
835
+ (let ((id
836
+ (completing-read
837
+ (if def
838
+ (format " %s (default %s ): "
839
+ (substring prompt 0 (string-match
840
+ " [ :]+\\ '" prompt))
841
+ def)
842
+ prompt)
843
+ (xref-backend-identifier-completion-table backend)
844
+ nil nil nil
845
+ 'xref--read-identifier-history def)))
846
+ (if (equal id " " )
847
+ (or def (user-error " There is no defailt identifier" ))
848
+ id)))
849
+ (t def))))
845
850
846
851
847
852
; ;; Commands
You can’t perform that action at this time.
0 commit comments