mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-09 18:52:46 +00:00
Martin's Per-buffer counters patch.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4948 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9681e21dae
commit
6894fa6008
@ -1,3 +1,19 @@
|
|||||||
|
2002-08-12 Martin Vermeer <martin.vermeer@hut.fi>
|
||||||
|
|
||||||
|
* buffer.C:
|
||||||
|
* buffer.h:
|
||||||
|
* lyxtext.h:
|
||||||
|
* paragraph.C:
|
||||||
|
* paragraph_pimpl.h:
|
||||||
|
* text.C:
|
||||||
|
* text2.C:
|
||||||
|
* undo_funcs.C: replaced per-paragraph counter logic by per-buffer, as
|
||||||
|
suggested by Angus.
|
||||||
|
Made updateCounter always count from start of buffer, and removed
|
||||||
|
second argument (par).
|
||||||
|
Reverted floats number display to '#'. Perhaps I'll try again when the
|
||||||
|
code base is sanitized a bit.
|
||||||
|
|
||||||
2002-08-12 Angus Leeming <leeming@lyx.org>
|
2002-08-12 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
* buffer.[Ch] (getLabelList): constify.
|
* buffer.[Ch] (getLabelList): constify.
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "bufferlist.h"
|
#include "bufferlist.h"
|
||||||
|
#include "counters.h"
|
||||||
#include "LyXAction.h"
|
#include "LyXAction.h"
|
||||||
#include "lyxrc.h"
|
#include "lyxrc.h"
|
||||||
#include "lyxlex.h"
|
#include "lyxlex.h"
|
||||||
@ -148,7 +149,7 @@ const int LYX_FORMAT = 220;
|
|||||||
Buffer::Buffer(string const & file, bool ronly)
|
Buffer::Buffer(string const & file, bool ronly)
|
||||||
: niceFile(true), lyx_clean(true), bak_clean(true),
|
: niceFile(true), lyx_clean(true), bak_clean(true),
|
||||||
unnamed(false), dep_clean(0), read_only(ronly),
|
unnamed(false), dep_clean(0), read_only(ronly),
|
||||||
filename_(file), users(0)
|
filename_(file), users(0), ctrs(new Counters)
|
||||||
{
|
{
|
||||||
lyxerr[Debug::INFO] << "Buffer::Buffer()" << endl;
|
lyxerr[Debug::INFO] << "Buffer::Buffer()" << endl;
|
||||||
// filename = file;
|
// filename = file;
|
||||||
@ -3860,6 +3861,12 @@ bool Buffer::isMultiLingual()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Counters & Buffer::counters() const
|
||||||
|
{
|
||||||
|
return *ctrs.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Buffer::inset_iterator::inset_iterator(Paragraph * paragraph, pos_type pos)
|
Buffer::inset_iterator::inset_iterator(Paragraph * paragraph, pos_type pos)
|
||||||
: par(paragraph)
|
: par(paragraph)
|
||||||
{
|
{
|
||||||
|
@ -27,9 +27,11 @@
|
|||||||
#include "ParagraphList.h"
|
#include "ParagraphList.h"
|
||||||
#include "paragraph.h"
|
#include "paragraph.h"
|
||||||
|
|
||||||
|
#include <boost/scoped_ptr.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
class BufferView;
|
class BufferView;
|
||||||
|
class Counters;
|
||||||
class LyXRC;
|
class LyXRC;
|
||||||
class TeXErrors;
|
class TeXErrors;
|
||||||
class LaTeXFeatures;
|
class LaTeXFeatures;
|
||||||
@ -317,6 +319,9 @@ public:
|
|||||||
|
|
||||||
/// Used when typesetting to place errorboxes.
|
/// Used when typesetting to place errorboxes.
|
||||||
TexRow texrow;
|
TexRow texrow;
|
||||||
|
/// Buffer-wide counter array
|
||||||
|
Counters & counters() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// is save needed
|
/// is save needed
|
||||||
mutable bool lyx_clean;
|
mutable bool lyx_clean;
|
||||||
@ -350,6 +355,9 @@ private:
|
|||||||
*/
|
*/
|
||||||
BufferView * users;
|
BufferView * users;
|
||||||
|
|
||||||
|
/// The pointer is const although its contents may not be
|
||||||
|
boost::scoped_ptr<Counters> const ctrs;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
class inset_iterator {
|
class inset_iterator {
|
||||||
|
@ -222,6 +222,7 @@ void Counters::reset(string const & match)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Counters::copy(Counters & from, Counters & to, string const & match)
|
void Counters::copy(Counters & from, Counters & to, string const & match)
|
||||||
{
|
{
|
||||||
CounterList::iterator it = counterList.begin();
|
CounterList::iterator it = counterList.begin();
|
||||||
@ -245,6 +246,7 @@ char loweralphaCounter(int n)
|
|||||||
return 'a' + n - 1;
|
return 'a' + n - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline
|
inline
|
||||||
char alphaCounter(int n)
|
char alphaCounter(int n)
|
||||||
{
|
{
|
||||||
@ -254,6 +256,7 @@ char alphaCounter(int n)
|
|||||||
return 'A' + n - 1;
|
return 'A' + n - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline
|
inline
|
||||||
char hebrewCounter(int n)
|
char hebrewCounter(int n)
|
||||||
{
|
{
|
||||||
@ -268,6 +271,7 @@ char hebrewCounter(int n)
|
|||||||
return hebrew[n-1];
|
return hebrew[n-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline
|
inline
|
||||||
string const romanCounter(int n)
|
string const romanCounter(int n)
|
||||||
{
|
{
|
||||||
@ -285,6 +289,7 @@ string const romanCounter(int n)
|
|||||||
|
|
||||||
} // namespace anon
|
} // namespace anon
|
||||||
|
|
||||||
|
|
||||||
string Counters::labelItem(string const & ctr,
|
string Counters::labelItem(string const & ctr,
|
||||||
string const & numbertype,
|
string const & numbertype,
|
||||||
string const & langtype,
|
string const & langtype,
|
||||||
@ -314,6 +319,7 @@ string Counters::labelItem(string const & ctr,
|
|||||||
return s.str();
|
return s.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string Counters::numberLabel(string const & ctr,
|
string Counters::numberLabel(string const & ctr,
|
||||||
string const & numbertype,
|
string const & numbertype,
|
||||||
string const & langtype,
|
string const & langtype,
|
||||||
|
@ -618,7 +618,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
/** Updates all counters starting BEHIND the row. Changed paragraphs
|
/** Updates all counters starting BEHIND the row. Changed paragraphs
|
||||||
* with a dynamic left margin will be rebroken. */
|
* with a dynamic left margin will be rebroken. */
|
||||||
void updateCounters(BufferView *, Row * row) const;
|
void updateCounters(BufferView *) const;
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
void setCounter(Buffer const *, Paragraph * par) const;
|
void setCounter(Buffer const *, Paragraph * par) const;
|
||||||
|
@ -2057,7 +2057,3 @@ bool Paragraph::isFreeSpacing() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Counters & Paragraph::counters()
|
|
||||||
{
|
|
||||||
return pimpl_->ctrs;
|
|
||||||
}
|
|
||||||
|
@ -145,8 +145,7 @@ struct Paragraph::Pimpl {
|
|||||||
static unsigned int paragraph_id;
|
static unsigned int paragraph_id;
|
||||||
///
|
///
|
||||||
ParagraphParameters params;
|
ParagraphParameters params;
|
||||||
///
|
|
||||||
Counters ctrs;
|
|
||||||
private:
|
private:
|
||||||
/// match a string against a particular point in the paragraph
|
/// match a string against a particular point in the paragraph
|
||||||
bool isTextAt(string const & str, lyx::pos_type pos) const;
|
bool isTextAt(string const & str, lyx::pos_type pos) const;
|
||||||
|
@ -1805,7 +1805,7 @@ void LyXText::breakParagraph(BufferView * bview, char keep_layout)
|
|||||||
|
|
||||||
insertParagraph(bview, cursor.par()->next(), cursor.row());
|
insertParagraph(bview, cursor.par()->next(), cursor.row());
|
||||||
|
|
||||||
updateCounters(bview, cursor.row()->previous());
|
updateCounters(bview);
|
||||||
|
|
||||||
// This check is necessary. Otherwise the new empty paragraph will
|
// This check is necessary. Otherwise the new empty paragraph will
|
||||||
// be deleted automatically. And it is more friendly for the user!
|
// be deleted automatically. And it is more friendly for the user!
|
||||||
@ -2818,7 +2818,7 @@ void LyXText::backspace(BufferView * bview)
|
|||||||
|
|
||||||
// This rebuilds the rows.
|
// This rebuilds the rows.
|
||||||
appendParagraph(bview, cursor.row());
|
appendParagraph(bview, cursor.row());
|
||||||
updateCounters(bview, cursor.row());
|
updateCounters(bview);
|
||||||
|
|
||||||
// the row may have changed, block, hfills etc.
|
// the row may have changed, block, hfills etc.
|
||||||
setCursor(bview, cursor.par(), cursor.pos(), false);
|
setCursor(bview, cursor.par(), cursor.pos(), false);
|
||||||
|
64
src/text2.C
64
src/text2.C
@ -542,7 +542,7 @@ void LyXText::setLayout(BufferView * bview, string const & layout)
|
|||||||
selection.start.pos(), false);
|
selection.start.pos(), false);
|
||||||
selection.cursor = cursor;
|
selection.cursor = cursor;
|
||||||
setCursor(bview, selection.end.par(), selection.end.pos(), false);
|
setCursor(bview, selection.end.par(), selection.end.pos(), false);
|
||||||
updateCounters(bview, cursor.row());
|
updateCounters(bview);
|
||||||
clearSelection();
|
clearSelection();
|
||||||
setSelection(bview);
|
setSelection(bview);
|
||||||
setCursor(bview, tmpcursor.par(), tmpcursor.pos(), true);
|
setCursor(bview, tmpcursor.par(), tmpcursor.pos(), true);
|
||||||
@ -619,7 +619,7 @@ void LyXText::incDepth(BufferView * bview)
|
|||||||
setCursor(bview, selection.start.par(), selection.start.pos());
|
setCursor(bview, selection.start.par(), selection.start.pos());
|
||||||
selection.cursor = cursor;
|
selection.cursor = cursor;
|
||||||
setCursor(bview, selection.end.par(), selection.end.pos());
|
setCursor(bview, selection.end.par(), selection.end.pos());
|
||||||
updateCounters(bview, cursor.row());
|
updateCounters(bview);
|
||||||
clearSelection();
|
clearSelection();
|
||||||
setSelection(bview);
|
setSelection(bview);
|
||||||
setCursor(bview, tmpcursor.par(), tmpcursor.pos());
|
setCursor(bview, tmpcursor.par(), tmpcursor.pos());
|
||||||
@ -676,7 +676,7 @@ void LyXText::decDepth(BufferView * bview)
|
|||||||
selection.start.pos());
|
selection.start.pos());
|
||||||
selection.cursor = cursor;
|
selection.cursor = cursor;
|
||||||
setCursor(bview, selection.end.par(), selection.end.pos());
|
setCursor(bview, selection.end.par(), selection.end.pos());
|
||||||
updateCounters(bview, cursor.row());
|
updateCounters(bview);
|
||||||
clearSelection();
|
clearSelection();
|
||||||
setSelection(bview);
|
setSelection(bview);
|
||||||
setCursor(bview, tmpcursor.par(), tmpcursor.pos());
|
setCursor(bview, tmpcursor.par(), tmpcursor.pos());
|
||||||
@ -883,6 +883,7 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
|
|||||||
|
|
||||||
if (tmprow && tmprow->next())
|
if (tmprow && tmprow->next())
|
||||||
setHeightOfRow(bview, tmprow->next());
|
setHeightOfRow(bview, tmprow->next());
|
||||||
|
updateCounters(bview);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1218,21 +1219,16 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
|
|||||||
LyXTextClass const & textclass = buf->params.getLyXTextClass();
|
LyXTextClass const & textclass = buf->params.getLyXTextClass();
|
||||||
LyXLayout_ptr const & layout = par->layout();
|
LyXLayout_ptr const & layout = par->layout();
|
||||||
|
|
||||||
// copy the prev-counters to this one,
|
|
||||||
// unless this is the first paragraph
|
|
||||||
if (par->previous()) {
|
if (par->previous()) {
|
||||||
|
|
||||||
par->counters().copy(par->previous()->counters(), par->counters(), "");
|
|
||||||
|
|
||||||
par->params().appendix(par->previous()->params().appendix());
|
par->params().appendix(par->previous()->params().appendix());
|
||||||
if (!par->params().appendix() && par->params().startOfAppendix()) {
|
if (!par->params().appendix() && par->params().startOfAppendix()) {
|
||||||
par->params().appendix(true);
|
par->params().appendix(true);
|
||||||
par->counters().reset();
|
buf->counters().reset();
|
||||||
}
|
}
|
||||||
par->enumdepth = par->previous()->enumdepth;
|
par->enumdepth = par->previous()->enumdepth;
|
||||||
par->itemdepth = par->previous()->itemdepth;
|
par->itemdepth = par->previous()->itemdepth;
|
||||||
} else {
|
} else {
|
||||||
par->counters().reset();
|
|
||||||
par->params().appendix(par->params().startOfAppendix());
|
par->params().appendix(par->params().startOfAppendix());
|
||||||
par->enumdepth = 0;
|
par->enumdepth = 0;
|
||||||
par->itemdepth = 0;
|
par->itemdepth = 0;
|
||||||
@ -1258,8 +1254,6 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
|
|||||||
&& par->previous()->getDepth() > par->getDepth()
|
&& par->previous()->getDepth() > par->getDepth()
|
||||||
&& layout->labeltype != LABEL_BIBLIO) {
|
&& layout->labeltype != LABEL_BIBLIO) {
|
||||||
par->enumdepth = par->depthHook(par->getDepth())->enumdepth;
|
par->enumdepth = par->depthHook(par->getDepth())->enumdepth;
|
||||||
par->counters().set(par->counters().enums[par->enumdepth],
|
|
||||||
par->depthHook(par->getDepth())->counters().value(par->counters().enums[par->enumdepth]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!par->params().labelString().empty()) {
|
if (!par->params().labelString().empty()) {
|
||||||
@ -1283,7 +1277,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
|
|||||||
|
|
||||||
if (i >= 0 && i<= buf->params.secnumdepth) {
|
if (i >= 0 && i<= buf->params.secnumdepth) {
|
||||||
|
|
||||||
par->counters().step(par->counters().sects[i]);
|
buf->counters().step(buf->counters().sects[i]);
|
||||||
|
|
||||||
// Is there a label? Useful for Chapter layout
|
// Is there a label? Useful for Chapter layout
|
||||||
if (!par->params().appendix()) {
|
if (!par->params().appendix()) {
|
||||||
@ -1310,28 +1304,28 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
|
|||||||
langtype = "latin";
|
langtype = "latin";
|
||||||
}
|
}
|
||||||
|
|
||||||
s << par->counters().numberLabel(par->counters().sects[i],
|
s << buf->counters().numberLabel(buf->counters().sects[i],
|
||||||
numbertype, langtype, head);
|
numbertype, langtype, head);
|
||||||
|
|
||||||
par->params().labelString(par->params().labelString() +s.str().c_str());
|
par->params().labelString(par->params().labelString() + s.str().c_str());
|
||||||
// We really want to remove the c_str as soon as
|
// We really want to remove the c_str as soon as
|
||||||
// possible...
|
// possible...
|
||||||
|
|
||||||
// reset enum counters
|
// reset enum counters
|
||||||
par->counters().reset("enum");
|
buf->counters().reset("enum");
|
||||||
} else if (layout->labeltype < LABEL_COUNTER_ENUMI) {
|
} else if (layout->labeltype < LABEL_COUNTER_ENUMI) {
|
||||||
par->counters().reset("enum");
|
buf->counters().reset("enum");
|
||||||
} else if (layout->labeltype == LABEL_COUNTER_ENUMI) {
|
} else if (layout->labeltype == LABEL_COUNTER_ENUMI) {
|
||||||
par->counters().step(par->counters().enums[par->enumdepth]);
|
buf->counters().step(buf->counters().enums[par->enumdepth]);
|
||||||
|
|
||||||
s << par->counters().numberLabel(par->counters().enums[par->enumdepth],
|
s << buf->counters().numberLabel(buf->counters().enums[par->enumdepth],
|
||||||
"enumeration", langtype);
|
"enumeration", langtype);
|
||||||
par->params().labelString(s.str().c_str());
|
par->params().labelString(s.str().c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (layout->labeltype == LABEL_BIBLIO) {// ale970302
|
} else if (layout->labeltype == LABEL_BIBLIO) {// ale970302
|
||||||
par->counters().step("bibitem");
|
buf->counters().step("bibitem");
|
||||||
int number = par->counters().value("bibitem");
|
int number = buf->counters().value("bibitem");
|
||||||
if (!par->bibkey) {
|
if (!par->bibkey) {
|
||||||
InsetCommandParams p("bibitem" );
|
InsetCommandParams p("bibitem" );
|
||||||
par->bibkey = new InsetBibKey(p);
|
par->bibkey = new InsetBibKey(p);
|
||||||
@ -1353,11 +1347,12 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
|
|||||||
Floating const & fl
|
Floating const & fl
|
||||||
= floatList.getType(tmp->type());
|
= floatList.getType(tmp->type());
|
||||||
|
|
||||||
// Why doesn't it work? -- MV
|
buf->counters().step(fl.name());
|
||||||
par->counters().step(fl.name());
|
|
||||||
// We should get the correct number here too.
|
// Doesn't work... yet.
|
||||||
ostringstream o;
|
ostringstream o;
|
||||||
o << fl.name() << " " << par->counters().value(fl.name()) << ":";
|
//o << fl.name() << " " << buf->counters().value(fl.name()) << ":";
|
||||||
|
o << fl.name() << " #:";
|
||||||
s = o.str();
|
s = o.str();
|
||||||
} else {
|
} else {
|
||||||
/* par->SetLayout(0);
|
/* par->SetLayout(0);
|
||||||
@ -1371,7 +1366,7 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
|
|||||||
/* reset the enumeration counter. They are always resetted
|
/* reset the enumeration counter. They are always resetted
|
||||||
* when there is any other layout between */
|
* when there is any other layout between */
|
||||||
for (int i = par->enumdepth + 1; i < 4; i++) {
|
for (int i = par->enumdepth + 1; i < 4; i++) {
|
||||||
par->counters().set(par->counters().enums[i], 0);
|
buf->counters().set(buf->counters().enums[i], 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1379,17 +1374,14 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
|
|||||||
|
|
||||||
// Updates all counters BEHIND the row. Changed paragraphs
|
// Updates all counters BEHIND the row. Changed paragraphs
|
||||||
// with a dynamic left margin will be rebroken.
|
// with a dynamic left margin will be rebroken.
|
||||||
void LyXText::updateCounters(BufferView * bview, Row * row) const
|
void LyXText::updateCounters(BufferView * bview) const
|
||||||
{
|
{
|
||||||
Paragraph * par;
|
Paragraph * par;
|
||||||
|
|
||||||
if (!row) {
|
Row * row = firstrow;
|
||||||
row = firstrow;
|
|
||||||
par = row->par();
|
par = row->par();
|
||||||
} else {
|
|
||||||
par = row->par()->next();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
bview->buffer()->counters().reset();
|
||||||
while (par) {
|
while (par) {
|
||||||
while (row->par() != par)
|
while (row->par() != par)
|
||||||
row = row->next();
|
row = row->next();
|
||||||
@ -1520,7 +1512,7 @@ void LyXText::cutSelection(BufferView * bview, bool doclear, bool realcut)
|
|||||||
|
|
||||||
setCursor(bview, cursor.par(), cursor.pos());
|
setCursor(bview, cursor.par(), cursor.pos());
|
||||||
selection.cursor = cursor;
|
selection.cursor = cursor;
|
||||||
updateCounters(bview, cursor.row());
|
updateCounters(bview);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1573,7 +1565,7 @@ void LyXText::pasteSelection(BufferView * bview)
|
|||||||
selection.cursor = cursor;
|
selection.cursor = cursor;
|
||||||
setCursor(bview, actpar, pos);
|
setCursor(bview, actpar, pos);
|
||||||
setSelection(bview);
|
setSelection(bview);
|
||||||
updateCounters(bview, cursor.row());
|
updateCounters(bview);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2319,7 +2311,7 @@ bool LyXText::deleteEmptyParagraphMechanism(BufferView * bview,
|
|||||||
* there is another layout before */
|
* there is another layout before */
|
||||||
if (refresh_row->next()) {
|
if (refresh_row->next()) {
|
||||||
breakAgain(bview, refresh_row->next());
|
breakAgain(bview, refresh_row->next());
|
||||||
updateCounters(bview, refresh_row);
|
updateCounters(bview);
|
||||||
}
|
}
|
||||||
setHeightOfRow(bview, refresh_row);
|
setHeightOfRow(bview, refresh_row);
|
||||||
} else {
|
} else {
|
||||||
@ -2352,7 +2344,7 @@ bool LyXText::deleteEmptyParagraphMechanism(BufferView * bview,
|
|||||||
there is another layout before */
|
there is another layout before */
|
||||||
if (refresh_row) {
|
if (refresh_row) {
|
||||||
breakAgain(bview, refresh_row);
|
breakAgain(bview, refresh_row);
|
||||||
updateCounters(bview, refresh_row->previous());
|
updateCounters(bview);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2395,7 +2387,7 @@ void LyXText::toggleAppendix(BufferView * bview)
|
|||||||
status(bview, LyXText::NEED_MORE_REFRESH);
|
status(bview, LyXText::NEED_MORE_REFRESH);
|
||||||
refresh_y = 0;
|
refresh_y = 0;
|
||||||
refresh_row = 0; // not needed for full update
|
refresh_row = 0; // not needed for full update
|
||||||
updateCounters(bview, 0);
|
updateCounters(bview);
|
||||||
setCursor(bview, cursor.par(), cursor.pos());
|
setCursor(bview, cursor.par(), cursor.pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ bool textHandleUndo(BufferView * bv, Undo & undo)
|
|||||||
// for an evt. new selection.
|
// for an evt. new selection.
|
||||||
t->clearSelection();
|
t->clearSelection();
|
||||||
t->selection.cursor = t->cursor;
|
t->selection.cursor = t->cursor;
|
||||||
t->updateCounters(bv, t->cursor.row());
|
t->updateCounters(bv);
|
||||||
bv->fitCursor();
|
bv->fitCursor();
|
||||||
}
|
}
|
||||||
bv->updateInset(it, false);
|
bv->updateInset(it, false);
|
||||||
@ -238,7 +238,7 @@ bool textHandleUndo(BufferView * bv, Undo & undo)
|
|||||||
// for an evt. new selection.
|
// for an evt. new selection.
|
||||||
t->clearSelection();
|
t->clearSelection();
|
||||||
t->selection.cursor = t->cursor;
|
t->selection.cursor = t->cursor;
|
||||||
t->updateCounters(bv, t->cursor.row());
|
t->updateCounters(bv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user