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 / unreleased / patches / old / 5.4o.7 < prev    next >
Encoding:
Internet Message Format  |  1999-07-15  |  2.3 KB

  1. To: "Krishna, Hari" <hkrishna@evolvesoftware.com>
  2. Cc: vim-dev@vim.org
  3. In-Reply-To: <DE48F7C3B4FED011849E00805FC185C801253818@skate>
  4. Subject: patch 5.4o.7 (was: another syntax bug ?)
  5. Fcc: outbox
  6. From: Bram Moolenaar <Bram@moolenaar.net>
  7. ------------
  8.  
  9. Hari Krishna wrote:
  10.  
  11. > A small insignificant bug, but thought will notify you. If you select
  12. > part of the text and press ^C, the selection is removed, but at the same
  13. > time some of the syntax highlighting goes off most notably for comments.
  14. > It is restored if the screen is redrawn.
  15.  
  16. I see.  Because CTRL-C has been hit, "got_int" will be set.  Recently I have
  17. added a check for got-int in regexp execution, so that it can be interrupted.
  18. But this now makes all regexp work fail.  Thus syntax highlighting doesn't
  19. work when the screen is updated while "got_int" is still set.
  20.  
  21.  
  22. Patch 5.4o.7
  23. Problem:    When hitting CTRL-C in Visual mode, the syntax highlighting was
  24.             removed. (Hari Krishna)
  25. Solution:   Reset got-int while redrawing the screen and restore it after
  26.             that.
  27. Files:      src/screen.c
  28.  
  29.  
  30. *** ../vim-5.4o/src/screen.c    Sun Jul 11 20:10:35 1999
  31. --- src/screen.c    Wed Jul 14 22:21:32 1999
  32. ***************
  33. *** 1113,1118 ****
  34. --- 1113,1121 ----
  35.   #ifdef LINEBREAK
  36.       int            need_showbreak = FALSE;
  37.   #endif
  38. + #if defined(SYNTAX_HL) || defined(EXTRA_SEARCH)
  39. +     int            save_got_int;
  40. + #endif
  41.   
  42.       if (startrow > endrow)        /* past the end already! */
  43.       return startrow;
  44. ***************
  45. *** 1134,1139 ****
  46. --- 1137,1147 ----
  47.   #else
  48.       extra_check = 0;
  49.   #endif
  50. + #if defined(SYNTAX_HL) || defined(EXTRA_SEARCH)
  51. +     /* reset got_int, otherwise regexp won't work */
  52. +     save_got_int = got_int;
  53. +     got_int = 0;
  54. + #endif
  55.   #ifdef SYNTAX_HL
  56.       if (syntax_present(wp->w_buffer))
  57.       {
  58. ***************
  59. *** 1834,1839 ****
  60. --- 1842,1853 ----
  61.           break;
  62.       }
  63.       }
  64. + #if defined(SYNTAX_HL) || defined(EXTRA_SEARCH)
  65. +     /* restore got_int, unless CTRL-C was hit while redrawing */
  66. +     if (!got_int)
  67. +     got_int = save_got_int;
  68. + #endif
  69.   
  70.       return (row);
  71.   }
  72.  
  73. --
  74. hundred-and-one symptoms of being an internet addict:
  75. 110. You actually volunteer to become your employer's webmaster.
  76.  
  77. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  78.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  79.