这个是上面 make_buffer_string_both
里面 if (props)
运行的內容,我找了个 tree-sitter 的 emacs 绑定实现看了下,实际上调用的是 buffer-substring-no-properties
,props
会设为 0
,不会对 text property 相关的內容进行操作。
不过 tree-sitter 本身有 bug 不能实现整合是另一回事了。
我这里没啥感觉,用的下面的。估计配置差異。
(add-hook 'post-command-hook
(lambda () (buffer-substring-no-properties (point-max) (point-min))))
而且 after-change-functions
就行了,post-command-hook
有点过了。