This function has a bug (which predates your change, but also affects vsplits) that it could cut a double-width character in half. I think it should check if (n > 0 && aLine[rightMargin - n + 1].code == DWC_RIGHT) before doing the memmove, and if it is change aLine[rightMargin - n].code to a space.