As default editor for other programs: how to load a file in sync?
As default editor for other programs: how to load a file in sync?
Example:
I have a ZIP unarchiver/browser tool, which allows me to edit text file directly from an external editor, and save it back to the ZIP archive (on file close, after editing, the ZIP tool will ask me: "The file has been changed. Do you want to update the archive contents?"). This works fine with Notepad.exe.
But what if I want to use CudaText? As far as I can see it loads the file "in async mode" loosing file lock... so the above ZIP tool won't notice the changes in the temp file...
Is there a quick solution?
I have a ZIP unarchiver/browser tool, which allows me to edit text file directly from an external editor, and save it back to the ZIP archive (on file close, after editing, the ZIP tool will ask me: "The file has been changed. Do you want to update the archive contents?"). This works fine with Notepad.exe.
But what if I want to use CudaText? As far as I can see it loads the file "in async mode" loosing file lock... so the above ZIP tool won't notice the changes in the temp file...
Is there a quick solution?
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: As default editor for other programs: how to load a file in sync?
What is 'in async mode'?
no, Cud loads file normally, as I know.
The DoubleCommander can call external editor from Zip. and then it detects that file's date/time is changed.
works OK with Cud.
no, Cud loads file normally, as I know.
The DoubleCommander can call external editor from Zip. and then it detects that file's date/time is changed.
works OK with Cud.
Re: As default editor for other programs: how to load a file in sync?
I have some problems with Cudatext and BandZip...
Oh, I've just found it works as expected if it's the only tab open in Cudatext... but if you have already open multiple tabs BandiZip fails to detect changes:
1. CudaText is already open with multiple tabs...
2. BandiZip runs as external editor cudatext.exe
3. so BandiZip opens another tab in Cudatext to edit selected file from the zip file...
4. after editing and closing the tab or the whole CudaText task (with the other tabs still open), BandiZip won't detect the changed file (??)
It seems I have to close ALL Cudatext tabs and then quit the main window to make BandiZip detect changes...
With new notepad in Win11 even on closing the single tab used for editing works fine and BandiZip is able to detect changes.
Oh, I've just found it works as expected if it's the only tab open in Cudatext... but if you have already open multiple tabs BandiZip fails to detect changes:
1. CudaText is already open with multiple tabs...
2. BandiZip runs as external editor cudatext.exe
3. so BandiZip opens another tab in Cudatext to edit selected file from the zip file...
4. after editing and closing the tab or the whole CudaText task (with the other tabs still open), BandiZip won't detect the changed file (??)
It seems I have to close ALL Cudatext tabs and then quit the main window to make BandiZip detect changes...
With new notepad in Win11 even on closing the single tab used for editing works fine and BandiZip is able to detect changes.
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: As default editor for other programs: how to load a file in sync?
Option must help here:
"ui_one_instance": false,
(in user.json)
Because with _single_ instance, BandiZip sees that 2nd Cud instance closes fast, and it thinks that editor (2nd instance) did not change anything.
maybe you can ask BandiZip author to detect file change _by timestamp_ instead of 'process ended'.
"ui_one_instance": false,
(in user.json)
Because with _single_ instance, BandiZip sees that 2nd Cud instance closes fast, and it thinks that editor (2nd instance) did not change anything.
maybe you can ask BandiZip author to detect file change _by timestamp_ instead of 'process ended'.
Re: As default editor for other programs: how to load a file in sync?
"ui_one_instance": false,
didn't help unfortunately (still have to close all other tabs or BandiZip will ignore text changes on closing CudaText).
Asked in the official forum in the meanwhile: https://groups.google.com/g/bandizip-win/c/PkXc0usAyL4
didn't help unfortunately (still have to close all other tabs or BandiZip will ignore text changes on closing CudaText).
Asked in the official forum in the meanwhile: https://groups.google.com/g/bandizip-win/c/PkXc0usAyL4
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: As default editor for other programs: how to load a file in sync?
i hope you restarted all Cud instances after setting option to False.
Re: As default editor for other programs: how to load a file in sync?
It works with False (will open a second instance of CudaText with the file from ZIP), but I have to close the whole task (closing the single tab for this new instance is not enough) to make BZ detect changes... Mmmh, it seems there is no optimal solution. BZ author also explains BZ gets fooled by the fact the new instance of CudaText will actually redirect the file to the other CudaText open task, and then closes itself ("ui_one_instance": true, as default). He also adds that timestamp change isn't reliable as well so won't change it...
BTW, why notepad.exe works as expected instead? Closing the new tab will immediately notify BandiZip. Does it run in a separate task each tab with new notepad.exe? Maybe this could be a feature request for future CudaText...
BTW, why notepad.exe works as expected instead? Closing the new tab will immediately notify BandiZip. Does it run in a separate task each tab with new notepad.exe? Maybe this could be a feature request for future CudaText...
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: As default editor for other programs: how to load a file in sync?
I don't know how notepad.exe makes this. So i cannot mimic it. So feature request cannot be made (yet).
Maybe you can see running processes list ("Task Manager" app, AFAIR).
Maybe you can see running processes list ("Task Manager" app, AFAIR).
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: As default editor for other programs: how to load a file in sync?
BTW, command line option exist to run Cud always as new instance.
it may be useful in this usecase. If BZ allows to write it to config.
Code: Select all
-n - Ignore option "ui_one_instance", open new app window
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: As default editor for other programs: how to load a file in sync?
These cmd-line options are good too:
Code: Select all
-nh - Ignore saved file history
-nsl - No session loading on start
-nss - No session saving on exit