Skip to content

What's the purpose of specifically coloring %s*([_%w]+:) in Python? #1290

Closed Answered by CharlesChiuGit
Jint-lzxy asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for the late reply! kinda busy on the weekend.

it's indeed a side effect of setting %s*([_%w]+:) for python in paint.nvim.
the reason of adding paint.nvim:

The reason I implemented this is because of the slow performance of tree-sitter-comment in large files. Treesitter will inject the comment language for every line comment, which is far from ideal. I've disabled the comment parser, but still wanted to see @something highlighted in Lua comments.1

and paint.nvim just grep text pattern instead of using ts-comment to detect comments.

In python, we sometime wrote docstrings like so:

def SetDeviceIndex(self, index: int) -> None:
    """
    Set index for device
    
    Parameters:   …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Jint-lzxy
Comment options

Jint-lzxy Jun 17, 2024
Collaborator Author

@CharlesChiuGit
Comment options

@Jint-lzxy
Comment options

Jint-lzxy Jun 17, 2024
Collaborator Author

Answer selected by Jint-lzxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants