// same Paragraph one to the right and make a rebreak
void Text::insertChar(Cursor & cur, char_type c)
{
// same Paragraph one to the right and make a rebreak
void Text::insertChar(Cursor & cur, char_type c)
{
LASSERT(cur.pos() > 0, /**/);
if ((par.isLineSeparator(cur.pos() - 1) || par.isNewline(cur.pos() - 1))
&& !par.isDeleted(cur.pos() - 1)) {
LASSERT(cur.pos() > 0, /**/);
if ((par.isLineSeparator(cur.pos() - 1) || par.isNewline(cur.pos() - 1))
&& !par.isDeleted(cur.pos() - 1)) {
&& !par.isWordSeparator(cur.pos() - 2)
&& par.isWordSeparator(cur.pos() - 1)) {
// get the word in front of cursor
&& !par.isWordSeparator(cur.pos() - 2)
&& par.isWordSeparator(cur.pos() - 1)) {
// get the word in front of cursor
// Skip through trailing punctuation and spaces.
while (pos != lastpos && (par.isChar(pos) || par.isSpace(pos)))
++pos;
// Skip through trailing punctuation and spaces.
while (pos != lastpos && (par.isChar(pos) || par.isSpace(pos)))
++pos;
if (pos == 0 && pit != 0)
return setCursor(cur, pit - 1, getPar(pit - 1).size());
if (pos == 0 && pit != 0)
return setCursor(cur, pit - 1, getPar(pit - 1).size());
// Skip through punctuation and spaces.
while (pos != 0 && (par.isChar(pos - 1) || par.isSpace(pos - 1)))
--pos;
// Skip through punctuation and spaces.
while (pos != 0 && (par.isChar(pos - 1) || par.isSpace(pos - 1)))
--pos;
pos_type left_pos, right_pos;
bool left_is_letter, right_is_letter;
pos_type left_pos, right_pos;
bool left_is_letter, right_is_letter;
pos_type left_pos, right_pos;
bool left_is_letter, right_is_letter;
pos_type left_pos, right_pos;
bool left_is_letter, right_is_letter;
if (cur.lastpos() == 0 && cur.lastpit() == 0)
return;
// If the cursor is at the beginning, make sure the cursor ends there
if (cur.lastpos() == 0 && cur.lastpit() == 0)
return;
// If the cursor is at the beginning, make sure the cursor ends there
// selection is currently set
bool Text::selectWordWhenUnderCursor(Cursor & cur, word_location loc)
{
// selection is currently set
bool Text::selectWordWhenUnderCursor(Cursor & cur, word_location loc)
{
// Returns the current font and depth as a message.
docstring Text::currentState(Cursor const & cur) const
{
// Returns the current font and depth as a message.
docstring Text::currentState(Cursor const & cur) const
{