Skip to content

[FEATURE] provide way to unfold current level in N++ from TreeViewer #103

@pryrt

Description

@pryrt

Problem Description

When the entire JSON structure is visible in the N++ window, then clicking on an element in the JSON Tree View moves the N++ caret to the location as expected, which is quite useful: example =

Image

But when the N++ window has folded the JSON, so that the new location is hidden on the N++ side, then when the caret moves, it just disappears. And, because Tree View panel has the focus, the View > Unfold Current Level shortcut (Ctrl+Alt+Shift+F) doesn't work.

Image

And single-clicking again, or double-clicking, or right-click context menu doesn't seem to provide any way to perform that action in the N++ view. So the only way to see it is to then click on the right view/tab header (without accidentally clicking in the text and moving the caret), and then do Ctrl+Alt+Shift+F.

Suggestions

Having one or more of the following actions to send a IDM_VIEW_UNFOLD_CURRENT to the active N++ view would be great:

  1. Have the original click send that message
  2. Have a double-click on a Tree View element send that message
  3. Have a right-click context menu action that will send that message
  4. Have the Tree View panel respond to Ctrl+Alt+Shift+F and send the message to N++

More

I discovered this problem when I was working on a largish JSON file (which I almost never do), and had a bunch folded in N++. When I clicked in JsonTools Tree View, I was expecting the caret to move and show the appropriate line in the editor, but because it was folded, it didn't work. I naturally tried all the click and double-click and context menu and keyboard shorcut methods, and none of them worked for me.

I don't need all those implemented -- for example, handling double-click specially would be silly if single-click also sent the message (since in the absense of a double-click handler, win32 api reverts to using the single-click handler anyway). But having one or two of those work would be great. Based on what I tried, the order of my suggestions follows the order than I intuitively expect something might work, but I can understand if you don't want, for example, single-click to have to do any more work than it already does.

Notepad++ v8.8.6   (64-bit)
Build time: Oct  1 2025 - 01:23:06
Scintilla/Lexilla included: 5.5.7/5.4.5
Boost Regex included: 1_85
Path: C:\Program Files\Notepad++\notepad++.exe
Command Line: "C:\usr\local\share\TempData\Npp\unfold.json" -multiInst -nosession -ljson -n8 -c19
Admin mode: OFF
Local Conf mode: OFF
Cloud Config: OFF
Periodic Backup: OFF
Placeholders: ON
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 100%
    visible monitors count: 1
    installed Display Class adapters: 
        0000: Description - Intel(R) UHD Graphics 770
        0000: DriverVersion - 32.0.101.6881
OS Name: Windows 11 Home (64-bit)
OS Version: 24H2
OS Build: 26100.6584
Current ANSI codepage: 1252
Plugins: 
    AutoSave (2)
    CollectionInterface (1.3)
    ComparePlus (2.1.1)
    ConfigUpdater (2.3)
    DSpellCheck (1.5)
    EnhanceAnyLexer (1.4.1)
    ExtSettings (1.3.1)
    JsonTools (8.4)
    MarkdownViewerPlusPlus (0.8.2)
    mimeTools (3.1)
    NppConsole (1.2.4.1)
    NppConverter (4.7)
    NppEditorConfig (0.4)
    NppExec (0.8.8)
    NppExport (0.4)
    NppFTP (0.29.14)
    NppLspClient (0.0.31)
    NppUISpy (1.2)
    PreviewHTML (1.3.3.3)
    PythonScript (3.0.22)
    QuickText (0.2.5.1)
    TagLEET (1.3.10.1)
    XMLTools (3.1.1.13)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions