From 04bc3f3b7e406a7e74f5ddc193708109f930ca7a Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 24 Feb 2022 01:55:05 -0800 Subject: [PATCH] [oni-core] Go to the end of the line if a comment isn't found --- oni-core.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/oni-core.el b/oni-core.el index 7dd14f7..d507a84 100644 --- a/oni-core.el +++ b/oni-core.el @@ -79,12 +79,14 @@ (if (and comment-start (not (looking-at (regexp-quote comment-start))) (comment-search-forward eolpos t)) - (progn - (search-backward-regexp (concat "[^ \t" comment-start "]")) - (forward-char) - (when (or (bolp) - (= start (point))) - (end-of-line))) + (condition-case _ + (progn + (search-backward-regexp (concat "[^ \t" comment-start "]")) + (forward-char) + (when (or (bolp) + (= start (point))) + (end-of-line))) + (search-failed (end-of-line))) (end-of-line)))) ;;; From Bastien Guerry’s Emacs configuraiton: