-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix(split): no fold find if foldexpr setup #166
Conversation
foldlevel computing can manually trigger with `zx`, so we just need recompute foldlevel after setup filetype to json | html | text
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
Your free trial has expired. To keep using Ellipsis, sign up at https://app.ellipsis.dev for $20/seat/month or reach us at help@ellipsis.dev |
WalkthroughThe change in Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- recomputing foldlevel, this is needed if we setup foldexpr | ||
vim.api.nvim_feedkeys('zx', 'n', true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Consider adding a configuration option for the zx
command.
The use of vim.api.nvim_feedkeys('zx', 'n', true)
to recompute the fold level is a clever workaround, but it might have side effects depending on the user's configuration or other plugins. To avoid potential issues, consider adding a configuration option to enable or disable this behavior based on user preference.
Analysis chain
Ensure proper handling of zx
command.
The use of vim.api.nvim_feedkeys('zx', 'n', true)
to recompute the fold level is a clever workaround, but it might have side effects depending on the user's configuration or other plugins. Consider adding a check or configuration option to enable or disable this behavior based on user preference.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that the `zx` command is properly handled across different filetypes.
# Test: Search for issues related to `zx` command handling in different filetypes.
rg --type lua $'zx'
Length of output: 80
Script:
#!/bin/bash
# Description: Search for configurations or plugins related to fold settings and `foldexpr` in the codebase.
# Test: Search for fold settings in the codebase.
rg --type lua 'fold'
# Test: Search for foldexpr settings in the codebase.
rg --type lua 'foldexpr'
Length of output: 445
Hi @wenjinnn I can't reproduce the issue. Could you record a video for before/after the PR? Thanks 🙏 |
Sure! the basic setting is:
You also need to setup nvim-treesitter with json html parser. 2024-05-30_22-21-07.mp4after: 2024-05-30_22-22-57.mp4 |
Thanks @wenjinnn LGTM. |
WHAT
foldlevel computing can manually trigger with
zx
, so we just need recompute foldlevel after setup filetype to json | html | textrelated #162
WHY
HOW
Screenshots (if appropriate):
Types of changes
Checklist:
Summary by CodeRabbit