diff options
author | Fanael Linithien <fanael4@gmail.com> | 2014-11-22 18:25:43 (GMT) |
---|---|---|
committer | Fanael Linithien <fanael4@gmail.com> | 2014-11-23 21:25:27 (GMT) |
commit | 73f934e88679fee031f971554a7b79d640fb28f5 (patch) | |
tree | 09173faf5354942c2e8f491748e9c99982e5326a /misc/ninja-mode.el | |
parent | 14d161080c256ac5e7e877058691172a95acda45 (diff) | |
download | Ninja-73f934e88679fee031f971554a7b79d640fb28f5.zip Ninja-73f934e88679fee031f971554a7b79d640fb28f5.tar.gz Ninja-73f934e88679fee031f971554a7b79d640fb28f5.tar.bz2 |
Avoid putting properties past the end of the buffer.
Diffstat (limited to 'misc/ninja-mode.el')
-rw-r--r-- | misc/ninja-mode.el | 5 |
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" |