You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "scholarsmate (via GitHub)" <gi...@apache.org> on 2023/03/20 16:49:08 UTC

[GitHub] [daffodil-vscode] scholarsmate commented on a diff in pull request #502: fix save over original file (fixes #501)

scholarsmate commented on code in PR #502:
URL: https://github.com/apache/daffodil-vscode/pull/502#discussion_r1142421280


##########
src/omega_edit/dataEditWebView.ts:
##########
@@ -334,25 +304,17 @@ export class DataEditWebView implements vscode.Disposable {
           })
           .then(async (uri) => {
             if (uri && uri.fsPath) {
-              if (uri.path === this.fileToEdit) {
-                await this.saveSession(this.omegaSessionId, true).catch(() => {
-                  vscode.window.showErrorMessage('Failed to save')
+              await omegaEditSession
+                .saveSession(this.omegaSessionId, uri.path, true)
+                .then(async (fp) => {
+                  vscode.window.showInformationMessage(`Saved to file: ${fp}`)

Review Comment:
   It does.  It has to, because if you set overwrite to `false`, and give it a file path that exists, a new file path will be generated in Ωedit and returned.  You can search for `save` in the C API documentation for more (see: https://ctc-oss.github.io/omega-edit/index.html).  Also testing shows this is the case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org