Column the text of a line is measured from: the content column of the * innermost open list item it reaches. The stack is strictly increasing (an * item opens to the right of everything still open), so this is a binary * search. */
| 1330 | * item opens to the right of everything still open), so this is a binary |
| 1331 | * search. */ |
| 1332 | static int rs_md_base(const rs_md_t *st, int col) { |
| 1333 | int lo = 0; |
| 1334 | int hi = st->nlist; |
| 1335 | while (lo < hi) { |
| 1336 | int mid = lo + ((hi - lo) / PAIR_LEN); |
| 1337 | if (st->list[mid] <= col) { |
| 1338 | lo = mid + SKIP_ONE; |
| 1339 | } else { |
| 1340 | hi = mid; |
| 1341 | } |
| 1342 | } |
| 1343 | return lo > 0 ? st->list[lo - SKIP_ONE] : 0; |
| 1344 | } |
| 1345 | |
| 1346 | static void rs_md_push_list(rs_md_t *st, int content) { |
| 1347 | if (st->nlist >= st->list_cap) { |