-
-
Notifications
You must be signed in to change notification settings - Fork 417
feat: add bulk rename #1113
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
Draft
harryfrzz
wants to merge
37
commits into
yorukot:main
Choose a base branch
from
harryfrzz:feature_branch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: add bulk rename #1113
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
7186827
feat: Added basic bulk rename feature
harryfrzz 069b328
Merge branch 'feature_branch' of https://github.com/harryfrzz/superfi…
harryfrzz a2757f8
fix: layout & text-align issues
harryfrzz ce1c2b0
fix: UI whitespace issue
harryfrzz 10e0461
fix: layout issue
harryfrzz 0309dab
chore: refactor code
harryfrzz 22e881f
refactor: clean up comments and improve code readability in bulk rena…
harryfrzz d73bea5
chore: refactor codebase
harryfrzz 59ded81
codescene fix
harryfrzz 426406e
code quality fix
harryfrzz 03554c6
complexity fix
harryfrzz ff604c5
bug-fix
harryfrzz 8ed4eea
bug-fix
harryfrzz 6c9431d
refactor: introduce modalStateChecker for improved modal management
harryfrzz ae0969b
refactor: enhance modal state management with primary and secondary c…
harryfrzz dd804b1
code health fixes
harryfrzz 267c9bb
Merge branch 'yorukot:main' into feature_branch
harryfrzz 3d8d060
fix: update text-based cursor to common Icon based cursor
harryfrzz 8e4726a
fix: Changed preview file alignment, hotkey configuration
harryfrzz 4fad81d
Merge branch 'yorukot:main' into feature_branch
harryfrzz 5f20c36
chore: refactor codebase, stable UI design & other fixes
harryfrzz 7716a94
refactor: code complexity & hotkey fix
harryfrzz ac3a147
chore: refactor codebase to remove `slop` & code duplication, added v…
harryfrzz 8df3fd5
chore: refactor codebase to remove slop & code duplication, added vim…
harryfrzz cd17f2e
Fix formatting of rename hotkey entry
harryfrzz 82428e9
chore: refractor unit testing file
harryfrzz a9c35ec
Merge branch 'feature_branch' of https://github.com/harryfrzz/superfi…
harryfrzz 0cb37cf
chore: fixed tests issues, multiple bools in structs, UI width issues…
harryfrzz 78901fd
chore: fixed performance issues when renaming 1000-10k files, fixed m…
harryfrzz 711f4e3
chore: fixed modal width & height issue
harryfrzz aa69539
chore: migrated navigation & types to new file
harryfrzz acd9890
chore: refractor code to fix `gofmt` issue, hardcoded values changed …
harryfrzz cb96f94
fix: Move common implementation to common.ResolveEditor
lazysegtree 5047d30
add hotkey
lazysegtree f021c51
fix: reuse bulk rename text inputs
lazysegtree abba9ef
comment fix 1
lazysegtree 9f70b38
remove temp files
lazysegtree File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package common | ||
|
|
||
| import ( | ||
| "os" | ||
| "runtime" | ||
|
|
||
| "github.com/yorukot/superfile/src/internal/utils" | ||
| ) | ||
|
|
||
| // ResolveEditor returns the command used to open files in an editor. | ||
| // Priority: Config.Editor → $EDITOR → OS fallback (non-empty result guaranteed). | ||
| func ResolveEditor() string { | ||
| if Config.Editor != "" { | ||
| return Config.Editor | ||
| } | ||
| if envEditor := os.Getenv("EDITOR"); envEditor != "" { | ||
| return envEditor | ||
| } | ||
| if runtime.GOOS == utils.OsWindows { | ||
| return "notepad" | ||
| } | ||
| return "nano" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lazysegtree marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,6 +100,17 @@ func (m *model) panelItemRename() { | |
| panel.rename = common.GenerateRenameTextInput(m.fileModel.width-4, cursorPos, panel.element[panel.cursor].name) | ||
| } | ||
|
|
||
| func (m *model) panelBulkRename() { | ||
| panel := &m.fileModel.filePanels[m.filePanelFocusIndex] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. M2 - use |
||
|
|
||
| if panel.panelMode != selectMode || len(panel.selected) == 0 { | ||
| return | ||
| } | ||
|
|
||
| m.bulkRenameModel.Open(panel.selected, panel.location) | ||
| m.firstTextInput = true | ||
| } | ||
|
|
||
| func (m *model) getDeleteCmd(permDelete bool) tea.Cmd { | ||
| panel := m.getFocusedFilePanel() | ||
| if len(panel.element) == 0 { | ||
|
|
@@ -444,19 +455,7 @@ func (m *model) openFileWithEditor() tea.Cmd { | |
| slog.Error("Error while writing to chooser file, continuing with open via file editor", "error", err) | ||
| } | ||
|
|
||
| editor := common.Config.Editor | ||
| if editor == "" { | ||
| editor = os.Getenv("EDITOR") | ||
| } | ||
|
|
||
| // Make sure there is an editor | ||
| if editor == "" { | ||
| if runtime.GOOS == utils.OsWindows { | ||
| editor = "notepad" | ||
| } else { | ||
| editor = "nano" | ||
| } | ||
| } | ||
| editor := common.ResolveEditor() | ||
|
|
||
| // Split the editor command into command and arguments | ||
| parts := strings.Fields(editor) | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. M1 - Need to check if the refactoring broke anything |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.