Skip to content

Commit 6bdfbc9

Browse files
author
Kang Tu
committed
Handle TODO insertion on blank or nil lines correctly
1 parent fc0194d commit 6bdfbc9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ai-code-change.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ Returns non-nil if the action is handled and the caller should exit."
247247
(defun ai-code--implement-todo--handle-blank-line ()
248248
"Handle insertion of a TODO comment when on a blank line.
249249
Returns non-nil if handled and the caller should exit."
250+
;; (interactive)
250251
(when (and (not (region-active-p))
251-
(string-blank-p (thing-at-point 'line t))
252+
(or (not (thing-at-point 'line t)) (string-blank-p (thing-at-point 'line t)))
252253
comment-start)
253254
(let ((todo-text (ai-code-read-string "Enter TODO comment: "))
254255
(comment-prefix (if (eq major-mode 'emacs-lisp-mode)

0 commit comments

Comments
 (0)