+TC 8.50b11-FTP & Sublime Text 3

Bug reports will be moved here when the described bug has been fixed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
gpa_76
Junior Member
Junior Member
Posts: 4
Joined: 2013-12-01, 13:22 UTC

+TC 8.50b11-FTP & Sublime Text 3

Post by *gpa_76 »

There is a problem with editing files through FTP of Total Commander 8.50b11 by Sublime Text 3.
I use Sublime Text 3 as a default editor by F4 button. And I use a new option "Plugins/FTP: Automatically re-upload changed files". So TC do not re-upload changed files by Sublime Text 3. But, for example, with Notepad++ everything is fine.
Without this new options everything is fine, but TC is still asking a question to replace file on FTP.
User avatar
white
Power Member
Power Member
Posts: 5815
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC 8.50b11-FTP & Sublime Text 3

Post by *white »

gpa_76 wrote: I use Sublime Text 3 as a default editor by F4 button. And I use a new option "Plugins/FTP: Automatically re-upload changed files". So TC do not re-upload changed files by Sublime Text 3.
Can you copy the file while it is opened in Sublime Text 3?
gpa_76
Junior Member
Junior Member
Posts: 4
Joined: 2013-12-01, 13:22 UTC

Post by *gpa_76 »

Yes, I can.
I open the file from the server, edit it, press Ctrl+S and check with another editor. My changes are in the file in Temp directory. I close Sublime Text but nothing happend. File in FTP is still old.
gpa_76
Junior Member
Junior Member
Posts: 4
Joined: 2013-12-01, 13:22 UTC

Post by *gpa_76 »

I've tried to open file by ST3 edit it, save. Then without closing ST I've opened this file from the Temp folder by Notepad++ and changed it once again. Then I pressed Ctrl+S in Notepad++ file in a moment re-uploaded to FTP, with the changes made by ST3 and Notepad++.
So I think, ST3 do not make some trigger while saving a file, instead of Notepad++. But both of them save their changes into the file.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC relies on notifications from ReadDirectoryChangesW to be informed when a temporary file is changed. It's possible that sublime text uses a different name to save the file, e.g. the 8.3 name, or some low level functions which do not trigger the ReadDirectoryChangesW notification. Then TC cannot know that the file was changed.

Solution: Either turn off auto re-upload, or use a different editor.
Author of Total Commander
https://www.ghisler.com
gpa_76
Junior Member
Junior Member
Posts: 4
Joined: 2013-12-01, 13:22 UTC

Post by *gpa_76 »

Sad. TC+ST3 these things I use for 80% time of my work...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It seems to be a problem with Sublime Text 3 only - I just installed version 2 and version 3 beta, and only version 3 has this problem.

The name reported by watchdirs has a strange string appended:
0\subdir\originalname.txt~RFb2b812b.TMP

So what seems to happen is that Sublime Text 3 saves the file under a different name, and then deletes the original and renames the new file to the old name. So far TC was not watching rename operations in temp, so it never saw the original name. Watching for FILE_NOTIFY_CHANGE_FILE_NAME seems to fix the problem.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Can anyone try this with beta 12, please?
Author of Total Commander
https://www.ghisler.com
User avatar
Bluestar
Senior Member
Senior Member
Posts: 388
Joined: 2007-06-10, 15:26 UTC
Location: Hungary
Contact:

Post by *Bluestar »

Code: Select all

"C:\Program Files (x86)\Sublime Text 3\sublime_text.exe" "%1"
After defining the above string as external (F4) editor, the auto-reupload function works fine for me using x64 version of TC 8.5B15.
» Developer of Total Updater & extDir utility.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Great, thanks for trying it!
Author of Total Commander
https://www.ghisler.com
Post Reply