public:
///
TextCompletionList(Cursor const & cur, WordList const * list)
- : buffer_(cur.buffer()), pos_(0), list_(list)
+ : buffer_(cur.buffer()), list_(list)
{}
///
virtual ~TextCompletionList() {}
///
Buffer const * buffer_;
///
- size_t pos_;
- ///
WordList const * list_;
};
void Text::breakParagraph(Cursor & cur, bool inverse_logic)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
Paragraph & cpar = cur.paragraph();
pit_type cpit = cur.pit();
// same Paragraph one to the right and make a rebreak
void Text::insertChar(Cursor & cur, char_type c)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
cur.recordUndo(INSERT_UNDO);
&& !par.isWordSeparator(cur.pos() - 2)
&& par.isWordSeparator(cur.pos() - 1)) {
// get the word in front of cursor
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
cur.paragraph().updateWords();
}
}
bool Text::cursorForwardOneWord(Cursor & cur)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
pos_type const lastpos = cur.lastpos();
pit_type pit = cur.pit();
bool Text::cursorBackwardOneWord(Cursor & cur)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
pit_type pit = cur.pit();
pos_type pos = cur.pos();
bool Text::cursorVisLeftOneWord(Cursor & cur)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
pos_type left_pos, right_pos;
bool left_is_letter, right_is_letter;
bool Text::cursorVisRightOneWord(Cursor & cur)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
pos_type left_pos, right_pos;
bool left_is_letter, right_is_letter;
void Text::selectWord(Cursor & cur, word_location loc)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
CursorSlice from = cur.top();
CursorSlice to = cur.top();
getWord(from, to, loc);
void Text::selectAll(Cursor & cur)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
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)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
if (cur.selection())
return false;
selectWord(cur, loc);
void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
if (!cur.selection()) {
bool const changed = cur.paragraph().isChanged(cur.pos());
void Text::deleteWordForward(Cursor & cur)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
if (cur.lastpos() == 0)
cursorForward(cur);
else {
void Text::deleteWordBackward(Cursor & cur)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
if (cur.lastpos() == 0)
cursorBackward(cur);
else {
// Kill to end of line.
void Text::changeCase(Cursor & cur, TextCase action)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
CursorSlice from;
CursorSlice to;
bool Text::backspacePos0(Cursor & cur)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
if (cur.pit() == 0)
return false;
bool Text::backspace(Cursor & cur)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
bool needsUpdate = false;
if (cur.pos() == 0) {
if (cur.pit() == 0)
// Returns the current font and depth as a message.
docstring Text::currentState(Cursor const & cur) const
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
Buffer & buf = *cur.buffer();
Paragraph const & par = cur.paragraph();
odocstringstream os;
void Text::charsTranspose(Cursor & cur)
{
- LBUFERR(this == cur.text(), _("Invalid cursor."));
+ LBUFERR(this == cur.text());
pos_type pos = cur.pos();
bool Text::insertCompletion(Cursor & cur, docstring const & s, bool /*finished*/)
{
- LBUFERR(cur.bv().cursor() == cur, _("Invalid cursor."));
+ LBUFERR(cur.bv().cursor() == cur);
cur.insert(s);
cur.bv().cursor() = cur;
if (!(cur.result().screenUpdate() & Update::Force))