Fix GUI paste of CRLF/CR text: split all line endings
The ImGui Cmd+V/Ctrl+V paste handler split clipboard text only on '\n', leaving '\r' inside each segment. Pasting text with CRLF (Windows) or bare CR (classic-Mac / some macOS apps) line endings enqueued an InsertText arg containing '\r', which the InsertText command rejects with "InsertText arg must not contain newlines". Extract the paste-to-commands logic into a pure, SDL-free helper (PasteSplit.h) that treats '\n', '\r\n', and bare '\r' each as one line break, and add unit tests covering all line-ending forms plus blank-line and trailing-newline preservation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -4,7 +4,7 @@ project(kte)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(KTE_VERSION "1.11.2")
|
||||
set(KTE_VERSION "1.11.3")
|
||||
|
||||
# Default to terminal-only build to avoid SDL/OpenGL dependency by default.
|
||||
# Enable with -DBUILD_GUI=ON when SDL2/OpenGL/Freetype are available.
|
||||
@@ -344,6 +344,7 @@ if (BUILD_TESTS)
|
||||
tests/test_migration_coverage.cc
|
||||
tests/test_smart_newline.cc
|
||||
tests/test_reflow_undo.cc
|
||||
tests/test_paste_split.cc
|
||||
|
||||
# minimal engine sources required by Buffer
|
||||
PieceTable.cc
|
||||
|
||||
Reference in New Issue
Block a user