We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0c12b6 commit 8e1792bCopy full SHA for 8e1792b
pyimport.el
@@ -122,9 +122,12 @@ baz is SYMBOL."
122
"Try to insert an import for the symbol at point.
123
Dumb: just scans open Python buffers."
124
(interactive)
125
- (let ((symbol (substring-no-properties (thing-at-point 'symbol)))
+ (let ((symbol (thing-at-point 'symbol))
126
(matching-lines nil)
127
(case-fold-search nil))
128
+ (unless symbol
129
+ (user-error "No symbol at point"))
130
+ (setq symbol (substring-no-properties symbol))
131
;; Find all the import lines in all Python buffers
132
(dolist (buffer (pyimport--buffers-in-mode 'python-mode))
133
(dolist (line (pyimport--import-lines buffer))
0 commit comments