diff options
author | Tom Willemse | 2022-02-24 01:55:05 -0800 |
---|---|---|
committer | Tom Willemse | 2022-02-24 01:55:05 -0800 |
commit | 04bc3f3b7e406a7e74f5ddc193708109f930ca7a (patch) | |
tree | 4307376df067f786e5b1ed91dc3e502df15eef5b /oni-core.el | |
parent | ace4d24a7e03ccf2e6c68c941f9440618dfec816 (diff) | |
download | emacs-config-04bc3f3b7e406a7e74f5ddc193708109f930ca7a.tar.gz emacs-config-04bc3f3b7e406a7e74f5ddc193708109f930ca7a.zip |
[oni-core] Go to the end of the line if a comment isn't found
Diffstat (limited to 'oni-core.el')
-rw-r--r-- | oni-core.el | 14 |
1 files 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: |