notepad-plus-plus icon indicating copy to clipboard operation
notepad-plus-plus copied to clipboard

[Feature request] Allow to launch the FileOpen / FileSave dialog in a standard directory

Open fml2 opened this issue 1 month ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Description of the Issue

This issue stems from the discussion on the forum: https://community.notepad-plus-plus.org/topic/27270/set-current-directory-to-default-if-no-real-file-is-open

For untitled tabs, I'd like to be able to launch the "Open File" or "Save File" dialog in a standard directory -- regardless of the directory of the last active real file.

This should allow for me to better handle the following situation:

  1. The setting "Default Open/Save file Directory" is set to "Follow current document"
  2. I have a tab with new contents (not yet saved as a file)
  3. In another tab, I have a file from a network folder, which is the active tab now.
  4. I close the tab with the network file. Only the untitled tab remains
  5. Now I want to save this untitled tab to a "standard" folder. The standard folder is the one used after Notepad++ is started without any files. It's "Desktop" for me.

As of now, when I press Ctrl+S in the step 5, the dialog opens in the network directory. I'd like it to open in the "Standard" directory. But this should only be for untitled tabs. For real files, the dialog should still open in the directory of the file.

Describe the solution you'd like.

Maybe another command to launch the Open/Save dialog in a standard directory (which could be configurable via settings, but not necessarily).

Debug Information

Notepad++ v8.8.8   (64-bit)
Build time: Nov 16 2025 - 20:55:01
Scintilla/Lexilla included: 5.5.7/5.4.5
Boost Regex included: 1_85
Path: C:\Program Files\Notepad++\notepad++.exe
Command Line: CustomFileDialog.cpp
Admin mode: OFF
Local Conf mode: OFF
Cloud Config: OFF
Periodic Backup: ON
Placeholders: OFF
Scintilla Rendering Mode: SC_TECHNOLOGY_DIRECTWRITE (1)
Multi-instance Mode: monoInst
asNotepad: OFF
File Status Auto-Detection: cdEnabledNew (for current file/tab only)
Dark Mode: OFF
Display Info:
    primary monitor: 1920x1080, scaling 150%
    visible monitors count: 1
    installed Display Class adapters: 
        0000: Description - Intel(R) HD Graphics 620
        0000: DriverVersion - 31.0.101.2111
        0001: Description - Intel(R) UHD Graphics 620
        0001: DriverVersion - 31.0.101.1999
        0002: Description - Intel(R) HD Graphics 630
        0002: DriverVersion - 31.0.101.2130
OS Name: Windows 10 Pro (64-bit)
OS Version: 22H2
OS Build: 19045.6456
Current ANSI codepage: 1252
Plugins: 
    DSpellCheck (1.5)
    HexEditor (0.9.12)
    mimeTools (3.1)
    NppConverter (4.7)
    NppExport (0.4)
    PythonScript (2)

Anything else?

Disclaimer: I also submitted this as an issue in the Python Script plugin for the case that this feature is better implemented in a plugin and not in the "main" Notepad++.

fml2 avatar Nov 28 '25 20:11 fml2

@fml2:

What would you and others think of this idea?

At Settings | Preferences... | Default Directory, indented beneath the bottom radio button (where you can specify a default directory), add a checkbox labeled Apply only to Open/Save on new tabs; otherwise follow current document.

The behavior when that box is checked would be as follows:

When the active tab already has a file on disk associated with it, behavior is the same as Follow current document: Open..., Save As... and Save a Copy As... open a file dialog in the directory that contains the file, and Save just saves the file in place.

When the active tab is new — does not have a file on disk associated with it — Open... and Save open a file dialog in the designated default directory. Save As... and Save a Copy As... behave as Follow current document does now: they open a file dialog in the directory corresponding to the most recently active tab that was associated with a file on disk.

That way you can still save new files in the directory in which you are already working by using Save As..., or in the default directory by using Save. Opening a file when the active tab has a file on disk would start the open dialog in the same directory, while opening the first file in a session would go to the default directory without the need to modify the Start In property of the Notepad++ shortcut.

Coises avatar Dec 05 '25 17:12 Coises

I like the idea! It enables the desired features in a very elegant way and with minimal changes to the GUI.

fml2 avatar Dec 05 '25 20:12 fml2