int FTagManager::GetFirstLineID(const line_t *line) const { int i = lineindex(line); return LineHasIDs(i) ? allIDs[startForLine[i]].tag : 0; }
bool FTagManager::LineHasID(const line_t *line, int tag) const { return LineHasID(lineindex(line), tag); }
void display_move(int x, int y) { char buff[128]; char *p; char *bufp; char *colorp; int cnt = 0; int color = curr_color; dprintf("display_move(%d, %d): curr_x %d, curr_y %d\n", x, y, curr_x, curr_y); /* are we in a position to do this without cursor addressing? */ if (curr_y < y || (curr_y == y && curr_x <= x)) { /* start buffering up what it would take to move there by rewriting what's on the screen */ cnt = CURSOR_COST; p = buff; /* one newline for every line */ while (cnt > 0 && curr_y < y) { #ifdef ENABLE_COLOR if (color != 0) { p = strcpyend(p, color_setstr(0)); color = 0; cnt -= 5; } #endif *p++ = '\n'; curr_y++; curr_x = 0; cnt--; } /* write whats in the screenbuf */ bufp = &screenbuf[lineindex(curr_y) + curr_x]; colorp = &colorbuf[lineindex(curr_y) + curr_x]; while (cnt > 0 && curr_x < x) { #ifdef ENABLE_COLOR if (color != *colorp) { color = *colorp; p = strcpyend(p, color_setstr(color)); cnt -= 5; } #endif if ((*p = *bufp) == '\0') { /* somwhere on screen we haven't been before */ *p = *bufp = ' '; } p++; bufp++; colorp++; curr_x++; cnt--; } } /* move the cursor */ if (cnt > 0) { /* screen rewrite is cheaper */ *p = '\0'; fputs(buff, stdout); curr_color = color; } else { screen_move(x, y); } /* update our position */ curr_x = x; curr_y = y; }