-
-
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
Add possibility to customize request view mappings #185
Conversation
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 [email protected] |
WalkthroughThis update enhances the Neovim configuration for the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant HurlPopup
participant GlobalConfig
User->>HurlPopup: Press 'q'
HurlPopup->>GlobalConfig: Check mapping for close
GlobalConfig-->>HurlPopup: Return close mapping
HurlPopup->>User: Close the popup
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 Configuration 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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (2)
doc/hurl.nvim.txt (2)
346-355
: Fix punctuation issues.The list items have loose punctuation marks. Ensure consistent punctuation for better readability.
- - `q`: Close the current popup window or split. - - `<C-n>`: Switch to the next popup window. - - `<C-p>`: Switch to the previous popup window. + - `q`: Close the current popup window or split. + - `<C-n>`: Switch to the next popup window. + - `<C-p>`: Switch to the previous popup window.Tools
LanguageTool
[uncategorized] ~346-~346: Loose punctuation mark.
Context: ...ings to streamline your workflow: -q
: Close the current popup window or split...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~347-~347: Loose punctuation mark.
Context: ...current popup window or split. -<C-n>
: Switch to the next popup window. - `<C-...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~348-~348: Loose punctuation mark.
Context: ...itch to the next popup window. -<C-p>
: Switch to the previous popup window. T...(UNLIKELY_OPENING_PUNCTUATION)
437-439
: Inconsistent key mappings detected.The custom key mapping for the
close
action in the example configuration (<C-c>
) is inconsistent with the default mapping ('q'
) documented earlier.
lua/hurl/init.lua
close = 'q'
doc/hurl.nvim.txt
(lines 437-439)
close = '<C-c>'
Please ensure that the key mappings in the example configuration are consistent with the default mappings.
Analysis chain
Ensure consistency in key mappings.
The custom key mappings in the example configuration should be consistent with the default mappings documented earlier.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistency in key mappings. # Test: Search for the key mappings in the configuration. Expect: Consistent mappings. rg --type lua -A 5 $'mappings = {'Length of output: 123
Script:
#!/bin/bash # Description: Verify consistency in key mappings. # Test: Search for the key mappings in the configuration. Expect: Consistent mappings. rg --type lua -A 5 $'mappings = \\{'Length of output: 365
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- README.md (1 hunks)
- doc/hurl.nvim.txt (4 hunks)
- lua/hurl/init.lua (2 hunks)
- lua/hurl/popup.lua (1 hunks)
- lua/hurl/split.lua (1 hunks)
Additional context used
LanguageTool
doc/hurl.nvim.txt
[uncategorized] ~346-~346: Loose punctuation mark.
Context: ...ings to streamline your workflow: -q
: Close the current popup window or split...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~347-~347: Loose punctuation mark.
Context: ...current popup window or split. -<C-n>
: Switch to the next popup window. - `<C-...(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~348-~348: Loose punctuation mark.
Context: ...itch to the next popup window. -<C-p>
: Switch to the previous popup window. T...(UNLIKELY_OPENING_PUNCTUATION)
Additional comments not posted (10)
lua/hurl/init.lua (2)
48-53
: LGTM! Adding themappings
table enhances user customization.The addition of the
mappings
table allows users to define their own key mappings for response views, which improves the user experience.
69-69
: LGTM! Changing tovim.tbl_deep_extend
improves configuration merging.Using
vim.tbl_deep_extend
ensures that nested tables are merged correctly, preserving existing nested configuration options while updating them with new values.lua/hurl/split.lua (1)
84-84
: LGTM! Using_HURL_GLOBAL_CONFIG.mappings.close
enhances configurability.Changing the key mapping for closing a split window to use
_HURL_GLOBAL_CONFIG.mappings.close
allows users to customize this key mapping, improving flexibility and user experience.lua/hurl/popup.lua (4)
65-65
: LGTM! Using_HURL_GLOBAL_CONFIG.mappings.close
enhances configurability.Changing the key mapping for closing the top popup window to use
_HURL_GLOBAL_CONFIG.mappings.close
allows users to customize this key mapping, improving flexibility and user experience.
68-68
: LGTM! Using_HURL_GLOBAL_CONFIG.mappings.close
enhances configurability.Changing the key mapping for closing the bottom popup window to use
_HURL_GLOBAL_CONFIG.mappings.close
allows users to customize this key mapping, improving flexibility and user experience.
73-73
: LGTM! Using_HURL_GLOBAL_CONFIG.mappings.next_panel
enhances configurability.Changing the key mapping for navigating to the next popup window to use
_HURL_GLOBAL_CONFIG.mappings.next_panel
allows users to customize this key mapping, improving flexibility and user experience.
80-83
: LGTM! Using_HURL_GLOBAL_CONFIG.mappings.prev_panel
enhances configurability.Changing the key mapping for navigating to the previous popup window to use
_HURL_GLOBAL_CONFIG.mappings.prev_panel
allows users to customize this key mapping, improving flexibility and user experience.doc/hurl.nvim.txt (2)
80-85
: Document new default key mappings.The new default key mappings for the response popup or split views are well-documented. This enhances the usability of the plugin by providing clear instructions on how to customize these mappings.
408-412
: Document new default key mappings in configuration.The new default key mappings are clearly documented in the configuration section. This provides users with the necessary information to customize their key mappings effectively.
README.md (1)
63-68
: Document new default key mappings.The new default key mappings for the response popup or split views are well-documented. This enhances the usability of the plugin by providing clear instructions on how to customize these mappings.
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.
LGTM! Thanks @yngwi
@all-contributors add @yngwi for code,doc. |
I've put up a pull request to add @yngwi! 🎉 |
Closes issue #184 by adding a
mappings
section to the_HURL_GLOBAL_CONFIG
table and using the individual mappings when registering mappings for thesplit
andpopup
response views.Note:
vim.tbl_extend
has been replaced withvim.tbl_deep_extend
when merging the default and user provided config tables to ensure also partial custom user mappings are possible. This also affects other settings. I hope this is OK.Summary by CodeRabbit
New Features
Documentation
hurl.nvim
plugin.Refactor