aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/editor/ScriptEditorImplementation.cpp
diff options
context:
space:
mode:
authorGravatar un1versal2016-07-02 12:07:55 +0100
committerGravatar staticfox2016-07-19 05:03:57 -0400
commitc67b91eb53f88d79daaed98765634bd3758c209a (patch)
tree018a9eb13b06303945ad86589e5110b2c11c628a /src/modules/editor/ScriptEditorImplementation.cpp
parentKTorrentDbusInterface: Dont state opinions in description of interface (diff)
downloadKVIrc-c67b91eb53f88d79daaed98765634bd3758c209a.tar.gz
KVIrc-c67b91eb53f88d79daaed98765634bd3758c209a.tar.bz2
KVIrc-c67b91eb53f88d79daaed98765634bd3758c209a.zip
Row/Col: Rename row to line and dont use 0 base for first line
without this patch when theres a KVS error you are pointed to a specific line x near char y but when you open an editor the error is in fact on the previous line
Diffstat (limited to 'src/modules/editor/ScriptEditorImplementation.cpp')
-rw-r--r--src/modules/editor/ScriptEditorImplementation.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/editor/ScriptEditorImplementation.cpp b/src/modules/editor/ScriptEditorImplementation.cpp
index a13f239c8..0d7d75d7d 100644
--- a/src/modules/editor/ScriptEditorImplementation.cpp
+++ b/src/modules/editor/ScriptEditorImplementation.cpp
@@ -762,7 +762,7 @@ ScriptEditorImplementation::ScriptEditorImplementation(QWidget * par)
pLab->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
g->addWidget(pLab, 1, 1);
- m_pRowColLabel = new QLabel(QString(__tr2qs_ctx("Line: %1 Col: %2", "editor")).arg(0).arg(0), this);
+ m_pRowColLabel = new QLabel(QString(__tr2qs_ctx("Line: %1 Col: %2", "editor")).arg(1).arg(1), this);
m_pRowColLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
m_pRowColLabel->setMinimumWidth(80);
g->addWidget(m_pRowColLabel, 1, 3);
@@ -937,8 +937,8 @@ void ScriptEditorImplementation::updateRowColLabel()
{
if(m_lastCursorPos == m_pEditor->textCursor().position())
return;
- int iRow = m_pEditor->textCursor().blockNumber();
- int iCol = m_pEditor->textCursor().columnNumber();
+ int iRow = m_pEditor->textCursor().blockNumber() + 1;
+ int iCol = m_pEditor->textCursor().columnNumber() + 1;
QString szTmp = QString(__tr2qs_ctx("Line: %1 Col: %2", "editor")).arg(iRow).arg(iCol);
m_pRowColLabel->setText(szTmp);
m_lastCursorPos = m_pEditor->textCursor().position();