by Mofi » Wed Mar 31, 2010 1:08 am
I hope, the text editor UltraEdit will never become file managing capabilities including even simply ones like copy and move. UltraEdit is and should be a text editor and not a file manager. I'm quite sure that when UltraEdit supports ever copying, moving and deleting of files, the next user wants also support for creating directories to be able to copy or move files into not yet existing directories and then the next users surely start requesting more and more special file managing features with the result of wanting a Windows version dependent Windows Explorer inside UltraEdit with FTP / SFTP support. Therefore I hope that UltraEdit will never come with file managing commands.
You can write a script which saves all open files into a new directory you enter into a getString() dialog. That would result in copying the files to a new directory with keeping the bookmarks. The script has to remember the full path of all opened files in a string array before saving them into a different directory using saveAs() command. Furthermore you would need to configure a user tool containing with the command line del "%sel%". After saving all opened files into a new directory, the script would need to temporarily open a new file and run a loop in which one file name after the other is written into this new file, reselected by using selectToTop() and calling the user tool to delete the file. The problem is that the bookmark data for the not anymore existing files are still stored forever in uedit32.ini.
Another solution would be to move the files with your favorite file manager and replace the path of the moved files in %appdata%\IDMComp\UltraEdit\uedit32.ini while UltraEdit is not running for example with Notepad.
Well, that uedit32.ini contains data for not existing files is a general problem when using saving of bookmarks, saving of code foldings and now with UE v16.00 the line change indicator visibility setting (section [LCI]). Those features have the potential to let the INI file increase and increase and increase making startup of UltraEdit slower and slower and slower. Currently there is only one possibility to avoid this, delete the not needed anymore data in the INI file manually.
I suggested IDM to save the line change indicator visibility state setting in the Open Files section and therefore remember it only for opened files on closing UltraEdit (or a project) and not for all files ever opened in UltraEdit. But IDM replied that the users which wanted that feature want the setting remembered on a per file base which is bad for users like me using UEStudio for projects and UltraEdit for general text editing on hundreds of different text files, most of them not longer existing on hard disk than 24 hours (or even a few minutes). I also mentioned that clearing history to save privacy is useless when section [LCI] contains a complete history of all files ever opened.
IDM suggested to delete with the Clear History button in the configuration dialog (Toolbars / Menus - Miscellaneous) also entire section [LCI] and this is done since UE v16.00.0.1036. Using configuration setting Clear recent document/project and search/replace histories on exit has the same affect. Code folding and bookmark data are surely not included in history clearing process.
I will suggest IDM to implement a button anywhere which can be pressed by the user to test if all files (except files opened via FTP) saved in the bookmarks or code folding data section in uedit32.ini or the workspace file of the current project still exist, and delete the data of not existing files. The problem here are files with UNC paths stored on servers not available at the moment because of the long network timeouts which can result in needing several minutes before this process can finish when not good implemented.
BTW: I have a batch file on my laptop which maps network drives. The problem is that I use this laptop at work and at home. Therefore I needed a solution to quickly find out in which computers (servers, just other computers) are available in the current LAN if a LAN connection exists at all. My solution:
%systemroot%\system32\ping.exe -n 1 computername1 >nul
if errorlevel 1 goto !Comp2
net use drive letter: \\computername1\share /persistent:no
net use drive letter: \\computername1\share /persistent:no
net use drive letter: \\computername1\share /persistent:no
:!Comp2
%systemroot%\system32\ping.exe -n 1 computername2 >nul
if errorlevel 1 goto !Comp3
and so on
Using ping command to find out if a server exists avoids the long network timeouts.