summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/ninja-mode.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/misc/ninja-mode.el b/misc/ninja-mode.el
index 20b1237..330eba7 100644
--- a/misc/ninja-mode.el
+++ b/misc/ninja-mode.el
@@ -56,7 +56,10 @@
(not (eq ?$ (char-before (line-end-position 0)))))
(put-text-property match-pos (1+ match-pos) 'syntax-table '(11))
(let ((line-end (line-end-position)))
- (put-text-property line-end (1+ line-end) 'syntax-table '(12)))))))))
+ ;; Avoid putting properties past the end of the buffer.
+ ;; Otherwise we get an `args-out-of-range' error.
+ (unless (= line-end (1+ (buffer-size)))
+ (put-text-property line-end (1+ line-end) 'syntax-table '(12))))))))))
;;;###autoload
(define-derived-mode ninja-mode prog-mode "ninja"