 	(remove-text-properties
 	 b (min go-mode-mark-cs-end (point-max)) '(go-mode-cs nil))
 	(setq go-mode-mark-cs-end b)))
+
+    (when (<= b go-mode-mark-string-end)
+      ;; Remove the property adjacent to the change position.
+      ;; It may contain positions pointing beyond the new end mark.
+      (let ((b (let ((cs (get-text-property (max 1 (1- b)) 'go-mode-string)))
+		 (if cs (car cs) b))))
+	(remove-text-properties
+	 b (min go-mode-mark-string-end (point-max)) '(go-mode-string nil))
+	(setq go-mode-mark-string-end b)))
+    (when (<= b go-mode-mark-comment-end)
+      ;; Remove the property adjacent to the change position.
+      ;; It may contain positions pointing beyond the new end mark.
+      (let ((b (let ((cs (get-text-property (max 1 (1- b)) 'go-mode-comment)))
+		 (if cs (car cs) b))))
+	(remove-text-properties
+	 b (min go-mode-mark-string-end (point-max)) '(go-mode-comment nil))
+	(setq go-mode-mark-comment-end b)))
+    
     (when (< b go-mode-mark-nesting-end)
       (remove-text-properties b (min go-mode-mark-nesting-end (point-max)) '(go-mode-nesting nil))
       (setq go-mode-mark-nesting-end b))))

       (when (/= (skip-chars-backward "[:word:]_") 0)
         (not (looking-at go-mode-non-terminating-keywords-regexp)))))))

(defun go-mode-backward-skip-comments ()
  "Skip backward over comments and whitespace."
  (when (not (bobp))
    (backward-char))
  (while (and (not (bobp))
              (or (eq 32 (char-syntax (char-after (point))))
                  (go-mode-cs)))
    (skip-syntax-backward "-")
    (when (and (not (bobp)) (eq 32 (char-syntax (char-after (point)))))
      (backward-char))
    (when (go-mode-cs)
      (let ((pos (previous-single-property-change (point) 'go-mode-cs)))
        (if pos (goto-char pos) (goto-char (point-min))))))
  (when (and (not (go-mode-cs)) (eq 32 (char-syntax (char-after (1+ (point))))))
    (forward-char 1)))

(defun go-mode-indentation ()
  "Compute the ideal indentation level of the current line.

                   (incf indent tab-width))
                  ((?\()
                   (goto-char (car nest))
                   (go-mode-backward-skip-comments)
                   (backward-char)
                   ;; Really just want the token before
                   (when (looking-back "\\<import\\|const\\|var\\|type\\|package"
                                       (max (- (point) 7) (point-min)))
                     (incf indent tab-width)
                     (when first
