diff options
author | Peter Kleiweg <pkleiweg@xs4all.nl> | 2012-06-13 16:24:25 -0400 |
---|---|---|
committer | Sameer Ajmani <sameer@golang.org> | 2012-06-13 16:24:25 -0400 |
commit | 4fcdfe1eb61f691facfa6cb2a1fcdc3144854d69 (patch) | |
tree | 96b7a97cef866d6a74d81f8770658123f789d551 | |
parent | 90f1a852dc99e87648e257d66bbb83f0fd1e54d1 (diff) | |
download | go-4fcdfe1eb61f691facfa6cb2a1fcdc3144854d69.tar.gz go-4fcdfe1eb61f691facfa6cb2a1fcdc3144854d69.zip |
[release-branch.go1] Emacs go-mode: fix Emacs freeze-up when copy/pasting from string or comment.
««« backport 798239220647
Emacs go-mode: fix Emacs freeze-up when copy/pasting from string or comment.
Fixes #3509.
Fixes #2767.
R=golang-dev, sameer
CC=golang-dev
https://golang.org/cl/6139066
»»»
-rw-r--r-- | misc/emacs/go-mode.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/misc/emacs/go-mode.el b/misc/emacs/go-mode.el index b2e2d3ab2b..783d1a8bb5 100644 --- a/misc/emacs/go-mode.el +++ b/misc/emacs/go-mode.el @@ -182,6 +182,10 @@ to and including character (1- go-mode-mark-comment-end)).") marked from the beginning up to this point.") (make-variable-buffer-local 'go-mode-mark-nesting-end) +(defun go-mode-mark-clear-cs (b e l) + "An after-change-function that removes the go-mode-cs text property" + (remove-text-properties b e '(go-mode-cs))) + (defun go-mode-mark-clear-cache (b e) "A before-change-function that clears the comment/string and nesting caches from the modified point on." @@ -709,6 +713,7 @@ functions, and some types. It also provides indentation that is (setq go-mode-mark-cs-end 1 go-mode-mark-nesting-end 1) (add-hook 'before-change-functions #'go-mode-mark-clear-cache nil t) + (add-hook 'after-change-functions #'go-mode-mark-clear-cs nil t) ;; Indentation (set (make-local-variable 'indent-line-function) |