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

Bug in definition of vk_Delete in gui_mac.c?

Expand Messages
  • Eckehard Berns
    Hi! I was always wondering why I couldn t interrupt a compile run or spawned process in the GUI Version of Vim for Mac OS X. While debugging the problem I got
    Message 1 of 1 , Jan 23, 2004
      Hi!

      I was always wondering why I couldn't interrupt a compile run or
      spawned process in the GUI Version of Vim for Mac OS X. While
      debugging the problem I got to a #define for vk_Delete, which later
      is used in special_keys and defined as 0x08. Might it be that the
      person inserting this code tried to match the char code (ASCII 8
      -> Backspace) instead the sym code (which seems to be 51 or 0x33--at
      least on MacOS X). On my system the key C has the key sym 8 and
      therefor will be modified to result in the char sequence for
      backspace. This doesn't show up in normal editing, because the
      got_int global is set and the input queue will be cleared anyway.
      But when Vim spawned a shell or another command got_int seems to
      be ignored and the interrupt signal is sent only upon reading the
      char 0x03 in the input queue.

      Since I have no idea whether this code would break classic Mac OS
      versions of Vim I prepared a small patch that only skips vk_Delete
      from being listed in the special_keys when compiling on Mac OS X.
      But I do think that the correct thing to do would be to either
      remove vk_Delete completely or to define it as 0x33.

      *** ../vim62.195/src/gui_mac.c Tue Jan 20 19:39:56 2004
      --- src/gui_mac.c Fri Jan 23 20:36:23 2004
      ***************
      *** 236,241 ****
      --- 236,242 ----
      #define vk_Space 0x31 /* -> 20 */
      #define vk_Tab 0x30 /* -> 09 */
      #define vk_Return 0x24 /* -> 0D */
      + /* why this? key_sym 8 is the key "c" on MacOS X */
      #define vk_Delete 0X08 /* -> 08 BackSpace */

      #define vk_Help 0x72 /* -> 05 */
      ***************
      *** 293,299 ****
      --- 294,302 ----

      /* {XK_Help, '%', '1'}, */
      /* {XK_Undo, '&', '8'}, */
      + #ifndef MACOS_X
      {vk_Delete, 'k', 'b'},
      + #endif
      {vk_Insert, 'k', 'I'},
      {vk_FwdDelete, 'k', 'D'},
      {vk_Home, 'k', 'h'},

      --
      Eckehard Berns
    Your message has been successfully submitted and would be delivered to recipients shortly.