id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
4446	Paragraph formatting allows lines one character longer than the margin	proski	andrew_b	"The default word wrap setting is 72 characters, but Alt-P acts as if the setting is 73 characters.

It turns out there is a bug in line_pixel_length(). When xn (the visual width) exceed l (the target width), b (the byte offset in the string and the returnable value) is still incremented before the for loop ends. That's how for loops work. But we want the byte offset after the last character that would fit, i.e. the non-incremented value.

The attached patch moves the increment of the return value to a separate line. The initial increment is not needed, so char_length starts with 0.

I've tested the patch with different charsets, including wide characters."	defect	closed	major	4.8.30	mcedit	master	fixed					merged	committed-master
