|
|
@ -198,26 +198,38 @@ void CSVWorld::ScriptSubView::useHint (const std::string& hint)
|
|
|
|
if (hint.empty())
|
|
|
|
if (hint.empty())
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (hint[0]=='l')
|
|
|
|
size_t line = 0, column = 0;
|
|
|
|
{
|
|
|
|
std::istringstream stream (hint.c_str()+2);
|
|
|
|
std::istringstream stream (hint.c_str()+1);
|
|
|
|
switch(hint[0]){
|
|
|
|
|
|
|
|
case 'R':
|
|
|
|
char ignore;
|
|
|
|
case 'r':
|
|
|
|
int line;
|
|
|
|
|
|
|
|
int column;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (stream >> ignore >> line >> column)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QTextCursor cursor = mEditor->textCursor();
|
|
|
|
QModelIndex index = mModel->getModelIndex (getUniversalId().getId(), mColumn);
|
|
|
|
|
|
|
|
QString source = mModel->data (index).toString();
|
|
|
|
cursor.movePosition (QTextCursor::Start);
|
|
|
|
size_t pos;
|
|
|
|
if (cursor.movePosition (QTextCursor::Down, QTextCursor::MoveAnchor, line))
|
|
|
|
stream >> pos >> pos;
|
|
|
|
cursor.movePosition (QTextCursor::Right, QTextCursor::MoveAnchor, column);
|
|
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i <= pos; ++i){
|
|
|
|
mEditor->setFocus();
|
|
|
|
if (source[(unsigned) i] == '\n'){
|
|
|
|
mEditor->setTextCursor (cursor);
|
|
|
|
++line;
|
|
|
|
|
|
|
|
column = i;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
column = pos - column - (line > 0 ? 1 : 0);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
case 'l':
|
|
|
|
|
|
|
|
stream >> line >> column;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QTextCursor cursor = mEditor->textCursor();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cursor.movePosition (QTextCursor::Start);
|
|
|
|
|
|
|
|
if (cursor.movePosition (QTextCursor::Down, QTextCursor::MoveAnchor, line))
|
|
|
|
|
|
|
|
cursor.movePosition (QTextCursor::Right, QTextCursor::MoveAnchor, column);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mEditor->setFocus();
|
|
|
|
|
|
|
|
mEditor->setTextCursor (cursor);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CSVWorld::ScriptSubView::textChanged()
|
|
|
|
void CSVWorld::ScriptSubView::textChanged()
|
|
|
|