VS code new update doesn't retain opened file (tabs) when switching/opening another file - ide

Early February VS Code update seemed to have messed my entire IDE settings.
Version: 1.42.0
When I open a file and switch or drag another file to the main working area the previous one just closes even if I double click on the tab to retain the opened file
The only property which could potentially help is workbench.editor.enablePreview
What do I do to revert that so that I can have multiple tabs/files open again?

Modify the following property in order to retain opened files
workbench.editor.showTabs
Check the checkbox

Related

IntelliJ IDEA current file tab closes on opening a different file

Every time I open a new file (single click), the existing file closes by itself. It started happening in the latest version. How do I fix this?
In the Project tool window, click the three vertical dots and uncheck Enable Preview Tab option (which is on by default)

How do I open a file with a specific application rather than its default application?

I am trying to open files using a specified executable; just like as if you were to right mouse click on a file then scroll to "Open with"
I tried what kaymaf said and reviewed the docs, but I cannot seem to get this to work.
Dim FI As New FileInfo(GetFileNameFromListViewItem(ListViewCollection.SelectedItems(0)))
Dim GetExif As Process = System.Diagnostics.Process.Start("C:\Users\*username*\Downloads\exiftool.exe", FI.FullName)
This just ends up open the executable and rather than opening the file with the executable.
You would like to open a file with your program using the Windows context menu; and do you want to get an entry in that menu? If that is not correct, the answer can be deleted.
I found this in a German forum, and they refer to this site:
This is the translated text:
One possibility would be that you register your file extension and your program in the system to open this file extension. As soon as the system knows everything, you only need to right-click on the file(s) and in the context menu, in addition to the standard entries, another menu item for opening these files is displayed. If you select this menu item, your program will start automatically if it has not yet started, and you can read out / determine the path to this file or several files in your program and process it accordingly. How it all works is described here: ookii.org/Blog/opening_files_via_idroptarget_in_net
On this page there is also a sample for download (start text files with your own program via an additional entry in the context menu / display paths to the files). It is not a VB, but it should be translatable without any problems. Corresponding information on the page and the comments should be observed.

SWT DirectoryDialog - get last selected folder

I'm using the org.eclipse.swt.widgets.DirectoryDialog for folder selection. I'm not setting the filter path and I notice the the dialog somehow remembers the last selection. When I select a folder, and then reopen the dialog - it points to the last selected folder.
My question is - can I get this "remembered" last selected folder somehow in SWT or plain Java?
Thanks!
Dinko
No there is nothing for this.
DirectoryDialog is just a thin wrapper around the native open directory dialog. It is the native dialog that is remembering (if it does, this may vary on different platforms).
Looking at the macOS version of DirectoryDialog there is nothing in the Java code that knows about the previous selection.

IntelliJ - not asking if I want to save a file

I'm new to the IntelliJ IDE. In the past I was working with Visual Studio or Eclipse.
In those IDEs there was an asterisk * above the name of the file which has been modified.
But in IntelliJ with the default configuration I can't see if the file is modified. What's more the file is saved automatically when I change focus to another window.
I've found some options under Settings -> IDE Settings -> General -> Synchronization:
Synchronize files on frame activation
Save files on frame deactivation
Save files automatically if application is idle for...
After unchecking all that options the file is not saved automatically every time I change focus to another window, which is good. But still I can't:
see if the file is modified (no asterisk)
decide if the file should be saved when I'm closing it (IDE doesn't ask for that)
And when I'm closing IntelliJ file which has been modified is saved without even noticing.
Do you know what can I do to change how IntelliJ behaves?
After unchecking mentioned options go to:
Settings/Editor(IDE Settings)/Editor Tabs:
Check "Mark modified tabs with asterisk"
On 2019.3 Ultimate it's under:
Settings/Editor/General/Editor Tabs:
Mark modified (*)
The exact Save feature like eclipse is not available in IntelliJ.
Because IntelliJ IDEA has the ability to change so many files
simultaneously in large refactoring actions, and change them without
ever opening them, single file saves don't make very much sense. In
recognition of this, IntelliJ IDEA reserves the right to save any of
your files literally whenever it wishes. It's actually quite nice to
never have to worry about your file's save statuses, once you get used
to it.
"What if I don't like some changes I made, and want to roll them
back?", I hear you say. Well, for that IntelliJ IDEA includes this
amazing feature called the Local History. Every time it saves your
files, IntelliJ IDEA actually saves a diff of your file from it's
previous state, and saves that as well. You can see the entire edit
history of your files (going back some number of days), see the
changes you've made, and roll back any change. It rules triumphantly,
and more than makes up for the temporary disorientation caused by lack
of single-file save.
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206336279/comments/207351939
To show an asterisk when a file is modified: open Settings (CTRL+ALT+S), switch to Editor > General > Editor Tabs and select the Mark modified tab with asterisk checkbox.
To remove autosave, uncheck: Appearance & Behavior > System Settings > Save files on frame deactivation

VB.NET: Detect if a text file is open

Is there any way to determine if a text file is currently open in a text editor? Or better yet, is there a way to trigger an event when a text file is opened (from any program)?
Using the FileSystemWatcher component you can detect Changed, Created, Deleted, and Renamed events statically.
If you want to detect Last Access you need to manually set the NotifyFilter to include LastAccess.
When most editors have a file open they typically follow a set strategy:
1. Open File
2.Read entire contents into buffer
3.Close File
Then your program runs. Since the file is already closed, any attempts to open it will of course succeed. Using a FileSystemWatcher this can be detected if a file is open or closed. However, you will not be able to detect if the file has been open prior to your program running.
I think I'll make a Timer that checks the last modified time of the file.... and when the program starts, it'll get the last modified time.