mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 10:52:51 +00:00
dolphin: move the cursor to the start of the diff document on setup
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
2ee80d816c
commit
c5dd9b7e94
1 changed files with 4 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
#include <kdebug.h>
|
||||
#include <KTextEditor/View>
|
||||
#include <KTextEditor/ConfigInterface>
|
||||
#include <KTextEditor/Cursor>
|
||||
|
||||
#include <git2/buffer.h>
|
||||
#include <git2/message.h>
|
||||
|
@ -86,8 +87,11 @@ void GitCommitDialog::setupWidgets(const QStringList &changedfiles, const QStrin
|
|||
{
|
||||
m_changedfiles->setText(changedfiles.join(QLatin1String("\n")));
|
||||
if (m_diffdocument) {
|
||||
// NOTE: can't set the text in read-only mode
|
||||
m_diffdocument->setReadWrite(true);
|
||||
m_diffdocument->setText(diff);
|
||||
// NOTE: after KTextEditor::Document::setText() the cursor is at the end
|
||||
m_diffdocument->activeView()->setCursorPosition(KTextEditor::Cursor::start());
|
||||
m_diffdocument->setReadWrite(false);
|
||||
} else {
|
||||
m_difffiles->setText(diff);
|
||||
|
|
Loading…
Add table
Reference in a new issue