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 / 6.1.414 < prev    next >
Encoding:
Internet Message Format  |  2003-03-24  |  3.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.414 (extra)
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.414 (extra, depends on 6.1.369)
  11. Problem:    VMS: Vim busy waits when waiting for input.
  12. Solution:   Delay for a short while before getting another character.  (Zoltan
  13.         Arpadffy)
  14. Files:        src/os_vms.c
  15.  
  16.  
  17. *** ../vim61.413/src/os_vms.c    Sun Mar  9 14:08:43 2003
  18. --- src/os_vms.c    Tue Mar 25 21:36:13 2003
  19. ***************
  20. *** 296,339 ****
  21.    *
  22.    * Returns: input length
  23.    */
  24.       int
  25.   vms_read(char *inbuf, size_t nbytes)
  26.   {
  27. -     static unsigned short add_esc, was_esc = 0;
  28.       char    ibuf[nbytes];
  29.       int     status, function, len;
  30.       TT_MODE tt_mode;
  31.   
  32.       /* whatever happened earlier we need an iochan here */
  33.       if (!iochan)
  34. !        tt_mode=get_tty();
  35.   
  36. !     function = ( IO$_READLBLK | IO$M_NOECHO | IO$M_TIMED ) ;
  37. !     len=0;
  38. !     add_esc=0;
  39.   
  40. !     while(1) {
  41. !         memset(ibuf,0,sizeof(ibuf));
  42. !         status = sys$qiow(0,iochan,function,&iosb,0,0,&ibuf,nbytes-1,0,0,0,0);
  43. !         len=strlen( ibuf );
  44. !         if ( was_esc ) {                   /* ESC interrupts the BLOCK QIO  */
  45. !             add_esc=1;                     /* therefore we need to handle   */
  46. !             was_esc=0;                     /* it on special way in order to */
  47. !             inbuf[0]=27;                   /* read ESC sequences            */
  48. !         }
  49. !         if ( len>0 ){
  50. !             if ( ibuf[len-1]==27 ){
  51. !                 was_esc=1;
  52. !                 len=len-1;
  53. !             }
  54. !             mch_memmove(inbuf+add_esc, ibuf, len);
  55.           }
  56. !         if ((add_esc+len) > 0) break;
  57.       }
  58. !     return add_esc+len;
  59.   }
  60.   
  61.   /*
  62. --- 296,328 ----
  63.    *
  64.    * Returns: input length
  65.    */
  66.       int
  67.   vms_read(char *inbuf, size_t nbytes)
  68.   {
  69.       char    ibuf[nbytes];
  70.       int     status, function, len;
  71. +     float   wait = 0.05;
  72.       TT_MODE tt_mode;
  73.   
  74.       /* whatever happened earlier we need an iochan here */
  75.       if (!iochan)
  76. !        tt_mode = get_tty();
  77.   
  78. !     function = (IO$_READLBLK | IO$M_NOECHO | IO$M_TIMED | IO$M_ESCAPE);
  79. !     memset(ibuf, 0, sizeof(ibuf));
  80.   
  81. !     while (1)
  82. !     {
  83. !         status = sys$qiow(0,iochan,function,&iosb,0,0,&ibuf,nbytes,0,0,0,0);
  84. !         len = strlen(ibuf);
  85. !         if (len > 0)
  86. !     {
  87. !             mch_memmove(inbuf, ibuf, len);
  88. !             break;
  89.           }
  90. !     lib$wait(&wait);
  91.       }
  92. !     return len;
  93.   }
  94.   
  95.   /*
  96. *** ../vim61.413/src/version.c    Sun Mar 23 21:06:00 2003
  97. --- src/version.c    Tue Mar 25 21:38:08 2003
  98. ***************
  99. *** 613,614 ****
  100. --- 613,616 ----
  101.   {   /* Add new patch number below this line */
  102. + /**/
  103. +     414,
  104.   /**/
  105.  
  106. -- 
  107.     "You mean there really is an answer?"
  108.     "Yes! But you're not going to like it!"
  109.     "Oh do please tell us!"
  110.     "You're really not going to like it!"
  111.     "but we MUST know - tell us"
  112.     "Alright, the answer is...."
  113.     "yes..."
  114.     "... is ..."
  115.     "yes... come on!"
  116.     "is 42!"
  117.         (Douglas Adams - The Hitchhiker's Guide to the Galaxy)
  118.  
  119.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  120. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  121. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  122.  \\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
  123.