Keep window from skipping to the next line after adding partial string