Path: utzoo!attcan!uunet!ns-mx!jay.weeg.uiowa.edu!jnford From: jnford@jay.weeg.uiowa.edu (Jay Ford) Newsgroups: comp.windows.x Subject: Re: xterm cut and paste Keywords: blank truncation Message-ID: <1997@ns-mx.uiowa.edu> Date: 30 Jul 90 19:44:37 GMT References: <90Jul27.024537edt.446@smoke.cs.toronto.edu> Sender: news@ns-mx.uiowa.edu Reply-To: jnford@jay.weeg.uiowa.edu (Jay Ford) Organization: Weeg Computing Center, University of Iowa, Iowa City, IA, USA Lines: 70 In article <90Jul27.024537edt.446@smoke.cs.toronto.edu>, moraes@cs.toronto.edu (Mark Moraes) writes: |> |> Jim Fulton fixed at least one bug in my fix -- enclosed. Please apply |> this as well as the one in the referenced article, otherwise there are |> likely to be garbage characters, (usually NULs at the end of the cut |> text) |> [patch deleted] That patch did get rid of the NULs, but there is another problem. Blanks at the end of a line get incorrectly truncated when the line is not the last one in the cut region. That is, the line with the trailing blanks is followed by other lines, and all the lines are to be cut as one wrapped line. Here is the behavior I see, where the line in question is not the last line. condition result --------- ------ 1. no blanks at end of line lines are cut correctly, as one line 2. one blank at end of line the lines are cut as one line, but the single trailing blank is removed 3. multiple blanks at end of line the blanks are truncated, and the cut contains a NL at the end of this line Perhaps some examples would help. Assume a window width of 20 columns. Condition 1: 1 2 12345678901234567890 % echo abcdefghijklm nop resulting cut region is: echo abcdefghijklmnop Condition 2: 1 2 12345678901234567890 % echo abcdefghijkl nop resulting cut region is: echo abcdefghijklnop (blank is missing after l) Condition 3: 1 2 12345678901234567890 % echo abcdefghijk nop resulting cut region is: echo abcdefghijk nop (newline after k) From glancing at the xterm code (button.c) it seems that the blank truncation might be hard to work around. The LastTextCol and Length functions ignore trailing blanks, so anything which uses those functions will not get the blanks counted in the line length. Jay Ford, Weeg Computing Center, University of Iowa, Iowa City, IA 52242 jnford@jay.weeg.uiowa.edu or jnfordpb@uiamvs.bitnet, 319-335-5555