MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / next

Method next

src/Gui/PythonConsole.cpp:1611–1627  ·  view source on GitHub ↗

* next switches the history pointer to the next item. * While searching the next item, the routine respects the search prefix set by prev(). * @return true if the pointer was switched to a later item, false otherwise. */

Source from the content-addressed store, hash-verified

1609 * @return true if the pointer was switched to a later item, false otherwise.
1610 */
1611bool ConsoleHistory::next()
1612{
1613 bool wentNext = false;
1614
1615 // if we didn't reach history's end ...
1616 if (_it != _history.cend()) {
1617 // we go forward until we find an item matching the prefix.
1618 for (++_it; _it != _history.cend(); ++_it) {
1619 if (!_it->isEmpty() && _it->startsWith(_prefix)) {
1620 break;
1621 }
1622 }
1623 // we did a step - no matter of a matching prefix.
1624 wentNext = true;
1625 }
1626 return wentNext;
1627}
1628
1629/**
1630 * prev switches the history pointer to the previous item.

Callers 14

validateAndInterpretMethod · 0.45
onExecuteInConsoleMethod · 0.45
activatedMethod · 0.45
runMethod · 0.45
keyPressEventMethod · 0.45
appendOutputMethod · 0.45
prependMethod · 0.45
removeMethod · 0.45
replacePlaceholdersMethod · 0.45

Calls 3

cendMethod · 0.80
startsWithMethod · 0.80
isEmptyMethod · 0.45

Tested by 2

activatedMethod · 0.36
runMethod · 0.36