-
-
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
base: main
Are you sure you want to change the base?
feat: add bulk rename #1113
Changes from 30 commits
7186827
069b328
a2757f8
ce1c2b0
10e0461
0309dab
22e881f
d73bea5
59ded81
426406e
03554c6
ff604c5
8ed4eea
6c9431d
ae0969b
dd804b1
267c9bb
3d8d060
8e4726a
4fad81d
5f20c36
7716a94
ac3a147
8df3fd5
cd17f2e
82428e9
a9c35ec
0cb37cf
78901fd
711f4e3
aa69539
acd9890
cb96f94
5047d30
f021c51
abba9ef
9f70b38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
lazysegtree marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import ( | |
|
|
||
| zoxidelib "github.com/lazysegtree/go-zoxide" | ||
|
|
||
| bulkrename "github.com/yorukot/superfile/src/internal/ui/bulk_rename" | ||
| "github.com/yorukot/superfile/src/internal/ui/metadata" | ||
| "github.com/yorukot/superfile/src/internal/ui/processbar" | ||
| "github.com/yorukot/superfile/src/internal/ui/sidebar" | ||
|
|
@@ -32,15 +33,16 @@ func defaultModelConfig(toggleDotFile, toggleFooter, firstUse bool, | |
| filePreview: preview.New(), | ||
| width: 10, | ||
| }, | ||
| helpMenu: newHelpMenuModal(), | ||
| promptModal: prompt.DefaultModel(prompt.PromptMinHeight, prompt.PromptMinWidth), | ||
| zoxideModal: zoxideui.DefaultModel(zoxideui.ZoxideMinHeight, zoxideui.ZoxideMinWidth, zClient), | ||
| zClient: zClient, | ||
| modelQuitState: notQuitting, | ||
| toggleDotFile: toggleDotFile, | ||
| toggleFooter: toggleFooter, | ||
| firstUse: firstUse, | ||
| hasTrash: common.InitTrash(), | ||
| helpMenu: newHelpMenuModal(), | ||
| promptModal: prompt.DefaultModel(prompt.PromptMinHeight, prompt.PromptMinWidth), | ||
| zoxideModal: zoxideui.DefaultModel(zoxideui.ZoxideMinHeight, zoxideui.ZoxideMinWidth, zClient), | ||
| bulkRenameModel: bulkrename.DefaultModel(25, 80), | ||
|
||
| zClient: zClient, | ||
| modelQuitState: notQuitting, | ||
| toggleDotFile: toggleDotFile, | ||
| toggleFooter: toggleFooter, | ||
| firstUse: firstUse, | ||
| hasTrash: common.InitTrash(), | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,9 +72,6 @@ func (m *model) warnModalForRenaming() tea.Cmd { | |
| return res | ||
| } | ||
|
|
||
| // Rename file where the cusror is located | ||
| // TODO: Fix this. It doesn't do any rename, just opens the rename text input | ||
| // Actual rename happens at confirmRename() in handle_modal.go | ||
lazysegtree marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| func (m *model) panelItemRename() { | ||
| panel := &m.fileModel.filePanels[m.filePanelFocusIndex] | ||
| if len(panel.element) == 0 { | ||
|
|
@@ -100,6 +97,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 { | ||
|
|
||
|
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 |
Uh oh!
There was an error while loading. Please reload this page.