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

Re: Design question: 'keymap' and 'encoding' switch

Expand Messages
  • Bram Moolenaar
    ... That makes sense. I ll see if that can be fixed. ... For me it works fine by setting keymap to the same value again. I tried this with the accents
    Message 1 of 2 , Mar 1, 2001
      Ron Aaron wrote:

      > I am noticing that if I e.g.:
      >
      > :set enc=utf-8
      > :enew
      > :set keymap=hebrew
      >
      > When I enter text, I get Unicode Hebrew characters, as I expect. Now, when
      > I do:
      >
      > :set enc=cp1255
      >
      > The keymap is not re-read, and I am still entering 'unicode' characters. I
      > think the encoding change should be hooked so that if a 'keymap' is active,
      > it gets reloaded if there is one for the encoding.

      That makes sense. I'll see if that can be fixed.

      > Also, merely doing
      > :set keymap=hebrew
      >
      > again is ineffective; I need to do this:
      > :set keymap=
      > :set keymap=hebrew
      >
      > to get a reload.

      For me it works fine by setting 'keymap' to the same value again. I tried
      this with the "accents" file that I included.

      If you think the problem is not in your keymap file, try setting the 'verbose'
      option to find out if the file is actually read.

      > One possibility, of course, is to have an autocommand hooking the
      > EncodingChanged event, and reload maps there if one exists; this would,
      > however, necessitate using 'bufdo', since the keymap is buffer-specific, and
      > that may have undesirable side-effects.
      >
      > I think the right thing to do would be to have a dirty flag set in all
      > buffers when the encoding is changed; then, when entering the buffer, if the
      > dirty flag is set, reset it and reload the keymap if any.

      Why not reload the keymaps at the moment 'encoding' is changed? You are not
      supposed to change it very often anyway. All the text in registers and loaded
      buffers becomes invalid.

      --
      Despite the cost of living, have you noticed how it remains so popular?

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
    Your message has been successfully submitted and would be delivered to recipients shortly.