}
case LFUN_PARAGRAPH_GOTO: {
- int const id = convert<int>(to_utf8(cmd.argument()));
+ int const id = convert<int>(cmd.getArg(0));
+ int const pos = convert<int>(cmd.getArg(1));
int i = 0;
for (Buffer * b = &buffer_; i == 0 || b != &buffer_;
b = theBufferList().next(b)) {
if (b == &buffer_) {
// Set the cursor
+ dit.pos() = pos;
setCursor(dit);
processUpdateFlags(Update::Force | Update::FitCursor);
} else {
FuncRequest TocItem::action() const
{
- return FuncRequest(LFUN_PARAGRAPH_GOTO, convert<string>(id()));
+ string const arg = convert<string>(dit_.paragraph().id())
+ + ' ' + convert<string>(dit_.pos());
+ return FuncRequest(LFUN_PARAGRAPH_GOTO, arg);
}
}
LASSERT(type >= 0 && type < int(models_.size()), /**/);
-
TocIterator const it = models_[type]->tocIterator(index);
-
LYXERR(Debug::GUI, "TocModels::goTo " << it->str());
-
- string const tmp = convert<string>(it->id());
- dispatch(FuncRequest(LFUN_PARAGRAPH_GOTO, tmp));
+ dispatch(it->action());
}