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

Re: [patch] fixed E763 when using a spell checker

Expand Messages
  • Bram Moolenaar
    ... Thanks, I ll look into it soon. -- ALL: A witch! A witch! WITCH: It s a fair cop. ALL: Burn her! Burn her! Let s make her into a ladder. Monty
    Message 1 of 2 , Apr 14, 2010
      Dominique Pelle wrote:

      > When I generate spelling checker files using main.aap in
      > vim/runtime/spell/* with Vim-7.2.411 using Ubuntu-9.10,
      > I then get error E763 when trying to use the dictionaries.
      > Attached patch fixes it.
      > I initially saw this when creating the Breton dictionary but
      > I see this error for all other dictionaries that I tried to create:
      > - it.utf-8.spl
      > - es.utf-8.spl
      > - eo.utf-8.spl
      > - cy.utf-8.spl
      > - br.utf-8.spl
      > After generating the dictionary and copying it into ~/.vim/spell,
      > E763 happens when doing this for example:
      > vim -u NONE
      > :set spell
      > :setlocal spelllang=cy
      > The problem happens because spelltab.st_fold[] is of type 'char_u'
      > but init_spell_chartab() initializes it with utf_fold(i) which can return
      > a value greater than 256. So value gets truncated (which does not
      > make sense). It happens at least when i is 181=0xb5 since foldCase[]
      > table contains entry...
      > {0xb5,0xb5,-1,775},
      > ... so utf_fold(181) returns 181 + 775 == 0x3BC which then becomes
      > 0xBC = 188 when converted to char_u.
      > Attached patch fixes it but please verify it.
      > A few things a unclear to me though:
      > - why is a table of 256 char needed when using Unicode?
      > - why is spelltab.st_fold[] table initialized differently
      > whether clear_spell_chartab() or init_spell_chartab()
      > is called?
      > - why don't I get E763 with official Vim dictionary files,
      > but I got it (before my patch) when I generated dictionary
      > myself?

      Thanks, I'll look into it soon.

      ALL: A witch! A witch!
      WITCH: It's a fair cop.
      ALL: Burn her! Burn her! Let's make her into a ladder.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      To unsubscribe, reply using "remove me" as the subject.
    Your message has been successfully submitted and would be delivered to recipients shortly.