CC Mode. Preserve space syntax-table props in open strings

This fixes bug#68111, allowing, e.g., backward-kill-word to
work properly.

* lisp/progmodes/cc-mode.el (c-clear-string-fences): On an open
string which isn't followed by another string, remove the
syntax-table properties just from template delimiters rather
than setting the syntax-table properties of all the string to
punctuation.
This commit is contained in:
Alan Mackenzie 2023-12-31 11:02:50 +00:00
parent bbd372da53
commit 91f316d293

View file

@ -1377,8 +1377,14 @@ Note that the style variables are always made local to the buffer."
(not (nth 3 s))
(c-get-char-property (1- (point)) 'c-fl-syn-tab))
(c-put-char-property pos 'syntax-table '(1))
(c-put-char-properties (1+ pos) (c-point 'eol pos)
'syntax-table '(1)))
;; Remove syntax-table text properties from template
;; delimiters.
(c-clear-char-property-with-value
(1+ pos) (c-point 'eol pos)
'syntax-table c-<-as-paren-syntax)
(c-clear-char-property-with-value
(1+ pos) (c-point 'eol pos)
'syntax-table c->-as-paren-syntax))
(setq pos (point)))
(setq pos (1+ pos)))))))))