Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow bundling parentheses into clusters to provide more flexibility and deal with more complex occasions #176

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

91khr
Copy link
Contributor

@91khr 91khr commented Dec 5, 2021

(This pr is the successor of #175)
(Currently this is only a draft since its documents are not yet updated)

As introduced in #174 and #161, some languages may have different syntax for parentheses inside and outside some environments; though they can be solved without adding any features, there are some issues beyond the issue themselves. Typically, a solution is adding a new vim syntax matching the special region, and define the parentheses to be containedin them. The shortcoming of the solution is that the environment itself (usually would be considered as parentheses) can't be rainbowed, and the parentheses inside the environment would have its rainbow level reset to 0.

This patch offers a way to solve these within rainbow. By bundling the toplevel parentheses, the region markers, and the parentheses within the regions into different clusters and assigning correct containing relation for them, they can cascade and all be rainbowed in correct levels.

However, after all, the patch may add too much complexity to rainbow... If this feature is considered worthwhile to be introduced into rainbow, Senioria will update the documents...

@91khr 91khr marked this pull request as draft December 5, 2021 06:49
@CoelacanthusHex
Copy link

Considering rainbow.vim not too heavy, and this plugin is used to indicate syntax units.
So I think accuracy is more important than speed.

@91khr
Copy link
Contributor Author

91khr commented Dec 5, 2021 via email

…em in the parentheses config

and fix the warning when contains_prefix is empty
trimmed some trailing spaces
documented some commands
@91khr 91khr marked this pull request as ready for review December 27, 2021 02:20
@91khr
Copy link
Contributor Author

91khr commented Dec 27, 2021

However, the issues this pr intended to fix is not actually fixed yet, because it remains uncertain how shell codes and html templates should be highlighted...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants