Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.h
Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Line(s) | 352 | /** | |||
---|---|---|---|---|---|
355 | */ | 355 | */ | ||
356 | KTextEditor::Cursor lastEditingPosition(EditingPositionKind nextOrPrevious, KTextEditor::Cursor); | 356 | KTextEditor::Cursor lastEditingPosition(EditingPositionKind nextOrPrevious, KTextEditor::Cursor); | ||
357 | 357 | | |||
358 | private: | 358 | private: | ||
359 | int editSessionNumber = 0; | 359 | int editSessionNumber = 0; | ||
360 | QStack<int> editStateStack; | 360 | QStack<int> editStateStack; | ||
361 | bool editIsRunning = false; | 361 | bool editIsRunning = false; | ||
362 | bool m_undoMergeAllEdits = false; | 362 | bool m_undoMergeAllEdits = false; | ||
363 | KTextEditor::Cursor m_editLastChangeStartCursor = KTextEditor::Cursor::invalid(); | ||||
363 | QStack<QSharedPointer<KTextEditor::MovingCursor>> m_editingStack; | 364 | QStack<QSharedPointer<KTextEditor::MovingCursor>> m_editingStack; | ||
364 | int m_editingStackPosition = -1; | 365 | int m_editingStackPosition = -1; | ||
365 | static const int s_editingStackSizeLimit = 32; | | |||
366 | 366 | | |||
367 | // | 367 | // | ||
368 | // KTextEditor::UndoInterface stuff | 368 | // KTextEditor::UndoInterface stuff | ||
369 | // | 369 | // | ||
370 | public Q_SLOTS: | 370 | public Q_SLOTS: | ||
371 | void undo(); | 371 | void undo(); | ||
372 | void redo(); | 372 | void redo(); | ||
373 | 373 | | |||
374 | /** | 374 | /** | ||
375 | * Removes all the elements in m_editingStack of the respective document. | 375 | * Removes all the elements in m_editingStack of the respective document. | ||
376 | */ | 376 | */ | ||
377 | void clearEditingPosStack(); | 377 | void clearEditingPosStack(); | ||
378 | 378 | | |||
379 | /** | 379 | /** | ||
380 | * Saves the editing positions into the stack. | 380 | * Saves the editing positions into the stack. | ||
381 | * If the consecutive editings happens in the same line, then remove | 381 | * If the consecutive editings happens in the same line, then remove | ||
382 | * the previous and add the new one with updated column no. | 382 | * the previous and add the new one with updated column no. | ||
383 | */ | 383 | */ | ||
384 | void saveEditingPositions(KTextEditor::Document *, const KTextEditor::Range &range); | 384 | void saveEditingPositions(const KTextEditor::Cursor &cursor); | ||
385 | 385 | | |||
386 | public: | 386 | public: | ||
387 | uint undoCount() const; | 387 | uint undoCount() const; | ||
388 | uint redoCount() const; | 388 | uint redoCount() const; | ||
389 | 389 | | |||
390 | KateUndoManager *undoManager() | 390 | KateUndoManager *undoManager() | ||
391 | { | 391 | { | ||
392 | return m_undoManager; | 392 | return m_undoManager; | ||
▲ Show 20 Lines • Show All 1021 Lines • Show Last 20 Lines |