home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / old / 5.6.069 < prev    next >
Encoding:
Internet Message Format  |  2000-04-21  |  3.6 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.6.069
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.6.069
  8. Problem:    "go" doesn't always end up at the right character when
  9.         'fileformat' is "dos". (Bruce DeVisser)
  10. Solution:   Correct computations in ml_find_line_or_offset().
  11. Files:        src/memline.
  12.  
  13.  
  14. *** ../vim-5.6.68/src/memline.c    Fri Mar 31 14:23:12 2000
  15. --- src/memline.c    Sat Apr 22 22:37:34 2000
  16. ***************
  17. *** 4142,4147 ****
  18. --- 4142,4148 ----
  19.       int        text_end;
  20.       long    offset;
  21.       int        len;
  22. +     int        ffdos = (get_fileformat(buf) == EOL_DOS);
  23.   
  24.       if (buf->b_ml.ml_usedchunks == -1
  25.           || buf->b_ml.ml_chunksize == NULL
  26. ***************
  27. *** 4164,4176 ****
  28.           && ((line
  29.            && line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines)
  30.           || (offset
  31. !        && offset >= size + buf->b_ml.ml_chunksize[curix].mlcs_totalsize)))
  32.       {
  33.       curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
  34.       size += buf->b_ml.ml_chunksize[curix].mlcs_totalsize;
  35. !     curix++;
  36. !     if (offset && get_fileformat(buf) == EOL_DOS)
  37.           size += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
  38.       }
  39.   
  40.       while ((line && curline < line) || (offset && size < offset))
  41. --- 4165,4178 ----
  42.           && ((line
  43.            && line >= curline + buf->b_ml.ml_chunksize[curix].mlcs_numlines)
  44.           || (offset
  45. !        && offset >= size + buf->b_ml.ml_chunksize[curix].mlcs_totalsize
  46. !               + ffdos * buf->b_ml.ml_chunksize[curix].mlcs_numlines)))
  47.       {
  48.       curline += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
  49.       size += buf->b_ml.ml_chunksize[curix].mlcs_totalsize;
  50. !     if (offset && ffdos)
  51.           size += buf->b_ml.ml_chunksize[curix].mlcs_numlines;
  52. +     curix++;
  53.       }
  54.   
  55.       while ((line && curline < line) || (offset && size < offset))
  56. ***************
  57. *** 4199,4218 ****
  58.       else
  59.       {
  60.           while (offset >= size
  61. !               + text_end - (int)((dp->db_index[idx]) & DB_INDEX_MASK))
  62.           {
  63.           if (idx == count - 1)
  64.               break;
  65.           idx++;
  66. -         if (get_fileformat(buf) == EOL_DOS)
  67. -             size++;
  68.           }
  69.       }
  70.       len = text_end - ((dp->db_index[idx]) & DB_INDEX_MASK);
  71.       size += len;
  72.           if (offp != NULL && size >= offset)
  73.       {
  74. !         if (size == offset)
  75.           *offp = 0;
  76.           else if (idx == start_idx)
  77.           *offp = offset - size + len;
  78. --- 4201,4221 ----
  79.       else
  80.       {
  81.           while (offset >= size
  82. !                + text_end - (int)((dp->db_index[idx]) & DB_INDEX_MASK)
  83. !                                       + ffdos)
  84.           {
  85. +         if (ffdos)
  86. +             size++;
  87.           if (idx == count - 1)
  88.               break;
  89.           idx++;
  90.           }
  91.       }
  92.       len = text_end - ((dp->db_index[idx]) & DB_INDEX_MASK);
  93.       size += len;
  94.           if (offp != NULL && size >= offset)
  95.       {
  96. !         if (size + ffdos == offset)
  97.           *offp = 0;
  98.           else if (idx == start_idx)
  99.           *offp = offset - size + len;
  100. ***************
  101. *** 4224,4230 ****
  102.       curline = buf->b_ml.ml_locked_high + 1;
  103.       }
  104.   
  105. !     if (get_fileformat(buf) == EOL_DOS)
  106.       size += line - 1;
  107.       return size;
  108.   }
  109. --- 4227,4233 ----
  110.       curline = buf->b_ml.ml_locked_high + 1;
  111.       }
  112.   
  113. !     if (ffdos)
  114.       size += line - 1;
  115.       return size;
  116.   }
  117. *** ../vim-5.6.68/src/version.c    Sat Apr 22 22:52:31 2000
  118. --- src/version.c    Sat Apr 22 22:50:31 2000
  119. ***************
  120. *** 420,421 ****
  121. --- 420,423 ----
  122.   {   /* Add new patch number below this line */
  123. + /**/
  124. +     69,
  125.   /**/
  126.  
  127. -- 
  128. hundred-and-one symptoms of being an internet addict:
  129. 123. You ask the car dealer to install an extra cigarette lighter
  130.      on your new car to power your notebook.
  131.  
  132. /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\
  133. \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/
  134.