Skip to content

Commit

Permalink
Touch parent folder on file modification
Browse files Browse the repository at this point in the history
  • Loading branch information
elyahw committed Sep 21, 2024
1 parent 169664f commit c83e582
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,11 @@ public boolean saveDocument(final boolean forceSaveEmpty) {
// Document is written iff writeable && content has changed
final CharSequence text = _hlEditor.getText();
if (!_document.isContentSame(text)) {
// Touch parent folder on edit
File current_parent_folder = _document.file.getAbsoluteFile().getParentFile();
long currentTime = System.currentTimeMillis();
current_parent_folder.setLastModified(currentTime);

final int minLength = GsContextUtils.TEXTFILE_OVERWRITE_MIN_TEXT_LENGTH;
if (!forceSaveEmpty && text != null && text.length() < minLength) {
final String message = activity.getString(R.string.wont_save_min_length, minLength);
Expand Down

0 comments on commit c83e582

Please sign in to comment.