mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Simplify and add debug message
This commit is contained in:
parent
e1492a3ab1
commit
2e45bade7a
@ -2344,15 +2344,9 @@ int BufferView::scrollUp(int offset)
|
||||
|
||||
|
||||
bool BufferView::setCursorFromRow(int row)
|
||||
{
|
||||
return setCursorFromRow(row, buffer_.texrow());
|
||||
}
|
||||
|
||||
|
||||
bool BufferView::setCursorFromRow(int row, TexRow const & texrow)
|
||||
{
|
||||
TextEntry start, end;
|
||||
tie(start,end) = texrow.getEntriesFromRow(row);
|
||||
tie(start,end) = buffer_.texrow().getEntriesFromRow(row);
|
||||
LYXERR(Debug::LATEX,
|
||||
"setCursorFromRow: for row " << row << ", TexRow has found "
|
||||
"start (id=" << start.id << ",pos=" << start.pos << "), "
|
||||
|
@ -164,8 +164,6 @@ public:
|
||||
|
||||
/// set the cursor based on the given TeX source row.
|
||||
bool setCursorFromRow(int row);
|
||||
///
|
||||
bool setCursorFromRow(int row, TexRow const & texrow);
|
||||
/// set the cursor based on the given start and end TextEntries.
|
||||
bool setCursorFromEntries(TextEntry start, TextEntry end);
|
||||
|
||||
|
@ -299,10 +299,15 @@ FuncRequest TexRow::goToFunc(TextEntry start, TextEntry end)
|
||||
}
|
||||
|
||||
|
||||
//static
|
||||
FuncRequest TexRow::goToFunc(std::pair<TextEntry,TextEntry> entries)
|
||||
FuncRequest TexRow::goToFuncFromRow(int const row) const
|
||||
{
|
||||
return goToFunc(entries.first, entries.second);
|
||||
TextEntry start, end;
|
||||
tie(start,end) = getEntriesFromRow(row);
|
||||
LYXERR(Debug::LATEX,
|
||||
"goToFuncFromRow: for row " << row << ", TexRow has found "
|
||||
"start (id=" << start.id << ",pos=" << start.pos << "), "
|
||||
"end (id=" << end.id << ",pos=" << end.pos << ")");
|
||||
return goToFunc(start, end);
|
||||
}
|
||||
|
||||
|
||||
|
@ -168,7 +168,8 @@ public:
|
||||
|
||||
// A FuncRequest to select from start to end
|
||||
static FuncRequest goToFunc(TextEntry start, TextEntry end);
|
||||
static FuncRequest goToFunc(std::pair<TextEntry,TextEntry> entries);
|
||||
// A FuncRequest to select a row
|
||||
FuncRequest goToFuncFromRow(int const row) const;
|
||||
|
||||
/**
|
||||
* getDocIteratorFromRow - find pids and positions for a given row
|
||||
|
@ -330,7 +330,7 @@ void ViewSourceWidget::goToCursor() const
|
||||
if (!texrow_)
|
||||
return;
|
||||
int row = viewSourceTV->textCursor().blockNumber() + 1;
|
||||
dispatch(TexRow::goToFunc(texrow_->getEntriesFromRow(row)));
|
||||
dispatch(texrow_->goToFuncFromRow(row));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user