1+
12/* *****************************************************************************
23 * MODULE : archiver.cpp
34 * DESCRIPTION: manage undo/redo history
1415#include " observers.hpp"
1516#include " tm_debug.hpp"
1617#include " tree.hpp"
17- #include " tree_helper.hpp"
1818#include " tree_observer.hpp"
1919#include " tree_patch.hpp"
2020
@@ -323,14 +323,15 @@ archiver_rep::confirm () {
323323 if (nr_children (remove_set_cursor (current)) == 0 )
324324 current= make_compound (0 );
325325 if (active ()) {
326+ // cout << "Confirm " << current << "\n";
326327 archive = patch (current, archive);
327328 current = make_compound (0 );
328329 the_owner= 0 ;
329330 depth++;
330331 if (depth <= last_save) last_save= -1 ;
331332 if (depth <= last_autosave) last_autosave= -1 ;
332333 normalize ();
333- show_all ();
334+ // show_all ();
334335 }
335336 }
336337}
@@ -419,11 +420,7 @@ archiver_rep::redo_possibilities () {
419420
420421path
421422archiver_rep::undo_one (int i) {
422- if (active ()) {
423- cout << " Cannot undo while modifications are active\n " ;
424- return path ();
425- }
426- cout << " undo_possibilities(): " << undo_possibilities () << " \n " ;
423+ if (active ()) return path ();
427424 if (undo_possibilities () != 0 ) {
428425 ASSERT (i == 0 , " index out of range" );
429426 patch p= car (get_undo (archive));
@@ -438,8 +435,7 @@ archiver_rep::undo_one (int i) {
438435 archive = make_history (un, re);
439436 depth--;
440437 // show_all ();
441- path cursor_pos= cursor_hint (q, the_et);
442- return cursor_pos;
438+ return cursor_hint (q, the_et);
443439 }
444440 return path ();
445441}
0 commit comments