DESCRIPTION

Improve hard wrapping by joining the line after a wrapped line

This extends the hard wrapping of the commit message in the Staging View
and Commit Dialog.

With the previous behavior, if one had a finished line/paragraph and
added text at the front, the text at the end would get
wrapped
like
this.

That made manual re-wrapping necessary. In the case of a paragraph,
several lines had to be edited again.

This change improves that use case by turning the line delimiter after a
wrapped word into a space to join the lines. It takes care not to join
empty lines or lines which start with a symbol (e.g. a bullet list).

It also gets rid of flickering during wrapping by only redrawing after
having applied all edits.

Bug: 387932
Change-Id: I197270a68700e7aacf12585c79418c7f8fc8a131
Signed-off-by: Danika Greer xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2012-08-23 22:27:59.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/sandbox/job/egit.gerrit/3287/ 

-------------------------------------
author: Brenden Conley
date: 2012-08-23 22:31:59.000000000

Patch Set 1: Fails

Build Failed 

https://hudson.eclipse.org/sandbox/job/egit.gerrit/3287/ : FAILURE

-------------------------------------
author: Carlie Harper
date: 2012-08-24 15:13:08.000000000

Patch Set 1: I would prefer that you didn't submit this

This is very cool!

However, it can cause the line to exceed MAX_LINE_WIDTH.
You can reproduce it by pasting the commit message of this change into the dialog, placing the cursor before "wrapped word" and pressing the backspace key.

-------------------------------------
author: Danika Greer
date: 2012-08-24 17:53:02.000000000

Patch Set 1:

Good catch! Here's a test case (will have to work some more on this):

xxx@xxx.xxx
	public void lineAfterWrappedLineShouldBeJoinedAndFollowingLineWrappedCorrectly() {
		String input = "123456789 123456789 123456789 123456789 123456789 123456789 123456789 "
				+ "123456789 123456789 123456789 123456789 123456789 123456789 123456789\n"
				+ "123456789 123456789 123456789 123456789 123456789 123456789 123456789";
		String expected = "123456789 123456789 123456789 123456789 123456789 123456789 123456789\n"
				+ "123456789 123456789 123456789 123456789 123456789 123456789 123456789\n"
				+ "123456789 123456789 123456789 123456789 123456789 123456789 123456789";
		assertWrappedEquals(expected, input);
	}

-------------------------------------
