diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h index 34225188708..2b66a01b8ba 100644 --- a/src/plugins/coreplugin/coreconstants.h +++ b/src/plugins/coreplugin/coreconstants.h @@ -159,6 +159,7 @@ const char G_EDIT_OTHER[] = "QtCreator.Group.Edit.Other"; // Advanced edit menu groups const char G_EDIT_FORMAT[] = "QtCreator.Group.Edit.Format"; const char G_EDIT_COLLAPSING[] = "QtCreator.Group.Edit.Collapsing"; +const char G_EDIT_TEXT[] = "QtCreator.Group.Edit.Text"; const char G_EDIT_BLOCKS[] = "QtCreator.Group.Edit.Blocks"; const char G_EDIT_FONT[] = "QtCreator.Group.Edit.Font"; const char G_EDIT_EDITOR[] = "QtCreator.Group.Edit.Editor"; diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index fa7d79fecff..944399adc41 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -411,12 +411,14 @@ EditorManager::EditorManager(QWidget *parent) : medit->addMenu(advancedMenu, Constants::G_EDIT_ADVANCED); advancedMenu->menu()->setTitle(tr("Ad&vanced")); advancedMenu->appendGroup(Constants::G_EDIT_FORMAT); + advancedMenu->appendGroup(Constants::G_EDIT_TEXT); advancedMenu->appendGroup(Constants::G_EDIT_COLLAPSING); advancedMenu->appendGroup(Constants::G_EDIT_BLOCKS); advancedMenu->appendGroup(Constants::G_EDIT_FONT); advancedMenu->appendGroup(Constants::G_EDIT_EDITOR); // Advanced menu separators + advancedMenu->addSeparator(editManagerContext, Constants::G_EDIT_TEXT); advancedMenu->addSeparator(editManagerContext, Constants::G_EDIT_COLLAPSING); advancedMenu->addSeparator(editManagerContext, Constants::G_EDIT_BLOCKS); advancedMenu->addSeparator(editManagerContext, Constants::G_EDIT_FONT); diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index b52966ab168..0a780d4ac58 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -5060,6 +5060,8 @@ void BaseTextEditorWidget::copyLine() QTextCursor prevCursor = textCursor(); maybeSelectLine(); copy(); + if (!prevCursor.hasSelection()) + prevCursor.movePosition(QTextCursor::StartOfBlock); setTextCursor(prevCursor); } diff --git a/src/plugins/texteditor/texteditoractionhandler.cpp b/src/plugins/texteditor/texteditoractionhandler.cpp index 7e5f9d45dc4..02947de08bd 100644 --- a/src/plugins/texteditor/texteditoractionhandler.cpp +++ b/src/plugins/texteditor/texteditoractionhandler.cpp @@ -136,12 +136,6 @@ void TextEditorActionHandler::createActions() SLOT(gotoAction())); m_printAction = registerAction(PRINT, SLOT(printAction())); - m_cutLineAction = registerAction(CUT_LINE, - SLOT(cutLine()), true, tr("Cut &Line"), - QKeySequence(tr("Shift+Del"))); - m_copyLineAction = registerAction(COPY_LINE, - SLOT(copyLine()), false, tr("Copy &Line"), - QKeySequence(tr("Ctrl+Ins"))); m_deleteLineAction = registerAction(DELETE_LINE, SLOT(deleteLine()), true, tr("Delete &Line")); m_deleteEndOfWordAction = registerAction(DELETE_END_OF_WORD, @@ -241,6 +235,14 @@ void TextEditorActionHandler::createActions() SLOT(unCommentSelection()), true, tr("Toggle Comment &Selection"), QKeySequence(tr("Ctrl+/")), G_EDIT_FORMAT, advancedEditMenu); + m_cutLineAction = registerAction(CUT_LINE, + SLOT(cutLine()), true, tr("Cut &Line"), + QKeySequence(tr("Shift+Del")), + G_EDIT_TEXT, advancedEditMenu); + m_copyLineAction = registerAction(COPY_LINE, + SLOT(copyLine()), false, tr("Copy &Line"), + QKeySequence(tr("Ctrl+Ins")), + G_EDIT_TEXT, advancedEditMenu); m_foldAction = registerAction(FOLD, SLOT(fold()), true, tr("Fold"), QKeySequence(tr("Ctrl+<")),