Add entry refresh feature; fix ClampTrailingWhitespace ignoring the initial trim

This commit is contained in:
2025-05-31 21:48:11 +00:00
parent 5666974a7f
commit ca277ba773
4 changed files with 71 additions and 13 deletions
+3 -3
View File
@@ -13,16 +13,16 @@ func GetOldEntryData(targetLocation string, field int) ([]string, error) {
back.TargetIsFile(targetLocation, true, 2)
// read old entry data
unencryptedEntry, err := crypt.DecryptFileToSlice(targetLocation)
decryptedEntry, err := crypt.DecryptFileToSlice(targetLocation)
if err != nil {
return nil, errors.New("unable to decrypt entry: " + err.Error())
}
// return the old entry data with all required lines present
if field > 0 {
return ensureSliceLength(unencryptedEntry, field), nil
return ensureSliceLength(decryptedEntry, field), nil
} else {
return unencryptedEntry, nil
return decryptedEntry, nil
}
}