notepad-plus-plus / notepad-plus-plus/notepad-plus-plus

Opening a file for edit tries to create a new file

Open
#4,451 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
29.4k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Description of the Issue

When opening a file for edit using the File->Open menu command, Notepad++ is now very picky about the file type filter setting when opening a file of another type. Even though all file types are displayed regardless of the dialog box filter setting, selecting a file with an extension that is different from the filter setting will not open the file, instead it wants to create a new file with the selected file name and extension from the filter setting. This used to work properly in previous releases.

Steps to Reproduce the Issue
  1. Select File->Open... from the main menu
  2. Set the dialog box filter to Normal Files *.txt (also default)
  3. Select a file OTHER than one of a .txt type
  4. Click Open on the dialog box.
Expected Behavior

File should open regardless of type and with proper extension

Actual Behavior

Tries to create a new file with current name and filter extension

Debug Information

Notepad++ v7.5.6 (32-bit)
Build time : Mar 19 2018 - 00:26:59
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : ComparePlugin.dll DSpellCheck.dll mimeTools.dll NppConverter.dll NppExec.dll NppExport.dll PluginManager.dll

Work Around

Always select "All types" in the File Open dialog. This should be the default.

File Open Dialog
image

File Create Dialog
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue through File->Open with the filter set to Normal Files *.txt, then trace the file-open flow responsible for handling a selected file with another extension. Done means the selected file opens with its proper extension instead of triggering creation with the active filter extension; verify the workaround and expected behavior described in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.