mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-28 12:26:59 +00:00
Amend bd21aa9
Check whether a line is actually blank rather than whether
we are at the beginning of a line.
(cherry picked from commit 976e0b7993
)
This commit is contained in:
parent
8d7b66e209
commit
3beb38c92e
2
ANNOUNCE
2
ANNOUNCE
@ -164,6 +164,8 @@ What's new
|
|||||||
|
|
||||||
- Fix loading order conflict with beamer-article and covington.
|
- Fix loading order conflict with beamer-article and covington.
|
||||||
|
|
||||||
|
- Preserve a new paragraph after a float (bug 11398).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* USER INTERFACE
|
* USER INTERFACE
|
||||||
|
@ -428,7 +428,7 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
|
|||||||
// signature needed by \lyxsout to correctly strike out display math
|
// signature needed by \lyxsout to correctly strike out display math
|
||||||
if (change.type == Change::DELETED && runparams.inDisplayMath
|
if (change.type == Change::DELETED && runparams.inDisplayMath
|
||||||
&& !dvipost) {
|
&& !dvipost) {
|
||||||
if (os.lastChar() == '\n')
|
if (os.blankLine())
|
||||||
str += from_ascii("\\\\\\noindent\n");
|
str += from_ascii("\\\\\\noindent\n");
|
||||||
else
|
else
|
||||||
str += from_ascii("\\\\\\\\\n");
|
str += from_ascii("\\\\\\\\\n");
|
||||||
|
@ -82,7 +82,7 @@ public:
|
|||||||
explicit otexstream(odocstream & os)
|
explicit otexstream(odocstream & os)
|
||||||
: otexrowstream(os), canbreakline_(false),
|
: otexrowstream(os), canbreakline_(false),
|
||||||
protectspace_(false), terminate_command_(false),
|
protectspace_(false), terminate_command_(false),
|
||||||
parbreak_(true), lastchar_(0) {}
|
parbreak_(true), blankline_(true), lastchar_(0) {}
|
||||||
///
|
///
|
||||||
void put(char_type const & c);
|
void put(char_type const & c);
|
||||||
///
|
///
|
||||||
@ -103,6 +103,7 @@ public:
|
|||||||
void lastChar(char_type const & c)
|
void lastChar(char_type const & c)
|
||||||
{
|
{
|
||||||
parbreak_ = (!canbreakline_ && c == '\n');
|
parbreak_ = (!canbreakline_ && c == '\n');
|
||||||
|
blankline_ = ((!canbreakline_ && c == ' ') || c == '\n');
|
||||||
canbreakline_ = (c != '\n');
|
canbreakline_ = (c != '\n');
|
||||||
lastchar_ = c;
|
lastchar_ = c;
|
||||||
}
|
}
|
||||||
@ -110,6 +111,8 @@ public:
|
|||||||
char_type lastChar() const { return lastchar_; }
|
char_type lastChar() const { return lastchar_; }
|
||||||
///
|
///
|
||||||
bool afterParbreak() const { return parbreak_; }
|
bool afterParbreak() const { return parbreak_; }
|
||||||
|
///
|
||||||
|
bool blankLine() const { return blankline_; }
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
bool canbreakline_;
|
bool canbreakline_;
|
||||||
@ -120,6 +123,8 @@ private:
|
|||||||
///
|
///
|
||||||
bool parbreak_;
|
bool parbreak_;
|
||||||
///
|
///
|
||||||
|
bool blankline_;
|
||||||
|
///
|
||||||
char_type lastchar_;
|
char_type lastchar_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user