• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • buffer
katetextblock.cpp
Go to the documentation of this file.
1 /* This file is part of the Kate project.
2  *
3  * Copyright (C) 2010 Christoph Cullmann <cullmann@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #include "katetextblock.h"
22 #include "katetextbuffer.h"
23 
24 namespace Kate {
25 
26 TextBlock::TextBlock (TextBuffer *buffer, int startLine)
27  : m_buffer (buffer)
28  , m_startLine (startLine)
29 {
30  // reserve the block size
31  m_lines.reserve (m_buffer->m_blockSize);
32 }
33 
34 TextBlock::~TextBlock ()
35 {
36  // blocks should be empty before they are deleted!
37  Q_ASSERT (m_lines.empty());
38  Q_ASSERT (m_cursors.empty());
39 
40  // it only is a hint for ranges for this block, not the storage of them
41 }
42 
43 void TextBlock::setStartLine (int startLine)
44 {
45  // allow only valid lines
46  Q_ASSERT (startLine >= 0);
47  Q_ASSERT (startLine < m_buffer->lines ());
48 
49  m_startLine = startLine;
50 }
51 
52 TextLine TextBlock::line (int line) const
53 {
54  // right input
55  Q_ASSERT (line >= startLine ());
56 
57  // calc internal line
58  line = line - startLine ();
59 
60  // in range
61  Q_ASSERT (line < m_lines.size ());
62 
63  // get text line
64  return m_lines.at(line);
65 }
66 
67 void TextBlock::appendLine (const QString &textOfLine)
68 {
69  m_lines.append (TextLine (new TextLineData(textOfLine)));
70 }
71 
72 void TextBlock::clearLines ()
73 {
74  m_lines.clear ();
75 }
76 
77 void TextBlock::text (QString &text) const
78 {
79  // combine all lines
80  for (int i = 0; i < m_lines.size(); ++i) {
81  // not first line, insert \n
82  if (i > 0 || startLine() > 0)
83  text.append ('\n');
84 
85  text.append (m_lines.at(i)->text ());
86  }
87 }
88 
89 void TextBlock::wrapLine (const KTextEditor::Cursor &position, int fixStartLinesStartIndex)
90 {
91  // calc internal line
92  int line = position.line () - startLine ();
93 
94  // get text
95  QString &text = m_lines.at(line)->textReadWrite ();
96 
97  // check if valid column
98  Q_ASSERT (position.column() >= 0);
99  Q_ASSERT (position.column() <= text.size());
100 
101  // create new line and insert it
102  m_lines.insert (m_lines.begin() + line + 1, TextLine (new TextLineData()));
103 
104  // cases for modification:
105  // 1. line is wrapped in the middle
106  // 2. if empty line is wrapped, mark new line as modified
107  // 3. line-to-be-wrapped is already modified
108  if (position.column() > 0 || text.size() == 0 || m_lines.at(line)->markedAsModified()) {
109  m_lines.at(line + 1)->markAsModified(true);
110  } else if (m_lines.at(line)->markedAsSavedOnDisk()) {
111  m_lines.at(line + 1)->markAsSavedOnDisk(true);
112  }
113 
114  // perhaps remove some text from previous line and append it
115  if (position.column() < text.size ()) {
116  // text from old line moved first to new one
117  m_lines.at(line+1)->textReadWrite() = text.right (text.size() - position.column());
118 
119  // now remove wrapped text from old line
120  text.chop (text.size() - position.column());
121 
122  // mark line as modified
123  m_lines.at(line)->markAsModified(true);
124  }
125 
131  m_buffer->fixStartLines (fixStartLinesStartIndex);
132 
136  m_buffer->history().wrapLine (position);
137 
142  // no cursors will leave or join this block
143 
144  // no cursors in this block, no work to do..
145  if (m_cursors.empty())
146  return;
147 
148  // move all cursors on the line which has the text inserted
149  // remember all ranges modified
150  QSet<TextRange *> changedRanges;
151  foreach (TextCursor *cursor, m_cursors) {
152  // skip cursors on lines in front of the wrapped one!
153  if (cursor->lineInBlock() < line)
154  continue;
155 
156  // either this is simple, line behind the wrapped one
157  if (cursor->lineInBlock() > line) {
158  // patch line of cursor
159  cursor->m_line++;
160  }
161 
162  // this is the wrapped line
163  else {
164  // skip cursors with too small column
165  if (cursor->column() <= position.column()) {
166  if (cursor->column() < position.column() || !cursor->m_moveOnInsert)
167  continue;
168  }
169 
170  // move cursor
171 
172  // patch line of cursor
173  cursor->m_line++;
174 
175  // patch column
176  cursor->m_column -= position.column();
177  }
178 
179  // remember range, if any
180  if (cursor->kateRange())
181  changedRanges.insert (cursor->kateRange());
182  }
183 
184  // check validity of all ranges, might invalidate them...
185  foreach (TextRange *range, changedRanges)
186  range->checkValidity ();
187 }
188 
189 void TextBlock::unwrapLine (int line, TextBlock *previousBlock, int fixStartLinesStartIndex)
190 {
191  // calc internal line
192  line = line - startLine ();
193 
194  // two possiblities: either first line of this block or later line
195  if (line == 0) {
196  // we need previous block with at least one line
197  Q_ASSERT (previousBlock);
198  Q_ASSERT (previousBlock->lines () > 0);
199 
200  // move last line of previous block to this one, might result in empty block
201  TextLine oldFirst = m_lines.at(0);
202  int lastLineOfPreviousBlock = previousBlock->lines ()-1;
203  TextLine newFirst = previousBlock->m_lines.last();
204  m_lines[0] = newFirst;
205  previousBlock->m_lines.erase (previousBlock->m_lines.begin() + (previousBlock->lines () - 1));
206 
207  const int oldSizeOfPreviousLine = newFirst->text().size();
208  if (oldFirst->length() > 0) {
209  // append text
210  newFirst->textReadWrite().append (oldFirst->text());
211 
212  // mark line as modified, since text was appended
213  newFirst->markAsModified(true);
214  }
215 
216  // patch startLine of this block
217  --m_startLine;
218 
224  m_buffer->fixStartLines (fixStartLinesStartIndex);
225 
229  m_buffer->history().unwrapLine (startLine () + line, oldSizeOfPreviousLine);
230 
235  // no cursors in this block and the previous one, no work to do..
236  if (m_cursors.empty() && previousBlock->m_cursors.empty())
237  return;
238 
239  // move all cursors because of the unwrapped line
240  // remember all ranges modified
241  QSet<TextRange *> changedRanges;
242  foreach (TextCursor *cursor, m_cursors) {
243  // this is the unwrapped line
244  if (cursor->lineInBlock() == 0) {
245  // patch column
246  cursor->m_column += oldSizeOfPreviousLine;
247 
248  // remember range, if any
249  if (cursor->kateRange())
250  changedRanges.insert (cursor->kateRange());
251  }
252  }
253 
254  // move cursors of the moved line from previous block to this block now
255  QSet<TextCursor *> newPreviousCursors;
256  foreach (TextCursor *cursor, previousBlock->m_cursors) {
257  if (cursor->lineInBlock() == lastLineOfPreviousBlock) {
258  cursor->m_line = 0;
259  cursor->m_block = this;
260  m_cursors.insert (cursor);
261 
262  // remember range, if any
263  if (cursor->kateRange())
264  changedRanges.insert (cursor->kateRange());
265  }
266  else
267  newPreviousCursors.insert (cursor);
268  }
269  previousBlock->m_cursors = newPreviousCursors;
270 
271  // fixup the ranges that might be effected, because they moved from last line to this block
272  foreach (TextRange *range, changedRanges) {
273  // update both blocks
274  updateRange (range);
275  previousBlock->updateRange (range);
276  }
277 
278  // check validity of all ranges, might invalidate them...
279  foreach (TextRange *range, changedRanges)
280  range->checkValidity ();
281 
282  // be done
283  return;
284  }
285 
286  // easy: just move text to previous line and remove current one
287  const int oldSizeOfPreviousLine = m_lines.at(line-1)->length();
288  const int sizeOfCurrentLine = m_lines.at(line)->length();
289  if (sizeOfCurrentLine > 0)
290  m_lines.at(line-1)->textReadWrite().append (m_lines.at(line)->text());
291 
292  const bool lineChanged = (oldSizeOfPreviousLine > 0 && m_lines.at(line - 1)->markedAsModified())
293  || (sizeOfCurrentLine > 0 && (oldSizeOfPreviousLine > 0 || m_lines.at(line)->markedAsModified()));
294  m_lines.at(line-1)->markAsModified(lineChanged);
295  if (oldSizeOfPreviousLine == 0 && m_lines.at(line)->markedAsSavedOnDisk())
296  m_lines.at(line-1)->markAsSavedOnDisk(true);
297 
298  m_lines.erase (m_lines.begin () + line);
299 
305  m_buffer->fixStartLines (fixStartLinesStartIndex);
306 
310  m_buffer->history().unwrapLine (startLine () + line, oldSizeOfPreviousLine);
311 
316  // no cursors in this block, no work to do..
317  if (m_cursors.empty())
318  return;
319 
320  // move all cursors because of the unwrapped line
321  // remember all ranges modified
322  QSet<TextRange *> changedRanges;
323  foreach (TextCursor *cursor, m_cursors) {
324  // skip cursors in lines in front of removed one
325  if (cursor->lineInBlock() < line)
326  continue;
327 
328  // this is the unwrapped line
329  if (cursor->lineInBlock() == line) {
330  // patch column
331  cursor->m_column += oldSizeOfPreviousLine;
332  }
333 
334  // patch line of cursor
335  cursor->m_line--;
336 
337  // remember range, if any
338  if (cursor->kateRange())
339  changedRanges.insert (cursor->kateRange());
340  }
341 
342  // check validity of all ranges, might invalidate them...
343  foreach (TextRange *range, changedRanges)
344  range->checkValidity ();
345 }
346 
347 void TextBlock::insertText (const KTextEditor::Cursor &position, const QString &text)
348 {
349  // calc internal line
350  int line = position.line () - startLine ();
351 
352  // get text
353  QString &textOfLine = m_lines.at(line)->textReadWrite ();
354  int oldLength = textOfLine.size ();
355  m_lines.at(line)->markAsModified(true);
356 
357  // check if valid column
358  Q_ASSERT (position.column() >= 0);
359  Q_ASSERT (position.column() <= textOfLine.size());
360 
361  // insert text
362  textOfLine.insert (position.column(), text);
363 
367  m_buffer->history().insertText (position, text.size(), oldLength);
368 
373  // no cursors in this block, no work to do..
374  if (m_cursors.empty())
375  return;
376 
377  // move all cursors on the line which has the text inserted
378  // remember all ranges modified
379  QSet<TextRange *> changedRanges;
380  foreach (TextCursor *cursor, m_cursors) {
381  // skip cursors not on this line!
382  if (cursor->lineInBlock() != line)
383  continue;
384 
385  // skip cursors with too small column
386  if (cursor->column() <= position.column()) {
387  if (cursor->column() < position.column() || !cursor->m_moveOnInsert)
388  continue;
389  }
390 
391  // patch column of cursor
392  if (cursor->m_column <= oldLength)
393  cursor->m_column += text.size ();
394 
395  // special handling if cursor behind the real line, e.g. non-wrapping cursor in block selection mode
396  else if (cursor->m_column < textOfLine.size())
397  cursor->m_column = textOfLine.size();
398 
399  // remember range, if any
400  if (cursor->kateRange())
401  changedRanges.insert (cursor->kateRange());
402  }
403 
404  // check validity of all ranges, might invalidate them...
405  foreach (TextRange *range, changedRanges)
406  range->checkValidity ();
407 }
408 
409 void TextBlock::removeText (const KTextEditor::Range &range, QString &removedText)
410 {
411  // calc internal line
412  int line = range.start().line () - startLine ();
413 
414  // get text
415  QString &textOfLine = m_lines.at(line)->textReadWrite ();
416  int oldLength = textOfLine.size ();
417 
418  // check if valid column
419  Q_ASSERT (range.start().column() >= 0);
420  Q_ASSERT (range.start().column() <= textOfLine.size());
421  Q_ASSERT (range.end().column() >= 0);
422  Q_ASSERT (range.end().column() <= textOfLine.size());
423 
424  // get text which will be removed
425  removedText = textOfLine.mid (range.start().column(), range.end().column() - range.start().column());
426 
427  // remove text
428  textOfLine.remove (range.start().column(), range.end().column() - range.start().column());
429  m_lines.at(line)->markAsModified(true);
430 
434  m_buffer->history().removeText (range, oldLength);
435 
440  // no cursors in this block, no work to do..
441  if (m_cursors.empty())
442  return;
443 
444  // move all cursors on the line which has the text removed
445  // remember all ranges modified
446  QSet<TextRange *> changedRanges;
447  foreach (TextCursor *cursor, m_cursors) {
448  // skip cursors not on this line!
449  if (cursor->lineInBlock() != line)
450  continue;
451 
452  // skip cursors with too small column
453  if (cursor->column() <= range.start().column())
454  continue;
455 
456  // patch column of cursor
457  if (cursor->column() <= range.end().column())
458  cursor->m_column = range.start().column ();
459  else
460  cursor->m_column -= (range.end().column() - range.start().column());
461 
462  // remember range, if any
463  if (cursor->kateRange())
464  changedRanges.insert (cursor->kateRange());
465  }
466 
467  // check validity of all ranges, might invalidate them...
468  foreach (TextRange *range, changedRanges)
469  range->checkValidity ();
470 }
471 
472 void TextBlock::debugPrint (int blockIndex) const
473 {
474  // print all blocks
475  for (int i = 0; i < m_lines.size(); ++i)
476  printf ("%4d - %4d : %4d : '%s'\n", blockIndex, startLine() + i
477  , m_lines.at(i)->text().size(), qPrintable (m_lines.at(i)->text()));
478 }
479 
480 TextBlock *TextBlock::splitBlock (int fromLine)
481 {
482  // half the block
483  int linesOfNewBlock = lines () - fromLine;
484 
485  // create and insert new block
486  TextBlock *newBlock = new TextBlock (m_buffer, startLine() + fromLine);
487 
488  // move lines
489  newBlock->m_lines.reserve (linesOfNewBlock);
490  for (int i = fromLine; i < m_lines.size(); ++i)
491  newBlock->m_lines.append (m_lines.at(i));
492  m_lines.resize (fromLine);
493 
494  // move cursors
495  QSet<TextCursor*> oldBlockSet;
496  foreach (TextCursor *cursor, m_cursors) {
497  if (cursor->lineInBlock() >= fromLine) {
498  cursor->m_line = cursor->lineInBlock() - fromLine;
499  cursor->m_block = newBlock;
500  newBlock->m_cursors.insert (cursor);
501  }
502  else
503  oldBlockSet.insert (cursor);
504  }
505  m_cursors = oldBlockSet;
506 
507  // fix ALL ranges!
508  QList<TextRange*> allRanges = m_uncachedRanges.toList() + m_cachedLineForRanges.keys();
509  foreach (TextRange *range, allRanges) {
510  // update both blocks
511  updateRange (range);
512  newBlock->updateRange (range);
513  }
514 
515  // return the new generated block
516  return newBlock;
517 }
518 
519 void TextBlock::mergeBlock (TextBlock *targetBlock)
520 {
521  // move cursors, do this first, now still lines() count is correct for target
522  foreach (TextCursor *cursor, m_cursors) {
523  cursor->m_line = cursor->lineInBlock() + targetBlock->lines ();
524  cursor->m_block = targetBlock;
525  targetBlock->m_cursors.insert (cursor);
526  }
527  m_cursors.clear ();
528 
529  // move lines
530  targetBlock->m_lines.reserve (targetBlock->lines() + lines ());
531  for (int i = 0; i < m_lines.size(); ++i)
532  targetBlock->m_lines.append (m_lines.at(i));
533  m_lines.clear ();
534 
535  // fix ALL ranges!
536  QList<TextRange*> allRanges = m_uncachedRanges.toList() + m_cachedLineForRanges.keys();
537  foreach(TextRange* range, allRanges) {
538  // update both blocks
539  updateRange (range);
540  targetBlock->updateRange (range);
541  }
542 }
543 
544 void TextBlock::deleteBlockContent ()
545 {
546  // kill cursors, if not belonging to a range
547  QSet<TextCursor *> copy = m_cursors;
548  foreach (TextCursor *cursor, copy)
549  if (!cursor->kateRange())
550  delete cursor;
551 
552  // kill lines
553  m_lines.clear ();
554 }
555 
556 void TextBlock::clearBlockContent (TextBlock *targetBlock)
557 {
558  // move cursors, if not belonging to a range
559  QSet<TextCursor *> copy = m_cursors;
560  foreach (TextCursor *cursor, copy) {
561  if (!cursor->kateRange()) {
562  cursor->m_column = 0;
563  cursor->m_line = 0;
564  cursor->m_block = targetBlock;
565  targetBlock->m_cursors.insert (cursor);
566  m_cursors.remove (cursor);
567  }
568  }
569 
570  // kill lines
571  m_lines.clear ();
572 }
573 
574 void TextBlock::markModifiedLinesAsSaved ()
575 {
576  // mark all modified lines as saved
577  for (int i = 0; i < m_lines.size(); ++i) {
578  TextLine textLine = m_lines[i];
579  if (textLine->markedAsModified())
580  textLine->markAsSavedOnDisk(true);
581  }
582 }
583 
584 void TextBlock::updateRange (TextRange* range)
585 {
589  const int startLine = range->startInternal().lineInternal();
590  const int endLine = range->endInternal().lineInternal();
591  const bool isSingleLine = startLine == endLine;
592 
596  if ((endLine < m_startLine) || (startLine >= (m_startLine + lines()))) {
597  removeRange (range);
598  return;
599  }
600 
604  if(isSingleLine && m_cachedLineForRanges.contains (range) && (m_cachedLineForRanges.value(range) == startLine - m_startLine))
605  return;
606 
610  if(!isSingleLine && m_uncachedRanges.contains (range))
611  return;
612 
616  removeRange(range);
617 
621  if (!isSingleLine) {
625  m_uncachedRanges.insert(range);
626  return;
627  }
628 
632  const int lineOffset = startLine - m_startLine;
633 
637  if (m_cachedRangesForLine.size() <= lineOffset)
638  m_cachedRangesForLine.resize(lineOffset+1);
639 
643  m_cachedRangesForLine[lineOffset].insert(range);
644  m_cachedLineForRanges[range] = lineOffset;
645 }
646 
647 void TextBlock::removeRange (TextRange* range)
648 {
652  if(m_uncachedRanges.remove (range)) {
656  Q_ASSERT (!m_cachedLineForRanges.contains(range));
657  return;
658  }
659 
663  QHash<TextRange*, int>::iterator it = m_cachedLineForRanges.find(range);
664  if (it != m_cachedLineForRanges.end()) {
668  Q_ASSERT (!m_uncachedRanges.contains(range));
669 
673  Q_ASSERT (m_cachedRangesForLine.at(*it).contains(range));
674 
678  m_cachedRangesForLine[*it].remove(range);
679  m_cachedLineForRanges.erase(it);
680  return;
681  }
682 
686 }
687 
688 }
katetextblock.h
Kate::TextRange::startInternal
const TextCursor & startInternal() const
Non-virtual version of start(), which is faster.
Definition: katetextrange.h:125
QString::append
QString & append(QChar ch)
Kate::TextBlock::wrapLine
void wrapLine(const KTextEditor::Cursor &position, int fixStartLinesStartIndex)
Wrap line at given cursor position.
Definition: katetextblock.cpp:89
Kate::TextBlock::setStartLine
void setStartLine(int startLine)
Set start line of this block.
Definition: katetextblock.cpp:43
katetextbuffer.h
Kate::TextBlock::removeRange
void removeRange(TextRange *range)
Remove a range from this block.
Definition: katetextblock.cpp:647
Kate::TextCursor::column
int column() const
Retrieve the column on which this cursor is situated.
Definition: katetextcursor.h:141
Kate::TextBlock::unwrapLine
void unwrapLine(int line, TextBlock *previousBlock, int fixStartLinesStartIndex)
Unwrap given line.
Definition: katetextblock.cpp:189
Kate::TextBlock::lines
int lines() const
Number of lines in this block.
Definition: katetextblock.h:90
QString::size
int size() const
QSet::insert
const_iterator insert(const T &value)
QString::remove
QString & remove(int position, int n)
Kate::TextCursor::lineInternal
int lineInternal() const
Non-virtual version of line(), which is faster.
Definition: katetextcursor.h:127
QString::chop
void chop(int n)
Kate::TextBlock::startLine
int startLine() const
Start line of this block.
Definition: katetextblock.h:60
Kate::TextLineData
Class representing a single text line.
Definition: katetextline.h:37
Kate::TextBlock::deleteBlockContent
void deleteBlockContent()
Delete the block content, delete all lines and delete all cursors not bound to ranges.
Definition: katetextblock.cpp:544
Kate::TextRange::endInternal
const TextCursor & endInternal() const
Nonvirtual version of end(), which is faster.
Definition: katetextrange.h:137
Kate::TextBlock::debugPrint
void debugPrint(int blockIndex) const
Debug output, print whole block content with line numbers and line length.
Definition: katetextblock.cpp:472
Kate::TextBlock::TextBlock
TextBlock(TextBuffer *buffer, int startLine)
Construct an empty text block.
Definition: katetextblock.cpp:26
Kate::TextBlock::~TextBlock
~TextBlock()
Destruct the text block.
Definition: katetextblock.cpp:34
QHash::iterator
Kate::TextBlock::updateRange
void updateRange(TextRange *range)
Update a range from this block.
Definition: katetextblock.cpp:584
Kate::TextBlock::clearBlockContent
void clearBlockContent(TextBlock *targetBlock)
Clear the block content, delete all lines, move all cursors not bound to range to given block at 0...
Definition: katetextblock.cpp:556
QString::insert
QString & insert(int position, QChar ch)
QSharedPointer
Kate::TextBlock::markModifiedLinesAsSaved
void markModifiedLinesAsSaved()
Flag all modified text lines as saved on disk.
Definition: katetextblock.cpp:574
Kate::TextCursor::lineInBlock
int lineInBlock() const
Get offset into block this cursor belongs to, if any.
Definition: katetextcursor.h:171
QSet
QString
QList
Kate::TextBlock::removeText
void removeText(const KTextEditor::Range &range, QString &removedText)
Remove text at given range.
Definition: katetextblock.cpp:409
QString::right
QString right(int n) const
Kate::TextBlock::appendLine
void appendLine(const QString &textOfLine)
Append a new line with given text.
Definition: katetextblock.cpp:67
Kate::TextBlock::clearLines
void clearLines()
Clear the lines.
Definition: katetextblock.cpp:72
Kate::TextCursor::kateRange
Kate::TextRange * kateRange() const
Get range this cursor belongs to, if any.
Definition: katetextcursor.h:159
QString::mid
QString mid(int position, int n) const
Kate::TextBlock::mergeBlock
void mergeBlock(TextBlock *targetBlock)
Merge this block with given one, the given one must be a direct predecessor.
Definition: katetextblock.cpp:519
Kate::TextCursor
Class representing a 'clever' text cursor.
Definition: katetextcursor.h:43
Kate::TextLine
QSharedPointer< TextLineData > TextLine
The normal world only accesses the text lines with shared pointers.
Definition: katetextline.h:443
Kate::TextBlock::line
TextLine line(int line) const
Retrieve a text line.
Definition: katetextblock.cpp:52
Kate::TextBuffer
Class representing a text buffer.
Definition: katetextbuffer.h:48
Kate::TextBuffer::history
TextHistory & history()
TextHistory of this buffer.
Definition: katetextbuffer.h:304
Kate::TextBlock::text
void text(QString &text) const
Retrieve text of block.
Definition: katetextblock.cpp:77
Kate::TextRange
Class representing a 'clever' text range.
Definition: katetextrange.h:46
Kate::TextBlock::insertText
void insertText(const KTextEditor::Cursor &position, const QString &text)
Insert text at given cursor position.
Definition: katetextblock.cpp:347
Kate::TextBlock
Class representing a text block.
Definition: katetextblock.h:42
Kate::TextBlock::splitBlock
TextBlock * splitBlock(int fromLine)
Split given block.
Definition: katetextblock.cpp:480
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal