Author Topic: INI language  (Read 916 times)

rh

  • Senior Community Member
  • Posts: 126
  • Hero Points: 6
INI language
« on: September 04, 2012, 07:16:41 pm »
Given the sample below, Function headings doesn't work as expected.  It collapses everything.

In addition, Ctrl+\ doesn't always work - at first.  Trying to collapse only works when the cursor is on the line containing the function header.  After collapsing/expanding there, then it starts working on lines beneath the function header.  Otherwise it collapses everything.

[Top]
pref1 = 0
pref2 = 1

[Middle]
pref3 = 2
pref4 = 3

[Bottom]
pref5 = 4
pref6 = 5

Matthew

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 990
  • Hero Points: 44
Re: INI language
« Reply #1 on: September 05, 2012, 04:35:23 pm »
We'll have to look into why this isn't collapsing correctly. In the meantime you can use the Selective Display dialog with the Search Text option (or invoke the all command on the SE command line) to do the same thing with this simple regex (SlickEdit regex syntax): /^\[?+\]/r

Command Line: all /^\[?+\]/r

If this is something you need frequently, you can wrap up this call in a macro.
Code: [Select]
#include "slick.sh"
_command collapse_ini_sections() name_info(','VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL)
{
    _macro('R',1);
    all('^\[?+\]','IR');
}