Skip to content

[FEATURE]/bug Ctrl+Z undo is very slow - make it undo by word or change or linebreak (not char) #3729

Closed

Description

@mYnDstrEAm

Is your feature request related to a problem? Please describe.

(Don't know if this is better described as feature or bug - it's a mix of both given that this is probably not intentional and against familiar standards of most text editors.)

Undoing changes or recovering some earlier text via ctrl+z is barely usable - it takes veeery long.

Holding CTRL+Z slowly undoes one's changes one character at a time and with much time per character.

Describe the solution you'd like

Other major text editors are much more usable/useful in that regard - Kate applies ctrl+z like so and I think it's the best solution:

  • Have it undo one save at a time - if you write a long sentence, pressing ctrl+z once undoes that whole sentence and holding it does that for many sentences so it's quick at the scale of entire documents
  • If you write multiple lines in one save then it undoes one line at a time

Describe alternatives you've considered

It doesn't have to be that way - it could also undo by word and assign less time per word than currently assigned to undoing one character or just undo one save at a time consistently or other solutions that make ctrl+z much faster.

Additional context

This is really needed for personal notes management and a main drawback I've noticed compared to other text editors / note management software.

Output from the debug section in the settings dialog

Expand

Version: 26.9.5
Build date: Sep 12 2026
Build number: 1383
Platform: linux (wayland)
Operating System: Debian GNU/Linux 13 (trixie)
Build architecture: x86_64
Current architecture: x86_64
Release: OBS
Qt Version (build): 6.8.2
Qt Version (runtime): 6.8.2
Portable mode: no
Settings path / key: /home/username/.config/PBE/QOwnNotes-test.conf
Settings override path: /home/username/.config/PBE/QOwnNotes-test.override.conf
Settings loaded from override: 0
Application database path: /home/username/.local/share/PBE/QOwnNotes-test/QOwnNotes.sqlite
Application arguments: QOwnNotes, --session, test
Qt Debug: no
System Botan: no
Libgit2: no
QLiteHtml: yes
Locale (system): [removed]
Locale (interface): empty
Primary screen resolution: [removed]
Icon theme: breeze-dark
Notes in current note folder: [removed number]
Calendar items: 0
Enabled scripts: 0
Database drivers: QMARIADB, QMYSQL, QSQLITE

Activity

  1. pbek commented on Sep 10, 2026

    @pbek
    Owner

    Holding CTRL+Z slowly undoes one's changes one character at a time and with much time per character.

    I can't reproduce that. I've never seen this. There is no special implementation in QOwnNotes. It just uses the undo functionality of the QPlainTextEdit.

    Can you please try opening QOwnNotes in a new session, see CLI Parameters?

    Can you please post the output from the debug settings that you can copy when you get to the settings dialog in QOwnNotes and head over to the Debug section of it?

    Is there any useful log output if you enable the log panel (see Window / Panels)? Please make sure you also enable debug logging in the log panel (by right-clicking on the panel and selecting Debug in Options).

  2. mYnDstrEAm commented on Sep 15, 2026

    @mYnDstrEAm
    Author

    So I launched it with QOwnNotes --session test now and the ctrl+z still only does undo slowly character-wise. Maybe you misunderstood what I meant with this - I meant holding ctrl+z undoes everything one has written in current session but it takes long because it undoes it not word-wise or save-wise or line-wise or any combination thereof but one character at a time (if one stops holding ctrl+z it can for example be at the middle of a word; seeing the undo is like somebody writing in reverse).

    No, the log panel just has this after writing something and saving and ctrl+z:
    [08:23:00] [status] Stored 1 note(s) to disk
    [08:23:01] [status] Stored 1 note(s) to disk
    [08:23:06] [status] Stored 1 note(s) to disk
    (by the way, that floppy icon only shows after I pasted it here but it shows a [] placeholder box in the actual panel; I had to remove it here too because the comment failed to save otherwise)

    I will add debug info now but I didn't change the settings much and in this new session not at all anyway - it's on Debian 13.

  3. pbek commented on Sep 15, 2026

    @pbek
    Owner

    If you mean slowly, as in "character-wise", then yes. That's how Qt's QPlainTextEdit is doing it.

  4. mYnDstrEAm commented on Sep 15, 2026

    @mYnDstrEAm
    Author

    No, I mean slowly as in time-wise and it's slow time-wise due to how it's implemented where the issue is proposing changing it to something that is faster. Character-wise could be kept or be a default option for example and still the undo be sped up (I don't think it would be a good solution since reverting individual characters is usually not what people need which is also why barely any text editor if any does it like that but it would still solve the problem).

    QPlainTextEdit is also what Kate uses but it reverts differently (as described above).

  5. pbek commented on Sep 15, 2026

    @pbek
    Owner

    QPlainTextEdit is also what Kate uses but it reverts differently (as described above).

    Kate does not use QPlainTextEdit for its main text editor.

    The application creates the editor through the KTextEditor framework:

    KTextEditor::View *v = doc->createView(stack, m_viewManager->mainWindow()->wrapper());

    The underlying KTextEditor implementation uses:

    • KTextEditor::ViewPrivate, derived from KTextEditor::View
    • KateViewInternal, a custom QWidget responsible for text rendering, cursor handling, selection, input, and scrolling
  6. mYnDstrEAm commented on Sep 15, 2026

    @mYnDstrEAm
    Author

    Okay thanks for the correction and sorry for that part...I was about to go at the time. I'm sure it 's possible in some way with QPlainTextEdit too however - maybe by using some ready-to-use mode or via some workaround. I'll see if I can find an issue about this at qt / QPlainTextEdit and if so link it here.

  7. added a commit that references this issue on Sep 16, 2026
  8. pbek commented on Sep 16, 2026

    @pbek
    Owner

    26.9.6

    • Undo in the note editor now groups consecutive typing instead of undoing one
      character at a time (for #3729)

    There now is a new release, could you please test it and report if it works for you?

  9. mYnDstrEAm commented on Sep 16, 2026

    @mYnDstrEAm
    Author

    Works like a charm, amazing - thank you!!

  10. pbek commented on Sep 17, 2026

    @pbek
    Owner

    Great, thank you for testing!
    Wasn't easy. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions