Bug 544970 - [console] Fix ConsoleDocumentAdapter's TextChangingEvent
calculation

The existing implementation produces wrong or incomplete
TextChangingEvents in various situations especially in fixed width mode
which lead to exceptions or wrong rendering of console content e.g.
 - inserting content in fixed width mode lead to exceptions in many
cases most likely by holding down a key until the input hit the fixed
width border
 - lines after changed line are not updated and still show outdated
content
 - removing line breaks (either due to wrapping or delimiter character)
lead to exceptions
 - trailing wrapped line content was not correctly repainted

Some of these errors leave the console in an dysfunctional state where
even moving the cursor can produce more exceptions.

Additional improvement: while the old implementation's interpretation of
line delimiter was based on what java.util.regex.Pattern thinks a line
delimiter is, the new implementation use the legal line delimiters of
the connected document.

Change-Id: I3283ebeeef2e006357da1b1432bf1d24ab78475c
Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
1 file changed