Mercurial > hg > octave-nkf
diff gui/src/FileEditorMdiSubWindow.cpp @ 13656:1347d498959c
Comment/uncomment selected text operation can be undone with a single Undo action
author | Andriy Shinkarchuck <adriano32.gnu@gmail.com> |
---|---|
date | Sat, 27 Aug 2011 00:17:11 +0000 |
parents | c67f7d390a1a |
children | 347dfbea2c8a |
line wrap: on
line diff
--- a/gui/src/FileEditorMdiSubWindow.cpp +++ b/gui/src/FileEditorMdiSubWindow.cpp @@ -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?)