MCPcopy Create free account
hub / github.com/Genivia/ugrep / pgdn

Method pgdn

src/query.cpp:2081–2126  ·  view source on GitHub ↗

page down the display

Source from the content-addressed store, hash-verified

2079
2080// page down the display
2081void Query::pgdn(bool half_page)
2082{
2083 if (select_ >= 0)
2084 {
2085 if (half_page)
2086 select_ += maxrows_ / 2;
2087 else
2088 select_ += maxrows_ - 2;
2089 if (select_ >= rows_)
2090 select_ = rows_ - 1;
2091 if (select_ < row_ + maxrows_ - 2)
2092 return;
2093 }
2094 if (row_ + maxrows_ - 1 <= rows_)
2095 {
2096 int oldrow = row_;
2097 if (half_page)
2098 row_ += maxrows_ / 2;
2099 else
2100 row_ += maxrows_ - 2;
2101 if (row_ + maxrows_ > rows_)
2102 {
2103 row_ = rows_ - maxrows_ + 2;
2104 if (row_ < oldrow)
2105 row_ = oldrow;
2106 }
2107 if (!flag_split)
2108 {
2109 int diff = row_ - oldrow;
2110 if (diff > 0)
2111 {
2112 Screen::normal();
2113 Screen::pan_up(diff);
2114 for (int i = row_ + maxrows_ - diff - 2; i < row_ + maxrows_ - 2; ++i)
2115 disp(i);
2116 status(true);
2117 draw();
2118 }
2119 }
2120 else
2121 {
2122 // split screen
2123 redraw();
2124 }
2125 }
2126}
2127
2128// move back up one file
2129void Query::back()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected