wucuo icon indicating copy to clipboard operation
wucuo copied to clipboard

Not highlight incorrect words in some files

Open shy-robin opened this issue 1 year ago • 8 comments

It works well in .js and .txt files. image

However, when I switch to .json , .html, or .ts files , it seems not work. image

shy-robin avatar May 28 '23 03:05 shy-robin

(setq wucuo-debug t), reproduce the issue , send me the log info in message buffer.

redguardtoo avatar May 29 '23 03:05 redguardtoo

(setq wucuo-debug t), reproduce the issue , send me the log info in message buffer.

image

shy-robin avatar May 29 '23 04:05 shy-robin

(setq wucuo-debug t), reproduce the issue , send me the log info in message buffer.

The screenshot above is messages buffer of .ts file. Below is .json. image

shy-robin avatar May 29 '23 04:05 shy-robin

I think it's treesit uses different font face which is not included in wucuo-font-faces-to-check.

You can add the missing font face into wucuo-font-faces-to-check, or wucuo-personal-font-faces-to-check (recommend).

BTW, use command wucuo-current-font-face. to detect font face at point.

redguardtoo avatar May 29 '23 06:05 redguardtoo

7ca440a support tree-sitter-hl-mode (Chen Bin)

redguardtoo avatar May 29 '23 07:05 redguardtoo

I think it's treesit uses different font face which is not included in wucuo-font-faces-to-check.

You can add the missing font face into wucuo-font-faces-to-check, or wucuo-personal-font-faces-to-check (recommend).

BTW, use command wucuo-current-font-face. to detect font face at point.

Thank you very much! I use wucuo-current-font-face to detect font face under the cursor and it shows tree-sitter-hl-face:comment. Then I use (setq wucuo-personal-font-faces-to-check '(tree-sitter-hl-face:comment)) to add missing font faces. When I restart emacs, it works! In addition, I wonder if there is a convenient way to add missing font faces because now I need to add tree-sitter-hl-face:comment for comment, and tree-sitter-hl-face:variables for variables, and tree-sitter-hl-face:strings for strings in json , and so on. Is there a easy way to add all missing font faces ?

shy-robin avatar May 30 '23 05:05 shy-robin

I've already do the setup for tree-sitter in latest commit. So it should work out of box now.

You can use (setq wucuo-personal-font-faces-to-check '(face1 face2 face3 ...)) to add other missing font faces .

redguardtoo avatar May 30 '23 11:05 redguardtoo

I got it. I will update this package. Thanks!

shy-robin avatar May 30 '23 11:05 shy-robin