Changesets · Branches · Tags · Compare
| Changeset | ae0f6b584d4fef45a7e899e1f58ce7d5a75fd528ebc65b0c0b4d325b5a863cd2 |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-09-09 22:37 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-09-09 22:37 -07:00 |
| Parents | b7c96fb1b25b |
1 file changed
modified gui/src/util/clientTools/editImpl.ts +13 −1
| @@ -12,10 +12,22 @@ | ||
| 12 | 12 | "`filepath` and `changes` arguments are required to edit an existing file.", |
| 13 | 13 | ); |
| 14 | 14 | } |
| 15 | - const firstUriMatch = await resolveRelativePathInDir( | |
| 15 | + | |
| 16 | + const openFiles = await extras.ideMessenger.ide.getOpenFiles(); | |
| 17 | + let firstUriMatch = await resolveRelativePathInDir( | |
| 16 | 18 | args.filepath, |
| 17 | 19 | extras.ideMessenger.ide, |
| 18 | 20 | ); |
| 21 | + | |
| 22 | + if (!firstUriMatch) { | |
| 23 | + for (const uri of openFiles) { | |
| 24 | + if (uri.endsWith(args.filepath)) { | |
| 25 | + firstUriMatch = uri; | |
| 26 | + break; | |
| 27 | + } | |
| 28 | + } | |
| 29 | + } | |
| 30 | + | |
| 19 | 31 | if (!firstUriMatch) { |
| 20 | 32 | throw new Error(`${args.filepath} does not exist`); |
| 21 | 33 | } |