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

middle button click on document list no longer closes a document #12949

Closed
jkumeboshi opened this issue Jan 27, 2023 · 13 comments
Closed

middle button click on document list no longer closes a document #12949

jkumeboshi opened this issue Jan 27, 2023 · 13 comments

Comments

@jkumeboshi
Copy link

Description of the Issue

8.4.6 update has removed a useful function: when clicking with mouse middle button on a document in the document list the document closes.

Steps to Reproduce the Issue

  1. open a couple of files
  2. show document list: menu->view->document list
  3. middle click on any document entry in the list

Expected Behavior

document closes

Actual Behavior

nothing happens

Debug Information

Notepad++ v8.4.8 (64-bit)
Build time : Dec 24 2022 - 19:40:27
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:\Users\gam\Downloads\logs_Fedora33 (1).txt"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 11 (64-bit)
OS Version : 22H2
OS Build : 22621.1105
Current ANSI codepage : 1252
Plugins :
mimeTools (2.9)
NppConverter (4.5)
NppExec (0.8.2)
NppExport (0.4)

@alankilborn
Copy link
Contributor

Middle click close doc works fine for me.

Notepad++ v8.4.8 (64-bit)
Build time : Dec 24 2022 - 19:40:27
Path : W:\npp.misc_NoBackup\Releases\npp.8.4.8\npp.8.4.8.portable.x64\notepad++.exe
Command Line : -titleAdd="8.4.8 64-bit" -multiInst
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 21H2
OS Build : 19044.2364
Current ANSI codepage : 1252
Plugins :
mimeTools (2.9)
NppConverter (4.5)
NppEditorConfig (0.4)
NppExport (0.4)
PythonScript (2)

@jkumeboshi
Copy link
Author

Maybe is a misbehavior in Windows 11?
Actually, I noticed it when recently I've upgrade to Windows 11.

@alankilborn
Copy link
Contributor

Oh wait, I misunderstood. I didn't read closely enough. I thought you meant for a file tab on the tab bar.

In "Document List", when did middle-click ever close a document? I tried several recent versions and none of them did anything when middle-clicking on a filename in the "Document List".

@jkumeboshi
Copy link
Author

I apologize, just now I've noticed that on the OLD installation I was using the old WindowManager plugin, that has been partially integrated in NPP as a feature.

https://sourceforge.net/projects/npp-plugins/files/WindowManager/

Well, actually in that plugin the middle button was closing the clicked document since it intercepts the WM_MBUTTONDOWN message.

I think this may be nice to be implemented also in Document List.

I may try to implement it by myself, but I don't know if @donho accepts pull requests.

@alankilborn
Copy link
Contributor

I may try to implement it by myself, but I don't know if @donho accepts pull requests.

Yes, he does.
There are contributing guidelines, see CONTRIBUTING.md in the root of the source code.

@jkumeboshi
Copy link
Author

hello @alankilborn and @donho,

I've completed an implementation for closing a file using the middle mouse button on the document list control.
Code is inspired form the old Window Manager Plugin, so I've subclassed the list view control to intercept the WM_MBUTTONDOWN event.

this is the branch implementing the code, if you think it's OK I'll make a pull request to the main repo:

https://github.com/jkumeboshi/notepad-plus-plus/tree/jku_middle_button_close_20230130

@donho
Copy link
Member

donho commented Feb 7, 2023

I'm not sure it's a good feature (middle click to close) on Document List - it's not tab and users could miss-click on middle button.

@alankilborn
Copy link
Contributor

@donho

I'm not sure it's a good feature (middle click to close) on Document List - it's not tab and users could miss-click on middle button.

Already a feature on tab bar; user could accidentally middle-click there too.
Answer might be to make it configurable via preference setting.

@donho
Copy link
Member

donho commented Feb 7, 2023

@alankilborn

Already a feature on tab bar; user could accidentally middle-click there too.

Yes, there's already the middle button to close on tabbar, it's common on the browsers. My point is document list is not tabbar, so both should not necessarily have the same behaviour.

Answer might be to make it configurable via preference setting.

No, it's already too many options. My question is "Is it really needed by users?".

@Mateos81
Copy link
Contributor

Mateos81 commented Feb 8, 2023

Is there any other shortcut such as middle-mouse-click to quickly close a document?
And perhaps in case of a mistake, re-open lastly closed document, such as browser SHIFT+CTRL+T?
To me that would just be consistency ^^'

@jkumeboshi
Copy link
Author

jkumeboshi commented Feb 8, 2023

@donho

@alankilborn

Already a feature on tab bar; user could accidentally middle-click there too.

Yes, there's already the middle button to close on tabbar, it's common on the browsers. My point is document list is not tabbar, so both should not necessarily have the same behaviour.

Answer might be to make it configurable via preference setting.

No, it's already too many options. My question is "Is it really needed by users?".

I agree about the settings.

Well, I use it a lots since I can sort documents by path and then I can close any of it rapidly using middle mouse button. Without middle mouse button I shall right click on each document and select close in the contextual menu.

Anyway, middle mouse click is commonly recognized as close function, also in Windows if you middle click somewhere is closable user expects it closes.
Examples:
Windows taskbar, middle click on the preview window of an app close the window
Windows tasks switcher (ALT+TAB or WIN+TAB): middle click on the preview window of an app close the window
Windows notifications: middle click on notification just dismiss it without opening the source app

And so on, I stop but I could continue with other examples.
Moreover I don't think the average user of Notepad++ would close by mistake a document more than once.

@robotboy655
Copy link
Contributor

robotboy655 commented Feb 8, 2023

I use that to quickly close tabs. I have a lot of tabs open and wanted vertical tabs ever since I switched my Visual Studio to vertical tabs (which does have middle mouse click to close), but in its current form I don't feel like the Document List can
replace the normal tabs for me due to these usability issues (and stuff like colored tabs not working, etc)

I honestly cannot imagine how you can accidentally click your mouse wheel. It's elevated on every mouse, you are not usually resting your finger on the scroll wheel, and a typical mouse requires more force to press the mouse wheel compared to left/right clicks. And there isn't really any other use for mouse wheel click in NP++ as far as I know.

And even if you do manage to misclick, should we really be catering to it? You can reopen last closed tab easily enough, just like you can undo any other mistake you might do in the text editor, such as accidentally using right click+mouse wheel document switcher, which I'd argue has bigger chance of being accidentally used, I know I have.

@donho donho closed this as completed in 94b8315 Feb 11, 2023
@epchain
Copy link

epchain commented Mar 3, 2024

Uhh, I do misclick middle mouse button and here's how it happens.

I often have a session of many opened files in a particular order that matters. They are arranged in a horizontal single line of file tabs. I scroll them with mouse wheel pretty fast to switch between distant file tabs. Sometimes I accidentally middle-click instead of scrolling and close file tabs, and that somewhat ruins my file layout. This might happen because of high switch sensitivity, wearing of that switch or my arm getting tired after time.

That being said, I'd like to have a preference to control middle-click behavior. I think such setting would better go inside Settings -> Shortcut Mapper along similar input settings. Something like Close Tab with value Middle Mouse Button. If that's too much of development, then simple checkbox in Settings -> Preferences would do the thing. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants