Show/hide tab or change tab width
-
I use the MarkdownPanel plugin and would like to wire up a toolbar button to show/hide the .md source file pane. The plugin currently supports the ability to show/hide the rendered view (“Toggle Markdown Panel”), but not the other way around. The .md source is in a proper NPP tab, but the rendered view is in some kind of embedded panel.
Does NPP have any scripting commands to show/hide a tab, change a tab’s width, or move the vertical window splitter? I don’t have to hide the tab completely, but would like to get it as narrow as possible if I can’t.
Note that I’ve already created a Feature Request with MarkdownPanel for the second toggle command, but thought I’d see if I could work around it in the meantime.
-
Notepad++ doesn’t have any way (that I know of) to hide a tab.
Notepad++ does not provide plugins with an API call to move/resise the view splitter line – it might be possible for a plugin to try to use Win32 API calls to hack into the tab-splitter and edit that, but plugins trying to hack the main app runs the risk of bugs causing crashes, getting the plugin added to the “disable immediately” list.
On my first read of your post, I thought you were talking about the “splitter” between the View 1 and View 2 – ie, when you have done a “move to other view” on one or more of the files. Hence my paragraph above. But when I reread, I realized you probably meant the meant the “splitter” between the editor tab(s) and the docked panel. There’s a better chance that the plugin is able to influence that:
I’ve never dealt with the docked panels in plugins, but since the plugin is the code asking for the creation of the docked window, I think it would have the hWnd for that panel, and thus be able to do things like resize it. But someone with actual experience with the docked panels would be better able to comment on that, because I’m not 100% sure whether it would honor resize commands when docked, or only when the panel is made a floating window (because I know those two conditions have separate sizes). So this way, my estimate would be a big fat “maybe”.
-
Thank you for all of the information. While it might be fun to dig into the Windows APIs again, I was hoping for something simple I could run with NppExec, etc. without a lot of coding. Since it’s not a lot of extra work to move the splitter manually, I’ll live with that for now. And maybe the MarkdownPanel team will find my request worth implementing, though it’s possible it can’t be done since one side is a NPP tab and the other is a panel.