Disable sublime text file-reload dialog - file

Is there a way to disable sublime text file reload dialog from popping up when the content of the current file has changed due to some modifications(modification + save from another text editor).
sublime text file reload dialog is this:
Thank you for your suggestions.

As far as I know, Sublime will prompt only if the file has unsaved changes by default.
If you get a prompt even if the file hasn't been modified, you could set always_prompt_for_file_reload to false in your user settings.
// Always prompt before reloading a file, even if the file hasn't been
// modified. The default behavior is to automatically reload a file if it
// hasn't been edited. If a file has unsaved changes, a prompt will always
// be shown.
"always_prompt_for_file_reload": false

Related

Stop undo() from clearing everything in the editor Quill / QuillJS?

I created a way to save Quill text to a database. Every time a user clicks on a saved document, it pulls the saved Quill text from the database and has the text appear within the Quill text editor. At this point, if I trigger the undo function, it will delete ALL the text pulled from the database, so the page is blank.
I think what is happening is that the Quill editor sees the pulled up text from the database as a paste into the text editor, so when you trigger the undo function, it clears the "paste/pull from the database".
Is there a way to stop this from happening? Is there a way to make quill NOT clear everything when you trigger the undo function right after pulling the initial text from the database?
When you "load" the content from the database into the editor, whether you like it or not, you are changing whats inside Quill Delta (the data). Any kind of change made to Quill's content is viewed by itself as... well... a change made, therefore, something that can be undone.
[...] Every time a user clicks on a saved document, it pulls the saved
Quill text from the database and has the text appear within the Quill
text editor. At this point, if I trigger the undo function, it will
delete ALL the text pulled from the database, so the page is blank.
[...] Is there a way to stop this from happening? Is there a way to
make quill NOT clear everything when you trigger the undo function
right after pulling the initial text from the database?
Since you just added content to Quill and there is no interest in worrying about any changes you made previously, I suggest you take a look at this. Basically, the idea is:
Get the content.
Add the same to the editor.
After the addition has been made, call the following code:
quill.history.clear();
After that, when trying to perform an undo operation, nothing will happen as no history has been stored.
When creating Quill object, set history config in your modules. For example:
var quill = new Quill('#editor', {
modules: {
history: {
delay: 2000,
maxStack: 500,
userOnly: true
}
},
theme: 'snow'
});
The "userOnly" config will filter out programatically value changes.
https://quilljs.com/docs/modules/history/#useronly

Change the default value of the "Startup directory for new process" in the "Create new console" dialog

How do we change the default value for the Startup directory for new process? Out of the box the default is my user directory C:\Users\bigfo.
My current workaround is to change the {Bash::bash} task so that it overrides whatever is in the Create new console dialog. I do that like this:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt -new_console:d:C:\dev
What I would really like, though, is for the Create new console dialog to look like this:
conemu & cmder default startup locations:
there are actually two answers for this question depending on what you
really want to do. i will list both:
the global default startup path
for all tasks this is set at launch time from the cli or, more commonly, the
windows startup link from the start menu or taskbar. in either case,
you can edit this from the default, which is typically set to the install
folder.
if changing a start menu link, begin at the desktop, press oskey to bring
up the start menu. assuming cortana is active, you can simply search for
cmder by typing it out. if not, you will have to scroll down to find your
link to cmder or conemu.
right-click on the icon, select open file location from the context menu.
after windows explorer opens, the shortcut to the program will be
highlighted. right-click this shortcut and select properties from the context
menu.
note: it is possible that the application location rather than a
shortcut will be highlighted. if it is an application, right-click the
program and select pin to taskbar from the context menu. then skip down
to the part about setting the taskbar shortcut default folder.
it is also possible to select pin to start menu but this method requires
that you then navigate to
\programdata\microsoft\windows\start menu\programs\ and edit the
shortcut. otherwise, the process will be identical to the taskbar step.
the first page/general options in properties will have the path to the
program first, and the startup folder second. simply change the startup
location to your desired path (typically c:\users\<yourname>).
video of process:
The per-task method (override the global default):
NOTE: this is if you want a specific task or several specific tasks to open in
a place other than the global default.
If Cmder/ConEmu is not running, start it.
From within any terminal, press winkey+alt+p to open the settings.
In settings on the left side nested tree navigation locate to
Startup->Tasks.
Scroll down to find the task you wish to edit.
In the large edit box, place the input cursor at the end and press the
Startup dir... button to add the startup location CLI option to the
startup command for this task.
Navigate to the folder you wish to start the application in. If it's not
something you can navigate to, simply select any folder and edit it after
you're done in the launch command.
Video:

How to modify Centos 5.5 default open command

In Centos 5.5, each time I double click a file named "*.pl" in File Browser, it open a new emacs editor instance.
I want Emacs to run in a single instance way, so I need to modify the open command to "emacsclient %f", but I don't know where and how to modify the configuration.
Easiest way to do this is:
1. Find a .pl file on your desktop or in the File Browser (nautilus)
2. Right click it, select Properties
3. Pick "Open With" tab
4. If you don't see emacsclient, press the add button
a. Can check the list in Add Application dialog for emacsclient
I) If absent, click Use a custom command and browse or enter the path
to the emacsclient executable (mine is at /usr/local/bin/emacsclient).
b. Select emacsclient in the list
c. Press the Add button
5. Make sure the radiobutton is selected for emacsclient in the "Open With"
dialog
6. Press the close button.

Powershell: How to open a file from a separate window

I'm using PowerShell for about a week now. I am able to open a specific URL and fill in my username and password automatically. I can also navigate to a certain page where multiple files can be found to download.
I use the following command to select a certain file to download:
$ie.navigate2('http://www.example.com/resource.aspx?ResourceID=GetDocStoreFile&EntryID=1234')
What happens next is that a second window will open, named "file download". There are three buttons: open, save and close.
I don't want to press the "open" button manually, but would like the script to do that for me and then goes back to the original window to select another file. Any suggestions?
If you use a download URL, I don't think you can interact directly with IE using the COM object, because there's no document. Once the dialog box opens, all of the object's properties become null. You can use the method I posted here: How to perform keystroke inside powershell? AppActivate will work to activate a dialog box by title.
The % represents the the ALT key, so if the underlined letter of the button you want to click is O, you'd invoke SendKeys like this:
$wshell.SendKeys('%O')

how to open a file and edit it in wpf

Hi
I have a textbox and a button named browser. When I click the browser button, my program uses the Microsoft.Win32.OpenFileDialog to display the file name I selected on the textbox. If I want to add one more button named open, when I click open button, the above file could be opened. No matter it's a *.cs file, *.txt or *.xml. Is this possible?
I try to use OpenFileDialog.OpenFile(), doesn't work. Thanks!
You can use System.Diagnostics.Process.Start it will use whatever is your default program to open the file, like this:
System.Diagnostics.Process.Start(filePath);

Resources