Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ public void testTrim() throws Exception {

c.getConsole().setWaterMarks(50, 100);
c.waitForScheduledJobs();
c.verifyContentByOffset("0123456789", 0);
c.verifyContentByOffset("0123456789", 1);
assertTrue(c.getDocument().getNumberOfLines() < 15, "Document not trimmed.");
}
closeConsole(c);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,8 @@ private void trim(int truncateOffset, boolean truncateToOffsetLineStart) {
if (truncateToOffsetLineStart) {
int cutoffLine = document.getLineOfOffset(truncateOffset);
cutOffset = document.getLineOffset(cutoffLine);
// deal with case of one long line
cutOffset = Math.max(cutOffset, truncateOffset);
}
if (cutOffset >= length) {
updateType = DocUpdateType.TRIM;
Expand Down
Loading