Re: Comments halfway continuation lines
On Monday, August 20, 2018 at 1:37:53 AM UTC+9, Bram Moolenaar wrote: > Currently, when making a list with continuation lines, it is not > possible to add a comment somewhere: > > let array = [ > \ item, > \ item, > \ item, > \] > > Adding a comment after the comma causes all the rest to be included in > the comment: > > let array = [ > \ item, > \ item, " comment > \ item, > \] > > Since this is equivalent to: > > let array = [ item, item, " comment item, ] > > Simple solutions will such as using \" fail, because just about anything > following the backslash is valid if we are inside a string: > > echo "some > \ word > \" comment > \ word > > Is equivalent to the valid command: > > echo "some word" comment word > > So, a line starting with a backslash can't be used for a comment. > Thinking about what would work (that is, currently it is an error), I > thought of using |\": > > let array = [ > \ item, > |\" comment > \ item, > \] > > It looks a bit weird, but it would work. Any thoughts? > > -- > Mynd you, m00se bites Kan be pretty nasti ... > "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD > > /// Bram Moolenaar -- b...@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/// I like this. https://go-gyazo.appspot.com/04e22439cfdc859e.png Most of people expect comments can be written as syntax is. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
hitting 'y' in auto-confirm dialog has no effect
my problem is with the gui, specifically gtk3 in opensuse leap 42.3 i like to keep 'confirm' set, because it's so often quicker to quit and confirm a save than to save then quit (it's my workflow so i get to decide) -- anyway when i started building with gtk3 instead of gtk2 i noticed that the dialog that appears for the gui offering to save my changes does not respond to the 'y' key or highlight different buttons in response to the tab key -- it defaults to Yes so if i just hit Enter then it responds to that as a press of the Yes button and saves my changes, but it niggles at me and i wonder if anyone has some ideas as to how i might make that silly dialog act right also it responds appropriately to Esc and puts you back in the buffer, so i can't claim this is a life threatening problem -- oh it responds to mouse clicks too, but dammit i'm a vimmer! terminal vim has no such problem and responds appropriately to a press of 'y' my vim at last glance was at 8.1.300 -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Patch 8.1.0301
Patch 8.1.0301 Problem:GTK: Input method popup displayed on wrong screen. Solution: Add the screen position offset. (Ken Takata, closes #3268) Files: src/gui_beval.c, src/gui_gtk_x11.c, src/mbyte.c, src/proto/gui_gtk_x11.pro *** ../vim-8.1.0300/src/gui_beval.c 2018-06-28 12:05:07.085006926 +0200 --- src/gui_beval.c 2018-08-19 22:45:48.73152 +0200 *** *** 944,949 --- 944,951 GtkRequisition requisition; int screen_w; int screen_h; + int screen_x; + int screen_y; int x; int y; int x_offset = EVAL_OFFSET_X; *** *** 956,963 screen = gtk_widget_get_screen(beval->target); gtk_window_set_screen(GTK_WINDOW(beval->balloonShell), screen); # endif ! gui_gtk_get_screen_size_of_win(beval->balloonShell, !_w, _h); # if !GTK_CHECK_VERSION(3,0,0) gtk_widget_ensure_style(beval->balloonShell); gtk_widget_ensure_style(beval->balloonLabel); --- 958,965 screen = gtk_widget_get_screen(beval->target); gtk_window_set_screen(GTK_WINDOW(beval->balloonShell), screen); # endif ! gui_gtk_get_screen_geom_of_win(beval->balloonShell, ! _x, _y, _w, _h); # if !GTK_CHECK_VERSION(3,0,0) gtk_widget_ensure_style(beval->balloonShell); gtk_widget_ensure_style(beval->balloonLabel); *** *** 998,1011 y += beval->y; /* Get out of the way of the mouse pointer */ ! if (x + x_offset + requisition.width > screen_w) y_offset += 15; ! if (y + y_offset + requisition.height > screen_h) y_offset = -requisition.height - EVAL_OFFSET_Y; /* Sanitize values */ ! x = CLAMP(x + x_offset, 0, MAX(0, screen_w - requisition.width)); ! y = CLAMP(y + y_offset, 0, MAX(0, screen_h - requisition.height)); /* Show the balloon */ # if GTK_CHECK_VERSION(3,0,0) --- 1000,1015 y += beval->y; /* Get out of the way of the mouse pointer */ ! if (x + x_offset + requisition.width > screen_x + screen_w) y_offset += 15; ! if (y + y_offset + requisition.height > screen_y + screen_h) y_offset = -requisition.height - EVAL_OFFSET_Y; /* Sanitize values */ ! x = CLAMP(x + x_offset, 0, ! MAX(0, screen_x + screen_w - requisition.width)); ! y = CLAMP(y + y_offset, 0, ! MAX(0, screen_y + screen_h - requisition.height)); /* Show the balloon */ # if GTK_CHECK_VERSION(3,0,0) *** ../vim-8.1.0300/src/gui_gtk_x11.c 2018-08-07 20:01:34.245746660 +0200 --- src/gui_gtk_x11.c 2018-08-19 22:54:38.120976094 +0200 *** *** 5008,5034 } void ! gui_gtk_get_screen_size_of_win(GtkWidget *wid, int *width, int *height) { #if GTK_CHECK_VERSION(3,22,0) GdkDisplay *dpy = gtk_widget_get_display(wid); - GdkWindow *win = gtk_widget_get_window(wid); GdkMonitor *monitor = gdk_display_get_monitor_at_window(dpy, win); - GdkRectangle geometry; gdk_monitor_get_geometry(monitor, ); - *width = geometry.width; - *height = geometry.height; #else GdkScreen* screen; if (wid != NULL && gtk_widget_has_screen(wid)) screen = gtk_widget_get_screen(wid); else screen = gdk_screen_get_default(); ! *width = gdk_screen_get_width(screen); ! *height = gdk_screen_get_height(screen); #endif } /* --- 5008,5042 } void ! gui_gtk_get_screen_geom_of_win( ! GtkWidget *wid, ! int *screen_x, ! int *screen_y, ! int *width, ! int *height) { + GdkRectangle geometry; + GdkWindow *win = gtk_widget_get_window(wid); #if GTK_CHECK_VERSION(3,22,0) GdkDisplay *dpy = gtk_widget_get_display(wid); GdkMonitor *monitor = gdk_display_get_monitor_at_window(dpy, win); gdk_monitor_get_geometry(monitor, ); #else GdkScreen* screen; + int monitor; if (wid != NULL && gtk_widget_has_screen(wid)) screen = gtk_widget_get_screen(wid); else screen = gdk_screen_get_default(); ! monitor = gdk_screen_get_monitor_at_window(screen, win); ! gdk_screen_get_monitor_geometry(screen, monitor, ); #endif + *screen_x = geometry.x; + *screen_y = geometry.y; + *width = geometry.width; + *height = geometry.height; } /* *** *** 5039,5045 void gui_mch_get_screen_dimensions(int *screen_w, int *screen_h) { ! gui_gtk_get_screen_size_of_win(gui.mainwin, screen_w, screen_h); /* Subtract 'guiheadroom' from the height to allow some room for the * window manager (task list and window title bar). */ --- 5047,5055 void
Patch 8.1.0300
Patch 8.1.0300 Problem:The old window title might be freed twice. (Dominique Pelle) Solution: Do not free "oldtitle" in a signal handler but set a flag to have it freed later. Files: src/os_unix.c *** ../vim-8.1.0299/src/os_unix.c 2018-08-11 13:57:16.215969777 +0200 --- src/os_unix.c 2018-08-19 22:13:19.187362836 +0200 *** *** 161,166 --- 161,167 static int get_x11_icon(int); static char_u *oldtitle = NULL; + static volatile int oldtitle_outdated = FALSE; static intdid_set_title = FALSE; static char_u *oldicon = NULL; static intdid_set_icon = FALSE; *** *** 1231,1238 after_sigcont(void) { # ifdef FEAT_TITLE ! // Set oldtitle to NULL, so the current title is obtained again. ! VIM_CLEAR(oldtitle); # endif settmode(TMODE_RAW); need_check_timestamps = TRUE; --- 1232,1240 after_sigcont(void) { # ifdef FEAT_TITLE ! // Don't change "oldtitle" in a signal handler, set a flag to obtain it ! // again later. ! oldtitle_outdated = TRUE; # endif settmode(TMODE_RAW); need_check_timestamps = TRUE; *** *** 2281,2286 --- 2283,2293 */ if ((type || *T_TS != NUL) && title != NULL) { + if (oldtitle_outdated) + { + oldtitle_outdated = FALSE; + VIM_CLEAR(oldtitle); + } if (oldtitle == NULL #ifdef FEAT_GUI && !gui.in_use *** ../vim-8.1.0299/src/version.c 2018-08-19 17:03:57.369405009 +0200 --- src/version.c 2018-08-19 22:11:53.003778230 +0200 *** *** 796,797 --- 796,799 { /* Add new patch number below this line */ + /**/ + 300, /**/ -- System administrators are just like women: You can't live with them and you can't live without them. /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Comments halfway continuation lines
On Sun, Aug 19, 2018 at 6:37 PM, Bram Moolenaar wrote: > > Currently, when making a list with continuation lines, it is not > possible to add a comment somewhere: > > let array = [ > \ item, > \ item, > \ item, > \] > > Adding a comment after the comma causes all the rest to be included in > the comment: > > let array = [ > \ item, > \ item, " comment > \ item, > \] > > Since this is equivalent to: > > let array = [ item, item, " comment item, ] > > Simple solutions will such as using \" fail, because just about anything > following the backslash is valid if we are inside a string: > > echo "some > \ word > \" comment > \ word > > Is equivalent to the valid command: > > echo "some word" comment word > > So, a line starting with a backslash can't be used for a comment. > Thinking about what would work (that is, currently it is an error), I > thought of using |\": > > let array = [ > \ item, > |\" comment > \ item, > \] > > It looks a bit weird, but it would work. Any thoughts? > > -- > Mynd you, m00se bites Kan be pretty nasti ... > "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD > > /// Bram Moolenaar -- b...@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/// In the case of a List, you can construct it by concatenation, though it might be a little slower at run-time, depending on how densely you want to comment: let array = [ \ "one", \ "two", \ ] " three is intentionally omitted call extend(array, [ \ "four", \ "five", \ "six", \ ]) Similarly I suppose for other arithmetic operations: hold the temporary results in one or more variables, insert the comment after temporarily ending the computation, and go on from there. Best regards, Tony. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Comments halfway continuation lines
Currently, when making a list with continuation lines, it is not possible to add a comment somewhere: let array = [ \ item, \ item, \ item, \] Adding a comment after the comma causes all the rest to be included in the comment: let array = [ \ item, \ item, " comment \ item, \] Since this is equivalent to: let array = [ item, item, " comment item, ] Simple solutions will such as using \" fail, because just about anything following the backslash is valid if we are inside a string: echo "some \ word \" comment \ word Is equivalent to the valid command: echo "some word" comment word So, a line starting with a backslash can't be used for a comment. Thinking about what would work (that is, currently it is an error), I thought of using |\": let array = [ \ item, |\" comment \ item, \] It looks a bit weird, but it would work. Any thoughts? -- Mynd you, m00se bites Kan be pretty nasti ... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Patch 8.1.0299
Patch 8.1.0299 (after 8.1.0298) Problem:misplaced comment Solution: Remove comment Files: src/testdir/runtest.vim *** ../vim-8.1.0298/src/testdir/runtest.vim 2018-08-19 16:09:15.374103260 +0200 --- src/testdir/runtest.vim 2018-08-19 16:52:33.834574032 +0200 *** *** 272,278 \ 'Test_paused()', \ 'Test_pipe_through_sort_all()', \ 'Test_pipe_through_sort_some()', ! \ 'Test_popup_and_window_resize()', " sometimes fails on Mac \ 'Test_quoteplus()', \ 'Test_quotestar()', \ 'Test_reltime()', --- 272,278 \ 'Test_paused()', \ 'Test_pipe_through_sort_all()', \ 'Test_pipe_through_sort_some()', ! \ 'Test_popup_and_window_resize()', \ 'Test_quoteplus()', \ 'Test_quotestar()', \ 'Test_reltime()', *** ../vim-8.1.0298/src/version.c 2018-08-19 16:09:15.378103236 +0200 --- src/version.c 2018-08-19 16:53:09.818358203 +0200 *** *** 796,797 --- 796,799 { /* Add new patch number below this line */ + /**/ + 299, /**/ -- To keep milk from turning sour: Keep it in the cow. /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Patch 8.1.0298
Patch 8.1.0298 Problem:Window resize test sometimes fails on Mac. Solution: Add Test_popup_and_window_resize() to flaky tests. Files: src/testdir/runtest.vim *** ../vim-8.1.0297/src/testdir/runtest.vim 2018-06-12 14:58:35.566840630 +0200 --- src/testdir/runtest.vim 2018-08-19 15:46:43.666107201 +0200 *** *** 272,277 --- 272,278 \ 'Test_paused()', \ 'Test_pipe_through_sort_all()', \ 'Test_pipe_through_sort_some()', + \ 'Test_popup_and_window_resize()', " sometimes fails on Mac \ 'Test_quoteplus()', \ 'Test_quotestar()', \ 'Test_reltime()', *** ../vim-8.1.0297/src/version.c 2018-08-19 14:38:38.979859032 +0200 --- src/version.c 2018-08-19 15:47:31.893813723 +0200 *** *** 796,797 --- 796,799 { /* Add new patch number below this line */ + /**/ + 298, /**/ -- Mushrooms always grow in damp places and so they look like umbrellas. /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Patch 8.1.0297
Patch 8.1.0297 (after 8.1.0294) Problem:MS-Windows: tests fail, Vim crashes. Solution: Fix long file name handling. Files: src/os_win32.c *** ../vim-8.1.0296/src/os_win32.c 2018-08-18 20:20:23.335417254 +0200 --- src/os_win32.c 2018-08-19 14:36:25.032599518 +0200 *** *** 3109,3114 --- 3109,3115 int len) { char_u abuf[_MAX_PATH + 1]; + DWORD lfnlen; /* * Originally this was: *** *** 3124,3134 if (GetCurrentDirectoryW(_MAX_PATH, wbuf) != 0) { WCHAR wcbuf[_MAX_PATH + 1]; ! char_u *p; if (GetLongPathNameW(wbuf, wcbuf, _MAX_PATH) != 0) p = utf16_to_enc(wcbuf, NULL); ! else p = utf16_to_enc(wbuf, NULL); if (p != NULL) --- 3125,3143 if (GetCurrentDirectoryW(_MAX_PATH, wbuf) != 0) { WCHAR wcbuf[_MAX_PATH + 1]; ! char_u *p = NULL; if (GetLongPathNameW(wbuf, wcbuf, _MAX_PATH) != 0) + { p = utf16_to_enc(wcbuf, NULL); ! if (STRLEN(p) >= (size_t)len) ! { ! // long path name is too long, fall back to short one ! vim_free(p); ! p = NULL; ! } ! } ! if (p == NULL) p = utf16_to_enc(wbuf, NULL); if (p != NULL) *** *** 3143,3153 #endif if (GetCurrentDirectory(len, (LPSTR)buf) == 0) return FAIL; ! if (GetLongPathNameA((LPSTR)buf, (LPSTR)abuf, _MAX_PATH) == 0) ! // return the short path name return OK; ! vim_strncpy(abuf, buf, len - 1); return OK; } --- 3152,3164 #endif if (GetCurrentDirectory(len, (LPSTR)buf) == 0) return FAIL; ! lfnlen = GetLongPathNameA((LPCSTR)buf, (LPSTR)abuf, _MAX_PATH); ! if (lfnlen == 0 || lfnlen >= (DWORD)len) ! // Failed to get long path name or it's too long: fall back to the ! // short path name. return OK; ! STRCPY(buf, abuf); return OK; } *** ../vim-8.1.0296/src/version.c 2018-08-18 21:23:00.787474060 +0200 --- src/version.c 2018-08-19 14:33:49.277455703 +0200 *** *** 796,797 --- 796,799 { /* Add new patch number below this line */ + /**/ + 297, /**/ -- The most powerful force in the universe is gossip. /// Bram Moolenaar -- b...@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/// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.1.0294
Both commands behave identically. Sometimes they just stop working (no output at all), at other times they create a Windows MiniDump (i.e. Werfault shows up). This used to work with 292. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.1.0294
@Tony It crashes (WerFault comes up) (so it finishes not quite so silently ;-), producing a Windows MiniDump file... This used to work with 292. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.1.0294
On Sun, Aug 19, 2018 at 10:38 AM, Axel Bender wrote: > Probably correlated with this patch (did not bisect, but must have happened > between 292 and 296 inclusively), but the following command stopped to work > for me on Windows: > > gvim.exe --servername GVX --remote-silent +"silent! bwipeout 1" "" > > The command fails silently... > What does it say if you make it less silent? gvim --servername GVX --remote +"bwipeout 1" "" Best regards, Tony. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.1.0294
Probably correlated with this patch (did not bisect, but must have happened between 292 and 296 inclusively), but the following command stopped to work for me on Windows: gvim.exe --servername GVX --remote-silent +"silent! bwipeout 1" "" The command fails silently... -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.