Fix join lines so that only a single space will exist between two lines

Does undo still work correctly? Just wondering if modifying the line directly like this would bypass the undo manager.