# HG changeset patch # User Andriy Shinkarchuck # Date 1314404231 0 # Node ID 1347d498959cdafbf38e24182aed3dd2f515405c # Parent 7df7650492e85245c6653062ad4610af4bb6fd6c Comment/uncomment selected text operation can be undone with a single Undo action diff -r 7df7650492e8 -r 1347d498959c gui/src/FileEditorMdiSubWindow.cpp --- a/gui/src/FileEditorMdiSubWindow.cpp Fri Aug 26 13:40:10 2011 -0500 +++ b/gui/src/FileEditorMdiSubWindow.cpp Sat Aug 27 00:17:11 2011 +0000 @@ -268,6 +268,7 @@ m_editor->getSelection (&lineFrom,&colFrom,&lineTo,&colTo); if ( colTo == 0 ) // the beginning of last line is not selected lineTo--; // stop at line above + m_editor->beginUndoAction (); for ( i=lineFrom; i<=lineTo; i++ ) { if ( comment ) @@ -282,6 +283,7 @@ } } } + m_editor->endUndoAction (); } } @@ -479,8 +481,8 @@ nextBookmarkAction->setShortcut(Qt::Key_F2); prevBookmarkAction->setShortcut(Qt::SHIFT + Qt::Key_F2); toggleBookmarkAction->setShortcut(Qt::Key_F7); - commentSelectedAction->setShortcut(Qt::CTRL + Qt::Key_T); - uncommentSelectedAction->setShortcut(Qt::CTRL + Qt::Key_U); + commentSelectedAction->setShortcut(Qt::CTRL + Qt::Key_R); + uncommentSelectedAction->setShortcut(Qt::CTRL + Qt::Key_T); // toolbar m_toolBar->setIconSize(QSize(16,16)); // smaller icons (make configurable in user settings?)