summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authorFelix S Klock II <pnkfelix@pnkfx.org>2019-03-04 13:33:56 +0100
committerGitHub <noreply@github.com>2019-03-04 13:33:56 +0100
commit06f1c6816c6291a71d636f2fbb9fd67a5c8d28c4 (patch)
treebeaae8a0396cc4a3228c0ce7b77e1a0a5e14394a /rust-mode.el
parent8cd18cc89d1e1f4419fb7b6a13d6bf50e480938b (diff)
parent497d47679ad0349b43b744c9ef4ac16a610c0779 (diff)
downloadrust-mode-06f1c6816c6291a71d636f2fbb9fd67a5c8d28c4.tar.gz
Merge pull request #300 from mmilenko/rust-looking-back-macro--backward-char--fix
Avoid signaling "Beginning of buffer" in rust-looking-back-macro
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/rust-mode.el b/rust-mode.el
index c22cad8..3585f1d 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -80,7 +80,8 @@ Like `looking-back' but for fixed strings rather than regexps (so that it's not
(defun rust-looking-back-macro ()
"Non-nil if looking back at an ident followed by a !"
- (save-excursion (backward-char) (and (= ?! (char-after)) (rust-looking-back-ident))))
+ (if (> (- (point) (point-min)) 1)
+ (save-excursion (backward-char) (and (= ?! (char-after)) (rust-looking-back-ident)))))
;; Syntax definitions and helpers
(defvar rust-mode-syntax-table
@@ -1604,7 +1605,7 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
(when rust-format-on-save
(unless (executable-find rust-rustfmt-bin)
(error "Could not locate executable \"%s\"" rust-rustfmt-bin))))
-
+
(defvar rustc-compilation-regexps
(let ((file "\\([^\n]+\\)")
(start-line "\\([0-9]+\\)")