To: vim_dev@googlegroups.com Subject: Patch 8.0.1550 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1550 Problem: Various small problems in source files. Solution: Fix the problems. Files: src/README.txt, src/beval.c, src/json_test.c, src/mbyte.c, src/libvterm/include/vterm_keycodes.h, src/Makefile, src/gui_gtk.c, src/if_xcmdsrv.c, src/pty.c, src/if_python.c, src/if_py_both.h, uninstal.txt, src/dosinst.c, src/iscygpty.c, src/vimrun.c, src/os_vms.c *** ../vim-8.0.1549/src/README.txt 2010-06-26 06:05:00.000000000 +0200 --- src/README.txt 2017-11-12 16:49:36.844280397 +0100 *************** *** 8,15 **** JUMPING AROUND ! First of all, use ":make tags" to generate a tags file, so that you can use ! the ":tag" command to jump around the source code. To jump to a function or variable definition, move the cursor on the name and use the CTRL-] command. Use CTRL-T or CTRL-O to jump back. --- 8,15 ---- JUMPING AROUND ! First of all, use ":make tags" to generate a tags file, so that you can jump ! around in the source code. To jump to a function or variable definition, move the cursor on the name and use the CTRL-] command. Use CTRL-T or CTRL-O to jump back. *************** *** 43,48 **** --- 43,63 ---- window.c handling split windows + DEBUGGING + + If you have a reasonable recent version of gdb, you can use the :Termdebug + command to debug Vim. See ":help :Termdebug". + + When something is time critical or stepping through code is a hassle, use the + channel logging to create a time-stamped log file. Add lines to the code like + this: + ch_log(NULL, "Value is now %02x", value); + After compiling and starting Vim, do: + :call ch_logfile('debuglog', 'w') + And edit "debuglog" to see what happens. The channel functions already have + ch_log() calls, thus you always see that in the log. + + IMPORTANT VARIABLES The current mode is stored in "State". The values it can have are NORMAL, *** ../vim-8.0.1549/src/beval.c 2017-12-03 18:18:45.847979249 +0100 --- src/beval.c 2018-02-06 22:46:29.700928046 +0100 *************** *** 137,143 **** * Show a balloon with "mesg" or "list". */ void ! post_balloon(BalloonEval *beval UNUSED, char_u *mesg, list_T *list) { # ifdef FEAT_BEVAL_TERM # ifdef FEAT_GUI --- 137,143 ---- * Show a balloon with "mesg" or "list". */ void ! post_balloon(BalloonEval *beval UNUSED, char_u *mesg, list_T *list UNUSED) { # ifdef FEAT_BEVAL_TERM # ifdef FEAT_GUI *** ../vim-8.0.1549/src/json_test.c 2017-01-22 15:56:21.692532206 +0100 --- src/json_test.c 2018-02-04 14:37:00.168388427 +0100 *************** *** 162,168 **** reader.js_fill = fill_from_cookie; reader.js_used = 0; reader.js_buf = (char_u *)" [ \"a\" , 123 "; ! reader.js_cookie = " [ \"a\" , 123 ] "; assert(json_find_end(&reader, 0) == OK); reader.js_buf = (char_u *)" [ \"a\" , "; assert(json_find_end(&reader, 0) == OK); --- 162,168 ---- reader.js_fill = fill_from_cookie; reader.js_used = 0; reader.js_buf = (char_u *)" [ \"a\" , 123 "; ! reader.js_cookie = " [ \"a\" , 123 ] "; assert(json_find_end(&reader, 0) == OK); reader.js_buf = (char_u *)" [ \"a\" , "; assert(json_find_end(&reader, 0) == OK); *************** *** 186,192 **** reader.js_used = 0; reader.js_buf = (char_u *)" \"foo"; reader.js_end = reader.js_buf + STRLEN(reader.js_buf); ! reader.js_cookie = " \"foobar\" "; assert(json_decode_string(&reader, NULL, '"') == OK); } #endif --- 186,192 ---- reader.js_used = 0; reader.js_buf = (char_u *)" \"foo"; reader.js_end = reader.js_buf + STRLEN(reader.js_buf); ! reader.js_cookie = " \"foobar\" "; assert(json_decode_string(&reader, NULL, '"') == OK); } #endif *** ../vim-8.0.1549/src/mbyte.c 2018-02-10 18:45:21.068822158 +0100 --- src/mbyte.c 2018-02-17 22:04:30.171495169 +0100 *************** *** 2260,2266 **** /* * Convert Unicode character "c" to UTF-8 string in "buf[]". * Returns the number of bytes. - * This does not include composing characters. */ int utf_char2bytes(int c, char_u *buf) --- 2260,2265 ---- *** ../vim-8.0.1549/src/libvterm/include/vterm_keycodes.h 2017-07-23 22:07:23.041277153 +0200 --- src/libvterm/include/vterm_keycodes.h 2017-08-13 18:47:25.542054644 +0200 *************** *** 8,13 **** --- 8,14 ---- VTERM_MOD_CTRL = 0x04 } VTermModifier; + /* The order here must match keycodes[] in src/keyboard.c! */ typedef enum { VTERM_KEY_NONE, *** ../vim-8.0.1549/src/Makefile 2018-02-22 11:42:45.327211041 +0100 --- src/Makefile 2018-02-24 20:12:23.039118023 +0100 *************** *** 651,662 **** # PROFILING - Uncomment the next two lines to do profiling with gcc and gprof. # Might not work with GUI or Perl. - # For unknown reasons adding "-lc" fixes a linking problem with some versions - # of GCC. That's probably a bug in the "-pg" implementation. # After running Vim see the profile result with: gprof vim gmon.out | vim - # Need to recompile everything after changing this: "make clean" "make". #PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING #PROFILE_LIBS = -pg #PROFILE_LIBS = -pg -lc --- 651,666 ---- # PROFILING - Uncomment the next two lines to do profiling with gcc and gprof. # Might not work with GUI or Perl. # After running Vim see the profile result with: gprof vim gmon.out | vim - # Need to recompile everything after changing this: "make clean" "make". #PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING #PROFILE_LIBS = -pg + + # GCC 5 and later need the -no-pie argument. + #PROFILE_LIBS = -pg -no-pie + + # For unknown reasons adding "-lc" fixes a linking problem with some versions + # of GCC. That's probably a bug in the "-pg" implementation. #PROFILE_LIBS = -pg -lc *** ../vim-8.0.1549/src/gui_gtk.c 2018-02-04 14:32:51.446193935 +0100 --- src/gui_gtk.c 2018-02-04 14:33:59.673697914 +0100 *************** *** 1895,1902 **** trigger.window = gtk_widget_get_window(gui.drawarea); trigger.send_event = FALSE; trigger.time = gui.event_time; ! trigger.x = 0.0; ! trigger.y = 0.0; trigger.axes = NULL; trigger.state = 0; trigger.button = 3; --- 1895,1902 ---- trigger.window = gtk_widget_get_window(gui.drawarea); trigger.send_event = FALSE; trigger.time = gui.event_time; ! trigger.x = 0.0; ! trigger.y = 0.0; trigger.axes = NULL; trigger.state = 0; trigger.button = 3; *************** *** 1983,1990 **** trigger.window = win; trigger.send_event = FALSE; trigger.time = GDK_CURRENT_TIME; ! trigger.x = 0.0; ! trigger.y = 0.0; trigger.axes = NULL; trigger.state = 0; trigger.button = 0; --- 1983,1990 ---- trigger.window = win; trigger.send_event = FALSE; trigger.time = GDK_CURRENT_TIME; ! trigger.x = 0.0; ! trigger.y = 0.0; trigger.axes = NULL; trigger.state = 0; trigger.button = 0; *** ../vim-8.0.1549/src/if_xcmdsrv.c 2017-09-09 16:25:49.154576764 +0200 --- src/if_xcmdsrv.c 2017-10-15 13:58:20.523954356 +0200 *************** *** 1123,1129 **** * This procedure is invoked by the various X event loops throughout Vims when * a property changes on the communication window. This procedure reads the * property and enqueues command requests and responses. If immediate is true, ! * it runs the event immediatly instead of enqueuing it. Immediate can cause * unintended behavior and should only be used for code that blocks for a * response. */ --- 1123,1129 ---- * This procedure is invoked by the various X event loops throughout Vims when * a property changes on the communication window. This procedure reads the * property and enqueues command requests and responses. If immediate is true, ! * it runs the event immediately instead of enqueuing it. Immediate can cause * unintended behavior and should only be used for code that blocks for a * response. */ *** ../vim-8.0.1549/src/pty.c 2017-10-28 21:08:38.991456926 +0200 --- src/pty.c 2018-02-04 14:39:45.023195062 +0100 *************** *** 268,274 **** #endif #if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux) \ ! && !(defined(MACOS_X) && !defined(MAC_OS_X_VERSION_10_6)) /* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work! * Same for Mac OS X Leopard (10.5). */ --- 268,274 ---- #endif #if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux) \ ! && !(defined(MACOS_X) && !defined(MAC_OS_X_VERSION_10_6)) /* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work! * Same for Mac OS X Leopard (10.5). */ *** ../vim-8.0.1549/src/if_python.c 2018-01-31 21:48:25.224668815 +0100 --- src/if_python.c 2018-02-04 14:35:28.777051024 +0100 *************** *** 74,80 **** #undef HAVE_FCNTL_H /* Clash with os_win32.h */ #define PyBytes_FromString PyString_FromString ! #define PyBytes_Check PyString_Check #define PyBytes_AsStringAndSize PyString_AsStringAndSize #if !defined(FEAT_PYTHON) && defined(PROTO) --- 74,80 ---- #undef HAVE_FCNTL_H /* Clash with os_win32.h */ #define PyBytes_FromString PyString_FromString ! #define PyBytes_Check PyString_Check #define PyBytes_AsStringAndSize PyString_AsStringAndSize #if !defined(FEAT_PYTHON) && defined(PROTO) *** ../vim-8.0.1549/src/if_py_both.h 2017-11-09 22:10:29.188559134 +0100 --- src/if_py_both.h 2018-01-31 20:50:19.522716278 +0100 *************** *** 5996,6002 **** PyObject *capsule; char hexBuf[sizeof(void *) * 2 + 3]; ! sprintf(hexBuf, "%p", obj); # ifdef PY_USE_CAPSULE capsule = PyDict_GetItemString(lookup_dict, hexBuf); --- 5996,6002 ---- PyObject *capsule; char hexBuf[sizeof(void *) * 2 + 3]; ! sprintf(hexBuf, "%p", (void *)obj); # ifdef PY_USE_CAPSULE capsule = PyDict_GetItemString(lookup_dict, hexBuf); *** ../vim-8.0.1549/uninstal.txt 2016-09-21 22:41:21.297603445 +0200 --- uninstal.txt 2017-07-19 11:09:11.138853125 +0200 *************** *** 5,11 **** 1. With the GUI uninstaller. This is only available when Vim was installed with the self-installing executable. This has a minimal number of questions. It can delete ! everything that was installed. This also unregisters the VisVim.dll 2. With uninstal.exe. This removes most installed items, but does not delete the files you --- 5,11 ---- 1. With the GUI uninstaller. This is only available when Vim was installed with the self-installing executable. This has a minimal number of questions. It can delete ! everything that was installed. This also unregisters the VisVim.dll. 2. With uninstal.exe. This removes most installed items, but does not delete the files you *************** *** 17,23 **** have to use uninstal.exe. It's recommended to use the method that matches with how you installed Vim. ! Thus if you installed Vim by hand, deleted it by hand. The first two methods should be available from the Add/Remove software window and the Vim entry in the Start menu. If these have been removed already, find --- 17,23 ---- have to use uninstal.exe. It's recommended to use the method that matches with how you installed Vim. ! Thus if you installed Vim by hand, delete it by hand. The first two methods should be available from the Add/Remove software window and the Vim entry in the Start menu. If these have been removed already, find *************** *** 33,40 **** menu entry. You only need to run uninstal.exe when you have installed the menu entry. You can also run uninstal.exe from the Control panel with the Add/Remove programs application. ! Note that uninstal.exe offers you to uninstal other items. You can skip ! this. 2. Only if you have used the OLE version of gvim: Remove the registration of this program by running "gvim -unregister" in a console window. --- 33,40 ---- menu entry. You only need to run uninstal.exe when you have installed the menu entry. You can also run uninstal.exe from the Control panel with the Add/Remove programs application. ! Note that uninstal.exe offers you the option to uninstal other items. You ! can skip this. 2. Only if you have used the OLE version of gvim: Remove the registration of this program by running "gvim -unregister" in a console window. *************** *** 46,52 **** If you created .bat files when installing Vim, also search for vim.bat, gvim.bat, etc. ! 4. If you completely want to delete vim, and are not going to install another version, you can delete the vimrc files that you created. These are normally located in a directory like "C:\vim". If the $VIM environment variable is set, it will tell the name of the directory. Normally you can --- 46,52 ---- If you created .bat files when installing Vim, also search for vim.bat, gvim.bat, etc. ! 4. If you want to completely delete vim, and are not going to install another version, you can delete the vimrc files that you created. These are normally located in a directory like "C:\vim". If the $VIM environment variable is set, it will tell the name of the directory. Normally you can *** ../vim-8.0.1549/src/dosinst.c 2017-10-28 18:49:57.272590807 +0200 --- src/dosinst.c 2018-02-04 14:34:33.421452793 +0100 *************** *** 1200,1207 **** /* If the path has a space: When using cmd.exe (Win NT/2000/XP) put * quotes around the diff command and rely on the default value of ! * shellxquote to solve the quoting problem for the whole command. ! * * Otherwise put a double quote just before the space and at the * end of the command. Putting quotes around the whole thing * doesn't work on Win 95/98/ME. This is mostly guessed! */ --- 1200,1207 ---- /* If the path has a space: When using cmd.exe (Win NT/2000/XP) put * quotes around the diff command and rely on the default value of ! * shellxquote to solve the quoting problem for the whole command. ! * * Otherwise put a double quote just before the space and at the * end of the command. Putting quotes around the whole thing * doesn't work on Win 95/98/ME. This is mostly guessed! */ *** ../vim-8.0.1549/src/iscygpty.c 2017-08-31 21:35:41.370946946 +0200 --- src/iscygpty.c 2018-02-04 14:36:41.048526980 +0100 *************** *** 62,81 **** //#define USE_DYNFILEID #ifdef USE_DYNFILEID typedef BOOL (WINAPI *pfnGetFileInformationByHandleEx)( ! HANDLE hFile, ! FILE_INFO_BY_HANDLE_CLASS FileInformationClass, ! LPVOID lpFileInformation, ! DWORD dwBufferSize ! ); static pfnGetFileInformationByHandleEx pGetFileInformationByHandleEx = NULL; # ifndef USE_FILEEXTD static BOOL WINAPI stub_GetFileInformationByHandleEx( ! HANDLE hFile, ! FILE_INFO_BY_HANDLE_CLASS FileInformationClass, ! LPVOID lpFileInformation, ! DWORD dwBufferSize ! ) { return FALSE; } --- 62,79 ---- //#define USE_DYNFILEID #ifdef USE_DYNFILEID typedef BOOL (WINAPI *pfnGetFileInformationByHandleEx)( ! HANDLE hFile, ! FILE_INFO_BY_HANDLE_CLASS FileInformationClass, ! LPVOID lpFileInformation, ! DWORD dwBufferSize); static pfnGetFileInformationByHandleEx pGetFileInformationByHandleEx = NULL; # ifndef USE_FILEEXTD static BOOL WINAPI stub_GetFileInformationByHandleEx( ! HANDLE hFile, ! FILE_INFO_BY_HANDLE_CLASS FileInformationClass, ! LPVOID lpFileInformation, ! DWORD dwBufferSize) { return FALSE; } *** ../vim-8.0.1549/src/vimrun.c 2016-08-29 22:42:21.000000000 +0200 --- src/vimrun.c 2018-02-04 14:41:37.342447903 +0100 *************** *** 55,61 **** ++p; } while (*p == L' ') ! ++p; /* * "-s" argument: don't wait for a key hit. --- 55,61 ---- ++p; } while (*p == L' ') ! ++p; /* * "-s" argument: don't wait for a key hit. *** ../vim-8.0.1549/src/os_vms.c 2016-11-04 20:35:27.352945991 +0100 --- src/os_vms.c 2018-02-04 14:39:31.771290916 +0100 *************** *** 18,24 **** /* based on Alpha's gen64def.h; the file is absent on VAX */ typedef struct _generic_64 { # pragma __nomember_alignment ! __union { /* You can treat me as... */ /* long long is not available on VAXen */ /* unsigned __int64 gen64$q_quadword; ...a single 64-bit value, or */ --- 18,24 ---- /* based on Alpha's gen64def.h; the file is absent on VAX */ typedef struct _generic_64 { # pragma __nomember_alignment ! __union { /* You can treat me as... */ /* long long is not available on VAXen */ /* unsigned __int64 gen64$q_quadword; ...a single 64-bit value, or */ *************** *** 461,468 **** result = decc$translate_vms(vms_fixfilename(buf)); if ( (int) result == 0 || (int) result == -1 ) { cnt = 0; ! } ! else { cnt = decc$to_vms(result, vms_wproc, 1 /*allow wild*/ , (flags & EW_DIR ? 0:1 ) /*allow directory*/) ; } if (cnt > 0) --- 461,467 ---- result = decc$translate_vms(vms_fixfilename(buf)); if ( (int) result == 0 || (int) result == -1 ) { cnt = 0; ! } else { cnt = decc$to_vms(result, vms_wproc, 1 /*allow wild*/ , (flags & EW_DIR ? 0:1 ) /*allow directory*/) ; } if (cnt > 0) *************** *** 519,528 **** /* otherwise it might create ACCVIO error in decc$to_vms */ result = decc$translate_vms(vms_fixfilename(path)); if ( (int) result == 0 || (int) result == -1 ) { ! cnt = 0; ! } ! else { ! cnt = decc$to_vms(result, vms_wproc, 1 /*allow_wild*/, (flags & EW_DIR ? 0:1 ) /*allow directory*/); } if (cnt > 0) cnt = vms_match_num; --- 518,526 ---- /* otherwise it might create ACCVIO error in decc$to_vms */ result = decc$translate_vms(vms_fixfilename(path)); if ( (int) result == 0 || (int) result == -1 ) { ! cnt = 0; ! } else { ! cnt = decc$to_vms(result, vms_wproc, 1 /*allow_wild*/, (flags & EW_DIR ? 0:1 ) /*allow directory*/); } if (cnt > 0) cnt = vms_match_num; *************** *** 741,808 **** get_tty(); if (sec > 0) { ! /* time-out specified; convert it to absolute time */ /* sec>0 requirement of lib$cvtf_to_internal_time()*/ ! /* get current time (number of 100ns ticks since the VMS Epoch) */ ! status = sys$gettim(&time_curr); ! if (status != SS$_NORMAL) ! return 0; /* error */ ! /* construct the delta time */ #if __G_FLOAT==0 # ifndef VAX /* IEEE is default on IA64, but can be used on Alpha too - but not on VAX */ ! status = lib$cvts_to_internal_time( ! &convert_operation, &sec, &time_diff); # endif #else /* default on Alpha and VAX */ ! status = lib$cvtf_to_internal_time( &convert_operation, &sec, &time_diff); #endif ! if (status != LIB$_NORMAL) ! return 0; /* error */ ! /* add them up */ ! status = lib$add_times( ! &time_curr, ! &time_diff, ! &time_out); ! if (status != LIB$_NORMAL) ! return 0; /* error */ } while (TRUE) { ! /* select() */ ! status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb, ! 0, 0, &typeahead, 8, 0, 0, 0, 0); if (status != SS$_NORMAL || (iosb[0] & 0xFFFF) != SS$_NORMAL) ! return 0; /* error */ ! if (typeahead.numchars) ! return 1; /* ready to read */ ! /* there's nothing to read; what now? */ ! if (msec == 0) { ! /* immediate time-out; return impatiently */ ! return 0; ! } ! else if (msec < 0) { ! /* no time-out; wait on indefinitely */ ! continue; ! } ! else { ! /* time-out needs to be checked */ ! status = sys$gettim(&time_curr); ! if (status != SS$_NORMAL) ! return 0; /* error */ ! ! status = lib$sub_times( ! &time_out, ! &time_curr, ! &time_diff); ! if (status != LIB$_NORMAL) ! return 0; /* error, incl. time_diff < 0 (i.e. time-out) */ ! /* otherwise wait some more */ ! } } } --- 739,804 ---- get_tty(); if (sec > 0) { ! /* time-out specified; convert it to absolute time */ /* sec>0 requirement of lib$cvtf_to_internal_time()*/ ! /* get current time (number of 100ns ticks since the VMS Epoch) */ ! status = sys$gettim(&time_curr); ! if (status != SS$_NORMAL) ! return 0; /* error */ ! /* construct the delta time */ #if __G_FLOAT==0 # ifndef VAX /* IEEE is default on IA64, but can be used on Alpha too - but not on VAX */ ! status = lib$cvts_to_internal_time( ! &convert_operation, &sec, &time_diff); # endif #else /* default on Alpha and VAX */ ! status = lib$cvtf_to_internal_time( &convert_operation, &sec, &time_diff); #endif ! if (status != LIB$_NORMAL) ! return 0; /* error */ ! /* add them up */ ! status = lib$add_times( ! &time_curr, ! &time_diff, ! &time_out); ! if (status != LIB$_NORMAL) ! return 0; /* error */ } while (TRUE) { ! /* select() */ ! status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb, ! 0, 0, &typeahead, 8, 0, 0, 0, 0); if (status != SS$_NORMAL || (iosb[0] & 0xFFFF) != SS$_NORMAL) ! return 0; /* error */ ! if (typeahead.numchars) ! return 1; /* ready to read */ ! /* there's nothing to read; what now? */ ! if (msec == 0) { ! /* immediate time-out; return impatiently */ ! return 0; ! } else if (msec < 0) { ! /* no time-out; wait on indefinitely */ ! continue; ! } else { ! /* time-out needs to be checked */ ! status = sys$gettim(&time_curr); ! if (status != SS$_NORMAL) ! return 0; /* error */ ! ! status = lib$sub_times( ! &time_out, ! &time_curr, ! &time_diff); ! if (status != LIB$_NORMAL) ! return 0; /* error, incl. time_diff < 0 (i.e. time-out) */ ! /* otherwise wait some more */ ! } } } *** ../vim-8.0.1549/src/version.c 2018-02-27 17:17:32.443413957 +0100 --- src/version.c 2018-02-27 17:20:07.290426380 +0100 *************** *** 780,781 **** --- 780,783 ---- { /* Add new patch number below this line */ + /**/ + 1550, /**/ -- "I love deadlines. I especially like the whooshing sound they make as they go flying by." -- Douglas Adams /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///