-
Notifications
You must be signed in to change notification settings - Fork 4
fix tab key #67
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 tab key #67
Conversation
WalkthroughThis update modifies key mapping strings in three plugin configuration files. It standardizes capitalization for control and shift keys, updates specific keybindings for Augment and Blink features, and enhances the snippet jump logic to provide fallback behavior when a jump is not possible. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant LuasnipPlugin
User->>LuasnipPlugin: Press <Tab> or <S-Tab>
alt Jump is possible
LuasnipPlugin->>LuasnipPlugin: luasnip.jump(step_size)
else Jump not possible
LuasnipPlugin->>User: Return fallback key ("<Tab>" or "<S-Tab>")
end
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Pull Request Overview
This PR aims to fix the tab key behavior by adjusting snippet navigation and key mapping consistency across various modules.
- Updated the stepper function in the snippet module to conditionally return a jump or fallback key.
- Revised key mappings in the blink and augment modules for consistent capitalization.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plugins/nobbz/lua/nobbz/luasnip.lua | Updated stepper function logic and key mapping for tab keys. |
| plugins/nobbz/lua/nobbz/blink.lua | Changed key mapping for documentation toggle to uppercase. |
| plugins/nobbz/lua/nobbz/augment.lua | Updated key mapping capitalization for completion acceptance. |
plugins/nobbz/lua/nobbz/luasnip.lua
Outdated
| if luasnip.jumpable(step_size) then | ||
| luasnip.jump(step_size) | ||
| else | ||
| return step_size > 0 and "<tab>" or "<s-tab>" |
Copilot
AI
May 25, 2025
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.
The fallback key values in the stepper function are lowercase ('' and '') while the registered key mappings use uppercase ('' and ''). Consider aligning these values for consistency.
| return step_size > 0 and "<tab>" or "<s-tab>" | |
| return step_size > 0 and "<Tab>" or "<S-Tab>" |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
plugins/nobbz/lua/nobbz/augment.lua(1 hunks)plugins/nobbz/lua/nobbz/blink.lua(1 hunks)plugins/nobbz/lua/nobbz/luasnip.lua(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`plugins/**/*.lua`: Please ensure all of the following: - Plugins are lazyloaded if possible through `nobbz.lazy` - `local` has to be used - coding follows the [luarocks styleguide...
plugins/**/*.lua: Please ensure all of the following:
- Plugins are lazyloaded if possible through
nobbz.lazylocalhas to be used- coding follows the luarocks styleguide, but with 2 spaces indentation
plugins/nobbz/lua/nobbz/augment.luaplugins/nobbz/lua/nobbz/blink.luaplugins/nobbz/lua/nobbz/luasnip.lua
🔇 Additional comments (3)
plugins/nobbz/lua/nobbz/augment.lua (1)
37-37: LGTM! Key mapping standardization improves consistency.The change from
"<C-cr>"to"<C-CR>"standardizes the key notation to match Vim's convention where special keys are capitalized. This aligns with similar changes across other plugin files in this PR.plugins/nobbz/lua/nobbz/blink.lua (1)
44-44: LGTM! Consistent key mapping capitalization.The change from
"<C-space>"to"<C-Space>"follows Vim's standard key notation conventions and maintains consistency with the other key mapping updates in this PR.plugins/nobbz/lua/nobbz/luasnip.lua (1)
26-30: LGTM! Key mapping standardization and proper expression handling.The key mapping updates correctly:
- Standardize capitalization (
<Tab>,<S-Tab>,<C-a>, etc.)- Add
expr = truefor Tab mappings to support the enhanced stepper function's conditional return values- Maintain consistent formatting and structure
These changes align perfectly with the standardization effort across the plugin files.
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.
Pull Request Overview
This PR fixes Tab key behavior in the Luasnip plugin by falling back to default Tab/S-Tab when no snippet jump is available, and standardizes keybinding capitalization across blink and augment integrations.
- Added fallback logic in
stepperto revert to standard Tab/S-Tab when snippet jumps are unavailable and enabledexprmappings. - Updated blink and augment configurations to use consistent capitalized keybinding notation (
<C-Space>,<C-CR>). - Standardized keymap entries for better consistency across plugins.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| plugins/nobbz/lua/nobbz/luasnip.lua | Added fallback in stepper, updated keymap entries with expr = true |
| plugins/nobbz/lua/nobbz/blink.lua | Renamed <C-space> to <C-Space> for consistent capitalization |
| plugins/nobbz/lua/nobbz/augment.lua | Standardized <C-cr> to <C-CR> in augment keymap |
Comments suppressed due to low confidence (2)
plugins/nobbz/lua/nobbz/luasnip.lua:17
- The fallback branch for when luasnip.jumpable returns false isn't covered by existing tests. Consider adding tests to ensure that the mapping correctly falls back to the Tab/S-Tab key in those cases.
if luasnip.jumpable(step_size) then
plugins/nobbz/lua/nobbz/blink.lua:44
- [nitpick] Using uppercase notation for space () may be inconsistent with Neovim keymap conventions; consider using lowercase () or document the choice to maintain consistency across mappings.
["<C-Space>"] = { "show", "show_documentation", "hide_documentation", },
Summary by CodeRabbit
Bug Fixes
Style