Fold / Unfold functionality in ver. 7.7 is broken for me
-
Hello,
I use Notepad++ to keep notes and information. To organize the information I divided sections of the text within { }. For example
Category A: {
Topic1: {
1) XXXX: {
a. 1111
b. 2222
c. 3333
}
2) YYYY
3) ZZZZ
}
Topic 2:{
a. XXXX
b. YYYY
c. ZZZZ
}
}After creating that structure I told the program to consider the text as a C language program, even when it is a simple text file. That way I was able to expand and collapse the different sections of the document.
After updating to version 7.7 that capability was lost. It seems that it considers a “)” as a closing argument for the opening “{” because if I change the “)” with a period (for example 1) 1.), it seems to work. But to do that in the entire document that have more than 6000 lines is basically impossible. Is there a way to make it work like with older versions.
-
Just to confirm that I rollback to 7.6 and it is working the way I like. Please let me know if there is a way to make 7.7 to work like older versions.
-
@3d1l said:
But to do that in the entire document that have more than 6000 lines is basically impossible
Or could be done with Find =
^(\h*\d+)\)
, Replace =$1.\)
, search mode =Regular Expression
.But that doesn’t actually fix the problem, it just postpones it, because it’s not valid c, and a c lexer shouldn’t be expected to properly parse when you don’t have the right matching of {} and () pairs.
I told the program to consider the text as a C language program … updating to version 7.7 that capability was lost
You feed the c parser invalid c syntax, and expect it to consistently parse it the same way from one version to the next? Interesting.
rollback to 7.6
Please not 7.6. If you must go backward, use 7.6.3 or 7.6.6.
But IMO, the best solution (and the one you should have used, even in v7.6.x or 7.5.x or earlier): you could set up a UDL – User Defined Language – which sets the folding rules to just { and }. In fact, I downloaded a fresh v7.7 x64 portable, pasted in your text, Language > User Defined, then Language > Define Your Language…. On the first tab (Folder & Default), I set Folding in code 1 style open =
{
, close =}
, and it immediately started folding the way I think you want. It took only a few seconds. If you do a Save As…mySuperFolding
and select the Language > mySuperFolding entry, you can do it automatically. If your mySuperFolding files always have the extension.msf
, you can add that to the mySuperFolding Ext. =msf
box (without the dot), and those files will always use that folding technique. You can even define other highlighting and keyword coloring, which may or may not be helpful to you.And, BTW, your organization is nearly JSON… you might want to look into just using that; it’s got a builtin lexer, and everything. :-)
-
Peter using the defined language worked for me. Thank you very much.
The JSON didn’t work, same problem and the search and replace… not that simple but anyways, as you suggested the user defined language solved the issue.