From 0627663abd14c81cafde85ce9cc0502d9bc3a6c3 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 7 Jan 2026 11:51:34 +1100 Subject: Bug [#2491]. Fix lexing after undo at end of document. --- doc/ScintillaHistory.html | 4 ++++ src/Document.cxx | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 25ca454cf..12b233b4f 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -607,6 +607,10 @@ Bug #2488.
  • + Fix lexing after undo at end of document. + Bug #2491. +
  • +
  • On Qt, add const to ScintillaDocument and ScintillaEdit methods. Bug #2494.
  • diff --git a/src/Document.cxx b/src/Document.cxx index 064b336e3..e4db66a19 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1590,7 +1590,10 @@ Sci::Position Document::Undo() { } cb.PerformUndoStep(); if (action.at != ActionType::container) { - ModifiedAt(action.position); + if ((action.at == ActionType::insert) && (action.position >= LengthNoExcept()) && (action.position > 0)) + ModifiedAt(action.position - 1); + else + ModifiedAt(action.position); newPos = action.position; } -- cgit v1.2.3