Number expression as close folding point



  • I am creating a UDL. In the language I’m working with, all commands end with 999999. I’m having a problem with folding. It is not working properly when I define the term 999999 as the closing point. Is it possible to use as an closing folding point an expression containing only numbers?



  • @André-Albuquerque said in Number expression as close folding point:

    Is it possible to use as an closing folding point an expression containing only numbers?

    Apparently not. At least, I can confirm with UDLv2.1.0.12 and NPP 7.8.4-64, if I define a UDL with Folding In Code 1 Open: open and Close: 999999 other, then it folds to other rather than 999999:
    62b263ea-7e7c-4ff5-b539-5d1dad078eb3-image.png

    if I change the close to x999999 other, and add the x to the data row, it now correctly folds to the x999999:
    55d097f6-cb3a-428e-b081-8a1c068e33bb-image.png

    I can confirm the apparent limitation, but I don’t know how to get around that. Sorry.



  • Hello, @andré-albuquerque, @peterjones and All,

    I think that I found out a work-around :

    Simply use the value 99999 in the Close box, instead of 999999 ( or even 99999 other, for testing )

    For instance, assuming the User Defined Language text, below :

    bla blah
    open
    something
    9
    99
    999
    9999
    99999
    999999
    other
    bla blah
    

    Change the value 99999, in the Close box, by 9999 and so on… till the value 9 and notice the ending line of folding ! Funny, isn’t it ?

    Cheers,

    guy038



  • That is definitely a bug. If you do the same thing with the letter a instead of the digit 9, it stops on the first line with the proper number of a characters, as it should, rather than requiring one extra a.

    Too bad the UDL subsystem issues don’t ever seem to gain traction. Submitted #8040 anyway



  • Hi, @peterjones,

    I didn’t even think to do tests with letters, instead of digits :-( Many thanks for taking time to open a new issue on GitHub !

    BR

    guy038



  • Thank you all for the support. The @guy038 work-around is helping for now.


Log in to reply