效果就像 company 那样,怎么让下面这个hehe
显示在某个(point)
正下方呢?
(with-temp-buffer
(insert "hehe")
(add-text-properties (point-min) (point-max) `(face (:background ,bc :foreground ,fc)))
(overlay-put overlay 'before-string (buffer-string)))
效果就像 company 那样,怎么让下面这个hehe
显示在某个(point)
正下方呢?
(with-temp-buffer
(insert "hehe")
(add-text-properties (point-min) (point-max) `(face (:background ,bc :foreground ,fc)))
(overlay-put overlay 'before-string (buffer-string)))
在m-x info中搜索display
或是直接看company的代码
原来是把before-string
换成display
。同时还要注意 point 的范围,这个范围会被整个替换。如果要达到 company 的效果,下一行不够应该还需要先填充。