Skip to content

[sil-mode.el] Improve handling of box types by sil-mode-display-function-cfg #35173

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

Merged

Conversation

gottesmm
Copy link
Contributor

Specifically, I changed how sil-mode-display-function-cfg searches for the
start/end of the SIL function body where the current point is. Previously, we
just searched for the exact strings "{" and "}" backwards and forwards
respectively. That was insufficient in the context of box types that use those
characters.

Instead with this change, we convert the aforementioned static search to a regex
search. Our regex match "{$" for the beginning of the SIL function and "^} //
end sil function '" or "^}" which I think will generally work to get the correct
body. NOTE: We first check for the end sil function variant.

…ion-cfg

Specifically, I changed how sil-mode-display-function-cfg searches for the
start/end of the SIL function body where the current point is. Previously, we
just searched for the exact strings "{" and "}" backwards and forwards
respectively. That was insufficient in the context of box types that use those
characters.

Instead with this change, we convert the aforementioned static search to a regex
search. Our regex match "{$" for the beginning of the SIL function and "^} //
end sil function '" or "^}" which I think will generally work to get the correct
body. NOTE: We first check for the end sil function variant.
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit a4112eb into swiftlang:main Dec 21, 2020
@gottesmm gottesmm deleted the pr-bda612d38a584f3f9ba7f8e2b5479873d3cdb6fa branch July 23, 2021 21:54
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