void () { addToHistory("a = 1"); addToHistory(""" def foo(): x = 1 y = 2 return x + y"""); runHistoryAction(true); checkCaretPosition(true); runHistoryAction(true); checkCaretPosition(true); runHistoryAction(false); checkCaretPosition(false); }