MCPcopy Create free account
hub / github.com/gwsw/less / forw_loop

Function forw_loop

command.c:1128–1163  ·  view source on GitHub ↗

* Forward forever, or until a highlighted line appears. */

(until_hilite)

Source from the content-addressed store, hash-verified

1126 * Forward forever, or until a highlighted line appears.
1127 */
1128 static int
1129forw_loop(until_hilite)
1130 int until_hilite;
1131{
1132 POSITION curr_len;
1133
1134 if (ch_getflags() & CH_HELPFILE)
1135 return (A_NOACTION);
1136
1137 cmd_exec();
1138 jump_forw_buffered();
1139 curr_len = ch_length();
1140 highest_hilite = until_hilite ? curr_len : NULL_POSITION;
1141 ignore_eoi = 1;
1142 while (!sigs)
1143 {
1144 if (until_hilite && highest_hilite > curr_len)
1145 {
1146 bell();
1147 break;
1148 }
1149 make_display();
1150 forward(1, 0, 0);
1151 }
1152 ignore_eoi = 0;
1153 ch_set_eof();
1154
1155 /*
1156 * This gets us back in "F mode" after processing
1157 * a non-abort signal (e.g. window-change).
1158 */
1159 if (sigs && !ABORT_SIGS())
1160 return (until_hilite ? A_F_UNTIL_HILITE : A_F_FOREVER);
1161
1162 return (A_NOACTION);
1163}
1164
1165/*
1166 * Main command processor.

Callers 1

commandsFunction · 0.85

Calls 8

ch_getflagsFunction · 0.85
cmd_execFunction · 0.85
jump_forw_bufferedFunction · 0.85
ch_lengthFunction · 0.85
bellFunction · 0.85
make_displayFunction · 0.85
forwardFunction · 0.85
ch_set_eofFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…