-
-
Notifications
You must be signed in to change notification settings - Fork 49
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 "enter-to-leave" on root node feature by default #497
Conversation
WalkthroughThe update introduces a new configuration option that allows users to toggle the behavior of the Enter key at the root node within the Fern file explorer. This change enables users to either exit the tree or reload the tree when pressing Enter at the root node, enhancing navigation flexibility based on user preference. Changes
Assessment against linked issues
Poem
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.
Review Status
Actionable comments generated: 24
Configuration used: CodeRabbit UI
Files selected for processing (3)
- autoload/fern.vim (1 hunks)
- autoload/fern/mapping/node.vim (1 hunks)
- doc/fern.txt (1 hunks)
Additional comments: 16
autoload/fern.vim (1)
- 27-27: The addition of the
'disable_enter_to_leave_on_root'
configuration option is well-integrated within the existing configuration setup. Ensure that the documentation for this new option is clear and comprehensive, helping users understand how to use it and the implications of enabling/disabling this feature.autoload/fern/mapping/node.vim (1)
- 176-180: The conditional logic in the
s:map_enter
function correctly implements the feature's intended behavior. Consider adding a comment to clarify the use of!empty(node.__owner)
in the condition, explaining its role in determining whether the current node is at the root level. This will enhance code readability and maintainability.doc/fern.txt (14)
- 570-574: The documentation for the new global variable
g:fern#disable_enter_to_leave_on_root
is clear and concise. It effectively explains the purpose and default behavior of the variable.- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [58-58]
The term "netrw" might be incorrectly spelled or unclear to some readers. Consider clarifying if this refers to a specific plugin or feature.
Please verify if "netrw" refers to a specific Vim plugin or feature and consider adding a brief explanation or reference link for clarity.
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [72-72]
Possible typo in "t9md/vim-choosewin". Verify if the repository name is correct.
Verification successful
The repository
t9md/vim-choosewin
exists on GitHub, as confirmed by the HTTP status code "HTTP/2 200". Therefore, the mention of the repository name in the documentation is correct.* 567-577: > 📝 **NOTE** > This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [79-79]Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify if the repository t9md/vim-choosewin exists curl -I https://github.com/t9md/vim-choosewin 2>/dev/null | head -n 1 | grep "HTTP/2 200"Length of output: 91
The term "exrename" might be unfamiliar to some readers. Consider adding a brief explanation or reference link.
Please verify the term "exrename" and consider adding a brief explanation or reference link for clarity.
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [95-95]
The term "osascript" might be unfamiliar to some readers. Consider adding a brief explanation that it is a utility available on macOS for running AppleScript commands.
Consider adding a brief explanation for "osascript" to clarify that it is a utility available on macOS for running AppleScript commands.
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [110-110]
The term "Netrw" might be incorrectly spelled or unclear to some readers. Consider clarifying if this refers to a specific plugin or feature.
Please verify if "Netrw" refers to a specific Vim plugin or feature and consider adding a brief explanation or reference link for clarity.
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [173-173]
The term "autocmd" might be unfamiliar to some readers. Consider adding a brief explanation that it refers to Vim's "autocommand" feature.
Consider adding a brief explanation for "autocmd" to clarify that it refers to Vim's "autocommand" feature.
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [203-203]
The term "tcd:root" might be unfamiliar to some readers. Consider adding a brief explanation or reference link.
Please verify the term "tcd:root" and consider adding a brief explanation or reference link for clarity.
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [330-330]
The phrase "thus faint vertical bar is used instead" could be rephrased for clarity.
Consider rephrasing to "therefore, a faint vertical bar is used as an alternative".
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [339-339]
The term "keepalt_on_edit" should be more descriptive and use snake case for readability.
Consider renaming to "keep_alt_on_edit" for better readability and consistency with naming conventions.
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [361-361]
The term "keepjumps_on_edit" should be more descriptive and use snake case for readability.
Consider renaming to "keep_jumps_on_edit" for better readability and consistency with naming conventions.
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [399-399]
Clarify that "CUI Vim" refers to "Console User Interface for Vim".
Consider adding a brief explanation for "CUI Vim" to clarify that it refers to "Console User Interface for Vim".
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [404-404]
The term "WinEnter" might be unfamiliar to some readers. Consider adding a brief explanation that it refers to a Vim autocommand event.
Consider adding a brief explanation for "WinEnter" to clarify that it refers to a Vim autocommand event.
- 567-577: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [528-528]
The term "textprop_support" should be more descriptive and use snake case for readability.
Consider renaming to "text_prop_support" for better readability and consistency with naming conventions.
A |Number| value that specifies whether to synchronize file renames to the buffer | ||
Default: 0 | ||
|
||
*g:fern#disable_enter_to_leave_on_root* | ||
A |Boolean| to disable "enter to leave" behavior on the root node. | ||
If set to 1, "enter" on the root node will reload the tree instead. | ||
Default: 0 | ||
|
||
*g:fern#window_selector_use_popup* | ||
A |Boolean| which use popup/float window to select window. | ||
See |fern-glossary-window-selector| |
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.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [3-3]
There's an extra whitespace between "Author:" and "Alisue".
- Author: Alisue <[email protected]>
+ Author: Alisue <[email protected]>
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [44-44]
The word "Exception" starting a sentence should be preceded by a period or be part of the previous sentence.
- itself. Exception: "trash" feature in Linux.
+ itself. Exception: "trash" feature in Linux.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [49-49]
Consider rephrasing "most of operations" to "most operations" for better readability.
- Fern uses asynchronous technique to perform most of operations so Vim
+ Fern uses asynchronous technique to perform most operations so Vim
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [55-55]
There's an extra space before "NERDTree".
- drawer (e.g. NERDTree); officially.
+ drawer (e.g. NERDTree); officially.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [91-91]
The phrase "quite easy" could be replaced with a more formal term like "straightforward".
- So it's quite easy to open a directory with Explorer
+ So it's straightforward to open a directory with Explorer
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [102-102]
The phrase "Most of functionalities" should be corrected to "Most functionalities" for grammatical accuracy.
- Most of functionalities are provided as plugins in fern.
+ Most functionalities are provided as plugins in fern.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [140-140]
The word "where" starting a sentence should be capitalized.
- where {name} is a name of the action.
+ Where {name} is a name of the action.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [188-188]
There's an extra space before "e".
- you may found entries like below by "?": > e
+ you may found entries like below by "?": > e
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [225-225]
There's an extra space after the opening parenthesis.
- nmap <buffer><expr> <Plug>(fern-my-open-or-expand)
+ nmap <buffer><expr><Plug>(fern-my-open-or-expand)
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [248-248]
There's an extra space at the beginning of the line.
- fern.vim
+ fern.vim
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [268-268]
The term "String" should not be capitalized unless it's at the beginning of a sentence or part of a title.
- A |String| used as leading space unit (one indentation level.)
+ A |string| used as leading space unit (one indentation level.)
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [287-287]
The term "pre-defeined" is misspelled. It should be "pre-defined".
- to change pre-defeined |highlight|.
+ to change pre-defined |highlight|.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [307-307]
The term "logfile" should be two words: "log file".
- A path |String| to log messages or |v:null| to log messages via |echomsg|.
+ A path |string| to log messages or |v:null| to log messages via |echomsg|.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [335-335]
The term "cursorline" should be two words: "cursor line".
- Set 1 to forcibly disable |cursorline| for the fern window
+ Set 1 to forcibly disable |cursor line| for the fern window
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [426-426]
The term "win_execute" should be two words: "win execute".
- Note that this feature is required the |win_execute| and popup/floatwin features.
+ Note that this feature requires the |win execute| and popup/floatwin features.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [434-434]
There's an extra whitespace before "If disabled".
- Set 1 to disable the drawer tabpage isolation. If disabled, there is only one left or right drawer across all the windows and tabs for a given VIM instance.
+ Set 1 to disable the drawer tabpage isolation. If disabled, there is only one left or right drawer across all the windows and tabs for a given VIM instance.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [445-445]
Don't put a space before the full stop.
- g:fern#disable_drawer_smart_quit = 0
+ g:fern#disable_drawer_smart_quit = 0.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [479-479]
This sentence does not start with an uppercase letter.
- g:fern#disable_drawer_auto_restore_focus = 0
+ G:fern#disable_drawer_auto_restore_focus = 0
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [516-516]
The term "String" should not be capitalized unless it's at the beginning of a sentence or part of a title.
- A default |String| pattern used to filter nodes (include).
+ A default |string| pattern used to filter nodes (include).
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [553-553]
The term "String" should not be capitalized unless it's at the beginning of a sentence or part of a title.
- A |String| which is used as a mark symbol text.
+ A |string| which is used as a mark symbol text.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [588-588]
Use "the" before "the superlative" for grammatical accuracy.
- If {reveal} is specified, parent nodes of the node which is identified
+ If {reveal} is specified, the parent nodes of the node which is identified
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [620-620]
The verb "is" doesn't seem to fit in this context, "are" is probably more formally correct.
- If the {width} is specified, the width of the window is regulated to
+ If the {width} are specified, the width of the window is regulated to
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [662-662]
Is an article like 'a' or 'an' missing?
- If the node is leaf, the {leaf} is returned.
+ If the node is a leaf, the {leaf} is returned.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [689-689]
Use "the" before "the superlative" for grammatical accuracy.
- "anchor" A nearest suitable window from a drawer style fern
+ "anchor" The nearest suitable window from a drawer style fern
I gave it a shot but for some reason it does not work on MacVim. I posted a small video, see below. Screen.Recording.2024-03-16.at.11.20.41.mov |
I didn't recall what the default was, but it seems your CleanShot.2024-03-17.at.19.20.19.mp4Is your desired behavior "Expand the branch node with |
Yes, exactly. For changing dire I have the following mapping:
|
Hectic period... I will try to give it a shot tomorrow. |
Close #496
Summary by CodeRabbit
New Features
Documentation