Loading ...
Sorry, an error occurred while loading the content.
 

Display problems with vim, xterm and UTF-8

Expand Messages
  • Anders Helmersson
    I have some problems when using vim and xterm for editing UTF-8 files on my Debian Linux box. I have tried to search the vim mailing lists and FAQ but without
    Message 1 of 4 , Feb 22, 2003
      I have some problems when using vim and xterm for editing UTF-8 files on
      my Debian Linux box. I have tried to search the vim mailing lists and
      FAQ but without success.

      When running vim in an xterm window, multibyte characters on a line are
      suddenly displayed incorrectly as the cursor is moved over them. I
      haven't found out any specific pattern on how to move the cursor with
      the arrow-keys to repeat the problem. Sometimes I need to go back and
      forth over the line quite a few times before the problem shows up. It
      happens both with and without an XIM-server running.

      As an example I give the following line

      我们的房子是白的。

      which shows up as

      æ ä ç æ å æ ç ç ã

      Once, this has happened, the characters are display correctly again by
      inserting another character on the line or by escaping the insert mode
      and refreshing the display with ^L. Also, when I enter the visual mode
      the characters are shown correctly.

      I don't know if this is an xterm, a font or a vim problem. If I redraw
      the xterm display (using ctrl and mouse keys) while in insert mode, the
      wrong characters still show up. If I mark the text using the mouse and
      insert it again (mouse middle key), the wrong characters are actually
      inserted. That is how I created the example lines above.

      I haven't been able to reproduce the behavior in gvim.

      I am using the debian vim (vim_6.1.263-2_i386.deb)
      VIM - Vi IMproved 6.1 (2002 Mar 24, compiled Nov 28 2002 10:38:32)
      Included patches: 1-263

      I start the xterm (XFree86 4.1.0(165)) by the following commands
      export LC_CTYPE=sv_SE.UTF-8
      uxterm -fn -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1

      Any suggestions?

      Another question is if and when it will be possible to use fully
      controlled IM (imactivatekey and related features) in vim without gui?

      Anders
    • Bram Moolenaar
      ... This sounds like an xterm problem. When moving the cursor around the xterm redraws characters from its buffer, I suspect you have an xterm version in
      Message 2 of 4 , Feb 23, 2003
        Anders Helmersson wrote:

        > When running vim in an xterm window, multibyte characters on a line are
        > suddenly displayed incorrectly as the cursor is moved over them. I
        > haven't found out any specific pattern on how to move the cursor with
        > the arrow-keys to repeat the problem. Sometimes I need to go back and
        > forth over the line quite a few times before the problem shows up. It
        > happens both with and without an XIM-server running.
        >
        > As an example I give the following line
        >
        > 我们的房子是白的。
        >
        > which shows up as
        >
        > æ ä ç æ å æ ç ç ã
        >
        > Once, this has happened, the characters are display correctly again by
        > inserting another character on the line or by escaping the insert mode
        > and refreshing the display with ^L. Also, when I enter the visual mode
        > the characters are shown correctly.

        This sounds like an xterm problem. When moving the cursor around the
        xterm redraws characters from its buffer, I suspect you have an xterm
        version in which this doesn't work properly. Can you try installing a
        newer xterm (version 172 is available, you appear to be using 165, I
        don't recall in which version this bug was fixed).

        > I don't know if this is an xterm, a font or a vim problem. If I redraw
        > the xterm display (using ctrl and mouse keys) while in insert mode, the
        > wrong characters still show up. If I mark the text using the mouse and
        > insert it again (mouse middle key), the wrong characters are actually
        > inserted. That is how I created the example lines above.

        That all points to an xterm problem. I can't be 100% sure though.

        > Another question is if and when it will be possible to use fully
        > controlled IM (imactivatekey and related features) in vim without gui?

        I don't think this will be possible. Unless these features are added to
        the xterm.

        --
        ARTHUR: You fight with the strength of many men, Sir knight.
        I am Arthur, King of the Britons. [pause]
        I seek the finest and the bravest knights in the land to join me
        in my Court of Camelot. [pause]
        You have proved yourself worthy; will you join me? [pause]
        You make me sad. So be it. Come, Patsy.
        BLACK KNIGHT: None shall pass.
        The Quest for the Holy Grail (Monty Python)

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
      • Anders Helmersson
        ... I tried to install the newest version XFree86 4.2.99.902(173). (I hope I didn t mess up things during the installation though). The problem still shows up
        Message 3 of 4 , Feb 25, 2003
          On Sun, 2003-02-23 at 12:30:06 +0100, Bram Moolenaar wrote:
          > This sounds like an xterm problem. When moving the cursor around the
          > xterm redraws characters from its buffer, I suspect you have an xterm
          > version in which this doesn't work properly. Can you try installing a
          > newer xterm (version 172 is available, you appear to be using 165, I
          > don't recall in which version this bug was fixed).

          I tried to install the newest version XFree86 4.2.99.902(173). (I hope I
          didn't mess up things during the installation though). The problem still
          shows up in the same way as before. In addition, it only shows up in the
          insert mode. I haven't been able to reproduce it on a simple command
          line in xterm either.

          > That all points to an xterm problem. I can't be 100% sure though.

          I agree, but I'm not certain either.

          Anders
        • Bram Moolenaar
          ... I m now 100% sure it is a Vim problem. I have located it and found a solution. I ll send out a patch asap. -- The war between Emacs and Vi is over. Vi
          Message 4 of 4 , Feb 25, 2003
            Anders Helmersson wrote:

            > On Sun, 2003-02-23 at 12:30:06 +0100, Bram Moolenaar wrote:
            > > This sounds like an xterm problem. When moving the cursor around the
            > > xterm redraws characters from its buffer, I suspect you have an xterm
            > > version in which this doesn't work properly. Can you try installing a
            > > newer xterm (version 172 is available, you appear to be using 165, I
            > > don't recall in which version this bug was fixed).
            >
            > I tried to install the newest version XFree86 4.2.99.902(173). (I hope I
            > didn't mess up things during the installation though). The problem still
            > shows up in the same way as before. In addition, it only shows up in the
            > insert mode. I haven't been able to reproduce it on a simple command
            > line in xterm either.
            >
            > > That all points to an xterm problem. I can't be 100% sure though.
            >
            > I agree, but I'm not certain either.

            I'm now 100% sure it is a Vim problem. I have located it and found a
            solution. I'll send out a patch asap.

            --
            The war between Emacs and Vi is over. Vi has won with 3 to 1.
            http://www.ssc.com/lg/issue30/raymond.html

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
            \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
            \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
          Your message has been successfully submitted and would be delivered to recipients shortly.