]> Cypherpunks repositories - gostls13.git/commitdiff
Emacs go-mode: fix Emacs freeze-up when copy/pasting from string or comment.
authorPeter Kleiweg <pkleiweg@xs4all.nl>
Tue, 29 May 2012 16:40:12 +0000 (12:40 -0400)
committerSameer Ajmani <sameer@golang.org>
Tue, 29 May 2012 16:40:12 +0000 (12:40 -0400)
Fixes #3509.
Fixes #2767.

R=golang-dev, sameer
CC=golang-dev
https://golang.org/cl/6139066

misc/emacs/go-mode.el

index b2e2d3ab2b5218e207ad72a1f64dd03ee3e0f615..783d1a8bb5983986ce7615bf28202156efd05056 100644 (file)
@@ -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)