master
bel 2023-11-06 22:07:38 -07:00
parent 72fee73a00
commit 36c5228a6c
1 changed files with 5 additions and 0 deletions

View File

@ -53,10 +53,15 @@ func _edit(filepaths func() []string) error {
for _, editedFile := range editedFiles { for _, editedFile := range editedFiles {
edits[path.Base(editedFile)] = editedFile edits[path.Base(editedFile)] = editedFile
originalFile := func() string { originalFile := func() string {
last := ""
for _, f := range filepaths() { for _, f := range filepaths() {
if path.Base(f) == path.Base(editedFile) { if path.Base(f) == path.Base(editedFile) {
return f return f
} }
last = f
}
if last != "" {
return path.Join(path.Dir(last), path.Base(editedFile))
} }
panic("how?") panic("how?")
}() }()