arg_show_lines (...)

, , , , , , , , , Sunday, February 22, 2009 0 comments

// command arg_show_lines(...)

// In a selective display, show a range of lines by line number
// The main goal here is to open a range of hidden lines to view.
// If the range contains already-displayed lines, they'll be
// displayed along with the newly displayed hidden lines
//
// Usage: arg_show_lines 352 396
//
// Note: if a line with a "minus bitmap" is displayed before
// executing this macro, the minus bitmap will be removed; this
// makes some sense because the macro is meant to remove all
// minus and plusbitmap lines as it unhides all lines in the
// selected range
//
_command void arg_show_lines(...) name_info(','VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL)
{
parse arg(1) with first_line last_line // get line numbers from the
p_line=first_line; // command-line arguments
up();
if (p_line<=1) { // check the lineflags in the p_line=0; // range, get seldisp level new_level=0; } else { new_level=_lineflags()&LEVEL_LF; if (!up()) { new_level=_lineflags()&LEVEL_LF; down(); } } for (;;) { // go through all lines in the if (p_line>last_line) break; // specified range and bust
level=(_lineflags() & LEVEL_LF); // them out of hidden state
_lineflags(new_level,HIDDEN_LF|LEVEL_LF|PLUSBITMAP_LF|MINUSBITMAP_LF);
status=down();
if (status) {
break;
}
if (p_line>last_line) {
break;
}
}
p_line=last_line;
}

GlossyBlue Blogger by Black Quanta. Theme & Icons by N.Design Studio
Entries RSS Comments RSS