Skip to content

Commit e8209db

Browse files
committed
Fix first item not showing when trying to restore with --cur
1 parent d4c6b84 commit e8209db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/nrash_restore.nim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ proc restoreFile(filePath: string, kind: PathComponent) =
3434
moveFile(TRASH_FILES_PATH & chosenFileName, originalPath)
3535
removeFile(infoFile)
3636

37-
echo &"Restored {chosenFileName}!"
37+
echo &"Restored {chosenFileName} to {originalPath}!"
3838
except OSError: # if original file path does not exist
3939
let allPaths: seq[string] = originalPath.split("/")
4040

@@ -83,6 +83,7 @@ proc main() =
8383
let info: Option[tuple[originalPath: string, deleteDate: string]] = getTrashFileInfo((fileCount, path, kind), false)
8484
if isSome(info):
8585
if startsWith(get(info).originalPath, getCurrentDir()):
86+
echo path
8687
allFileDetails.add((fileCount, path, kind))
8788
viewableFiles += 1
8889
else:
@@ -93,7 +94,7 @@ proc main() =
9394
noFlags = true
9495

9596
if noFlags:
96-
var fileNum: int = 1
97+
var fileNum: int = 0
9798

9899
while fileNum < viewableFiles:
99100
var file = allFileDetails[fileNum]

0 commit comments

Comments
 (0)