Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/lib/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,17 @@ export default {
if (uri) {
const fs = fsOperation(uri);
try {
const newUri = await fs.renameTo(newname);
let newUri;
if (uri.startsWith("content://com.termux.documents/tree/")) {
// Special handling for Termux content files
const newFilePath = Url.join(Url.dirname(url), newname);
const content = await fs.readFile();
await fsOperation(Url.dirname(url)).createFile(newname, content);
await fs.delete();
newUrl = newFilePath;
} else {
newUri = await fs.renameTo(newname);
}
const stat = await fsOperation(newUri).stat();

newname = stat.name;
Expand Down