notepad-plus-plus / notepad-plus-plus

Notepad++ official repository
https://notepad-plus-plus.org/
Other
23.01k stars 4.61k forks source link

Hidden lines doesn't work with code folding #13682

Open cynthplusplus opened 1 year ago

cynthplusplus commented 1 year ago

Description of the Issue

The View menu's Hide Lines feature incorrectly opens lines that are inside a folded section.

Steps to Reproduce the Issue

  1. Select C++ from the Language->C->C++ menu.
  2. Copy the following code:

    
    for (int i = 0; i < n; ++i)
    {
    // blah blah
    // HIDE LINE 1
    // HIDE LINE 2
    // HIDE LINE 3
    for (int j = 0; j < n; ++j)
    {
    // 
    // HIDE START
    // HIDE BLOCK
    
    }
    
    // HIDE END

}


3. Hide lines from the HIDE START comment to the HIDE END comment (via View Menu or alt+h), as follows:
<img width="262" alt="hide fold step 1" src="https://github.com/notepad-plus-plus/notepad-plus-plus/assets/17750551/8e84dd87-05b0-464f-aae7-0e65b12838cb">

<img width="242" alt="hide fold step 2" src="https://github.com/notepad-plus-plus/notepad-plus-plus/assets/17750551/2939eaf0-f502-453a-91be-5ef61aeb9f9a">

4. Fold the for block by clicking on the red minus sign as follows:
<img width="249" alt="hide fold step 3" src="https://github.com/notepad-plus-plus/notepad-plus-plus/assets/17750551/3990e92b-815e-4c09-a19e-bbaa0e7da96a">

5. Open the hidden lines by clicking on the green close marker on line 16:
<img width="251" alt="hide fold step 4" src="https://github.com/notepad-plus-plus/notepad-plus-plus/assets/17750551/a2915ae1-e899-49d4-b4dd-29082247a35f">

### Expected Behavior
Lines 10-15 should remain hidden.

### Actual Behavior
Lines 10-15 are visible.

### Debug Information
Notepad++ v8.1.9.3   (32-bit)
Build time : Dec  6 2021 - 19:16:45
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit) 
OS Version : 2009
OS Build : 22621.1702
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll 
Notepad++ v8.1.9.3   (32-bit)
Build time : Dec  6 2021 - 19:16:45
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line : 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit) 
OS Version : 2009
OS Build : 22621.1702
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll 
MarkusBodensee commented 1 month ago

@cynthplusplus In my opinion, Expected Behavior should be that Lines 8-13 should remain hidden. But Line 14 and 15 should become visible again at step 5, because they are not part of the block folding, like indicated by the block folding mark below minus sign in picture 3