Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to always default to NEW TAB when running new instance of NPP when in mono-instance mode and currently open #5527

Closed
mcdonamw opened this issue Apr 14, 2019 · 11 comments
Assignees
Labels

Comments

@mcdonamw
Copy link

mcdonamw commented Apr 14, 2019

Description of the Issue

This was previously closed under #1642 as part of a cleanup effort assuming this issue was no longer relevant with new versions of NPP. This request is still relevant.

I use NPP in mono-instance mode and have it configured to remember current session for next launch. I am requesting an option to always default to a NEW TAB each time I launch it (whether NPP is closed or even if already open).

I launch NPP via a quick cmd line shortcut whenever I need it again to quickly paste or jot down some important information I need to keep. NPP currently opens up to an existing tab/file I had open in the previous session and I inadvertently paste that information into said existing file/tab. My intention was to store this in a new tab quickly like I did with Notepad.

I do not wish to use multi instance of NPP as I often leave many files/tabs open to return to later and is the reason I use NPP over Notepad.

Steps to Reproduce the Issue

  1. Install NPP with default of mono instance mode and remember current session for next launch
  2. Open NPP and multiple tabs
  3. Minimize or close NPP
  4. Attempt to launch NEW instance of NPP (via your preferred method)

Expected Behavior

If NPP is already open, regain focus and default to NEW TAB
If NPP is closed, reopen with previous session in tact and default to NEW TAB

Actual Behavior

NPP opens or regains focus but the last used tab has focus vs. a new tab

Debug Information

Notepad++ v7.6.6 (64-bit)
Build time : Apr 3 2019 - 23:52:32
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : mimeTools.dll NppConverter.dll

@MetaChuh
Copy link

@mcdonamw

thank you for your feature request and for re-evaluating it on 7.6.6.

NPP currently opens up to an existing tab/file I had open in the previous session and I inadvertently paste that information into said existing file/tab.

to avoid this, please read the contents of a notepad++ tab, before you paste anything into it.
you will be on the safe side, if you see that the editor panel is completely empty.

I am requesting an option to always default to a NEW TAB each time I launch it (whether NPP is closed or even if already open).

if your notepad++ is already opened:
please press the notepad icon with the green plus, to quickly open a new tab. (see screenshot below)
this will be quicker than double-clicking on a notepad++ shortcut, as well as quicker than starting notepad++ from cmd with a command line parameter.

Bildschirmfoto 2019-04-15 um 02 13 29

if your notepad++ is still closed, and you want to use a command line switch to open notepad++ with a new x tab:
you can use notepad++.exe -qtnew which will open a new tab with the content new as a visual aid for easier identification.

best regards


general notes:

please close your issues as soon as you are satisfied, to help
keeping the notepad++ issue tracker clean.

for general questions, or if it is not sure, whether your issue is directly related to
the notepad++ source code, please visit us at the notepad++ community forum, and
search if related topics exists. you are welcome to post either at similar
topics, or to create a new topic at Help Wanted or General Discussion.
(no extra account is needed, just use your github account to sign in)

                        Click here to visit the Notepad++ Community Forum                         

@mcdonamw
Copy link
Author

So this is closed without any consideration? The whole idea of using cmd line is to not have to click the UI. Further adding cmd line parameters also defeats the quick purpose of how I use cmd line to launch things.

Notepad and NPP (in multi-instance mode) does exactly what I'm after. Unfortunately I don't want NPP multi-instance as it defeats the purpose of having a single window with multiple tabs which is why I use NPP over Notepad to begin with. This would only help my productivity, as I'm sure it would others. Why would you simply close this?

@sasumner
Copy link
Contributor

Why would you simply close this?

Probably because the workflow you described, while it makes perfect sense for you, doesn't make much sense for the other 99.999% of Notepad++ users. I don't want to speak for them, but it doesn't make sense to me, and what @MetaChuh described is how I would handle the same situation. Sorry, mate. :)

@mcdonamw
Copy link
Author

mcdonamw commented Apr 15, 2019

With all due respect, 99.999%? That's nonsense.

I would wager there are quite a number of people who would see benefit of having NPP always default to a new tab when being launched, regardless of what other tabs are already opened. In fact, clearly there was a desire for this already and it was implemented with the -qtnew command line parameter.
Surely that wasn't implemented for 0.001% of people.

With that said, given that already exists, simply adding another option to call the same code that -qtnew does within preferences would be minimal work at best.

Lastly I would also wager a large number of existing options within NPP only apply to a very small niche part of the community, yet they are there.

@sasumner
Copy link
Contributor

Touche. :)

@mja1962
Copy link

mja1962 commented Feb 18, 2021

I would also like to be able to launch NPP with the option to have a new, blank tab opened. In the absence of the feature, I will most likely create an AutoHotkey shortcut to pass a CTRL+N to NPP right after it launches.

@mja1962
Copy link

mja1962 commented Feb 18, 2021

Here's my AHK script, in case anyone cares to use it:

;=====================================================
; WIN + n
; Launch Notepad++ with a new tab:
;=====================================================
#n::
{
Run, notepad++
Sleep 200
Send, ^n
return
}

@HikariNoKitsune
Copy link

I'm looking for this exact thing.. which is rather saddening to hear... I'm not sure why, at all, anyone would want to open Notepad++ and go "well time to close 50 tabs that do not pertain to the work I am about to do"... Its super annoying, time consuming, and tedious, to have to close 5-10 tabs every single time I want to open up Notepad++, just to have a clean, NEW window/tab... When I launch a program, I expect a clean slate. If I want a file, I'd open that file. If I wanted to have it remember my previous 'state', I'd click an option to ENABLE that ability... It should not be a 'default on' experience, and it should not be a 'well no one else uses it' response...

I use regular Notepad over NotePad++ explicitly because of this failure... I open a notepad to take a quick note, and expect it to be BLANK when I open it. I expect NotePad++ to open up BLANK AS WELL so that I can IMMEDIATELY start working... not waste 30 seconds to close out a bunch of tabs that have nothing to do with what i'm currently trying to work on. Oh, and 'just close them when you're done' doesn't fly, as even after i've closed those tabs, they still just 'open right back up' next time I launch NotePad++.. I have to close everything, press the 'new' button, and close the previous 'blank' tab, so that next time it opens, it opens to 'that' blank tab. Its tedious and annoying. Not to mention inexcusable to have a response be "0.000001% of people don't want this", when I can bet you that 99.95% of the people, DO want this.

@sasumner
Copy link
Contributor

sasumner commented Apr 5, 2021

@HikariNoKitsune said:

I expect NotePad++ to open up BLANK AS WELL so that I can IMMEDIATELY start working

To me it sounds like you want this setting set the following way:

image

But maybe there is more going on here.

@sasumner
Copy link
Contributor

sasumner commented Apr 5, 2021

@HikariNoKitsune

I open a notepad to take a quick note, and expect it to be BLANK when I open it. I expect NotePad++ to open up BLANK AS WELL so that I can IMMEDIATELY start working... not waste 30 seconds to close out a bunch of tabs

If you are just going to "take a quick note" then why not just ignore any existing tabs? Okay, so maybe it involves that terribly demanding press of Ctrl+n before you can get to the quick notetaking.

Maybe what you want is to open a N++ instance using the -noSession command-line parameter.
A quick test to see the effectiveness of this approach can be done as follows:

  • put your caret in some whitespace (i.e., not touching any real text)
  • invoke Run menu > Open file in new instance

@donho
Copy link
Member

donho commented Jun 3, 2023

#11134 (comment)

@donho donho reopened this Jun 3, 2023
@donho donho self-assigned this Jun 3, 2023
@donho donho added accepted and removed reject labels Jun 3, 2023
donho added a commit to donho/notepad-plus-plus that referenced this issue Jun 3, 2023
To enable/disable this feature, add/delete "addNewDocumentOnStartup.xml" in "%APPDATA%\Notepad++\" (or beside notepad++.exe if doLocalConf.xml is present).

Fix notepad-plus-plus#11134, fix notepad-plus-plus#9535, fix notepad-plus-plus#5527
@donho donho closed this as completed in 61503a2 Jun 8, 2023
molsonkiko pushed a commit to molsonkiko/notepad-plus-plus that referenced this issue Jun 13, 2023
To enable/disable this feature, go to New Document section of Preferences dialog, and check/uncheck "Always open a new document in addition at startup" checkbox.

Fix notepad-plus-plus#11134, fix notepad-plus-plus#9535, fix notepad-plus-plus#5527, close notepad-plus-plus#13738
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants