Re: Patch 8.0.1570

2018-03-05 Fir de Conversatie Wei Zhang
Thanks a lot, I always can't remember my keymaps and need to check the vimrc 
again and again when I forget some. popup windows will help me and other 
newbees.

An issue has been found during my test: 

When you are navigating the items in the popup with arrow keys, you can see the 
cursor is visible and locate just behind the current selected item.

I suppose cursor should be invisible when popup window is in-use ??

And on last thing, special character '&' can not be used in the TUI popup,

:amenu PopUp.Cscope\ &Definition  :cs find g =expand("")
:amenu PopUp.Cscope\ &Symbol:cs find s =expand("")
:amenu PopUp.Cscope\ &Callee:cs find c =expand("")
:amenu PopUp.Cscope\ &Assigned:cs find a =expand("")

I always forget cscope commands, so, it's necessary for me to put them into a 
popup menu and give each item a shortcut by using '&'.

This shortcuts can be used on gvim but it doesn't work in TUI now.


在 2018年3月6日星期二 UTC+8上午4:07:01,Bram Moolenaar写道:
> Patch 8.0.1570
> Problem:Can't use :popup for a menu in the terminal. (Wei Zhang)
> Solution:   Make :popup work in the terminal.  Also fix that entries were
> included that don't work in the current state.
> Files:  src/ex_docmd.c, src/popupmnu.c, src/proto/popupmnu.pro,
> src/menu.c, src/proto/menu.pro
> 
> 
> *** ../vim-8.0.1569/src/ex_docmd.c2018-03-04 20:14:08.244064367 +0100
> --- src/ex_docmd.c2018-03-05 20:33:27.651337765 +0100
> ***
> *** 204,210 
>   #else
>   # define ex_tearoff ex_ni
>   #endif
> ! #if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU)
>   static void ex_popup(exarg_T *eap);
>   #else
>   # define ex_popup   ex_ni
> --- 204,211 
>   #else
>   # define ex_tearoff ex_ni
>   #endif
> ! #if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
> ! || defined(FEAT_TERM_POPUP_MENU)) && defined(FEAT_MENU)
>   static void ex_popup(exarg_T *eap);
>   #else
>   # define ex_popup   ex_ni
> ***
> *** 8741,8751 
>   }
>   #endif
>   
> ! #if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU)
>   static void
>   ex_popup(exarg_T *eap)
>   {
> ! gui_make_popup(eap->arg, eap->forceit);
>   }
>   #endif
>   
> --- 8742,8762 
>   }
>   #endif
>   
> ! #if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
> ! || defined(FEAT_TERM_POPUP_MENU)) && defined(FEAT_MENU)
>   static void
>   ex_popup(exarg_T *eap)
>   {
> ! # if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)
> ! if (gui.in_use)
> ! gui_make_popup(eap->arg, eap->forceit);
> ! #  ifdef FEAT_TERM_POPUP_MENU
> ! else
> ! #  endif
> ! # endif
> ! # ifdef FEAT_TERM_POPUP_MENU
> ! pum_make_popup(eap->arg, eap->forceit);
> ! # endif
>   }
>   #endif
>   
> *** ../vim-8.0.1569/src/popupmnu.c2018-03-03 18:59:11.612531627 +0100
> --- src/popupmnu.c2018-03-05 21:01:01.461275616 +0100
> ***
> *** 1132,1143 
>   #ifdef FEAT_BEVAL_TERM
>   int save_bevalterm = p_bevalterm;
>   #endif
>   
>   pum_undisplay();
>   pum_size = 0;
>   
>   for (mp = menu->children; mp != NULL; mp = mp->next)
> ! ++pum_size;
>   
>   array = (pumitem_T *)alloc_clear((unsigned)sizeof(pumitem_T) * 
> pum_size);
>   if (array == NULL)
> --- 1132,1147 
>   #ifdef FEAT_BEVAL_TERM
>   int save_bevalterm = p_bevalterm;
>   #endif
> + int mode;
>   
>   pum_undisplay();
>   pum_size = 0;
> + mode = get_menu_mode_flag();
>   
>   for (mp = menu->children; mp != NULL; mp = mp->next)
> ! if (menu_is_separator(mp->dname)
> ! || (mp->modes & mp->enabled & mode))
> ! ++pum_size;
>   
>   array = (pumitem_T *)alloc_clear((unsigned)sizeof(pumitem_T) * 
> pum_size);
>   if (array == NULL)
> ***
> *** 1146,1152 
>   for (mp = menu->children; mp != NULL; mp = mp->next)
>   if (menu_is_separator(mp->dname))
>   array[idx++].pum_text = (char_u *)"";
> ! else
>   array[idx++].pum_text = mp->dname;
>   
>   pum_array = array;
> --- 1150,1156 
>   for (mp = menu->children; mp != NULL; mp = mp->next)
>   if (menu_is_separator(mp->dname))
>   array[idx++].pum_text = (char_u *)"";
> ! else if (mp->modes & mp->enabled & mode)
>   array[idx++].pum_text = mp->dname;
>   
>   pum_array = array;
> ***
> *** 1232,1237 
> --- 1236,1259 
>   mch_setmouse(TRUE);
>   #  endif
>   }
> + 
> + void
> + pum_make_popup(char_u *path_name, int use_mouse_pos)
> + {
> + vimmenu_T *menu;
> + 
> + if (!use_mouse_pos)
> + {
> + /* Hack: set mouse position at the cursor so that the menu pops up
> +  * around there. */
> + mouse_row = curwin->w_winrow + curwin->w_wrow;
> + mouse_col = curwin->w_wincol + curwin->w_wcol;
> + }
> + 
> + menu = gui_find_menu(path_name);
> + if (menu != NULL)
> + 

Re: Error using MSys2 with git

2018-03-05 Fir de Conversatie Christian Brabandt

On Mo, 05 Mär 2018, Axel Bender wrote:

> I found the error: it turned out to be a setting in my .vimrc:
> 
> autocmd BufEnter * lcd %:p:h 

Well, check the filetype and make sure to trigger it only for files, 
something like this:

au BufEnter * let s:autocmd_file=expand('') | if 
getftype(s:autocmd_file) is# 'file' && filereadable(s:autocmd_file) | lcd %:p:h 
|endif

> which I use in place of autochdir (which doesn't work for me with
> --remote-silent). 

I wonder, if 'acd' shouldn't also apply in that case.


Best,
Christian
-- 
Selbst einer großen Armee kann man den Führer rauben, aber nicht
einmal einem einfachen Mann seinen Willen.
-- Konfuzius (551-479 v. Chr.)

-- 
-- 
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.0.1573

2018-03-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.1573
Problem:getwinpos(1) may cause response to be handled as command.
Solution:   Handle any cursor position report once one was request. (partly by
Hirohito Higashi)
Files:  src/term.c


*** ../vim-8.0.1572/src/term.c  2018-03-04 20:14:08.252064314 +0100
--- src/term.c  2018-03-05 22:41:17.476679622 +0100
***
*** 143,148 
--- 143,151 
  
  /* Request cursor style report: */
  static int rcs_status = STATUS_GET;
+ 
+ /* Request windos position report: */
+ static int winpos_status = STATUS_GET;
  # endif
  
  /*
***
*** 2778,2786 
&& p_ek;
  }
  
! static int winpos_x;
! static int winpos_y;
! static int waiting_for_winpos = FALSE;
  
  /*
   * Try getting the Vim window position from the terminal.
--- 2781,2789 
&& p_ek;
  }
  
! static int winpos_x = -1;
! static int winpos_y = -1;
! static int did_request_winpos = 0;
  
  /*
   * Try getting the Vim window position from the terminal.
***
*** 2790,2818 
  term_get_winpos(int *x, int *y, varnumber_T timeout)
  {
  int count = 0;
  
  if (*T_CGP == NUL || !can_get_termresponse())
return FAIL;
  winpos_x = -1;
  winpos_y = -1;
! waiting_for_winpos = TRUE;
  OUT_STR(T_CGP);
  out_flush();
  
  /* Try reading the result for "timeout" msec. */
! while (count++ < timeout / 10)
  {
(void)vpeekc_nomap();
if (winpos_x >= 0 && winpos_y >= 0)
{
*x = winpos_x;
*y = winpos_y;
-   waiting_for_winpos = FALSE;
return OK;
}
ui_delay(10, FALSE);
  }
! waiting_for_winpos = FALSE;
  return FALSE;
  }
  # endif
--- 2793,2835 
  term_get_winpos(int *x, int *y, varnumber_T timeout)
  {
  int count = 0;
+ int prev_winpos_x = winpos_x;
+ int prev_winpos_y = winpos_y;
  
  if (*T_CGP == NUL || !can_get_termresponse())
return FAIL;
  winpos_x = -1;
  winpos_y = -1;
! ++did_request_winpos;
! winpos_status = STATUS_SENT;
  OUT_STR(T_CGP);
  out_flush();
  
  /* Try reading the result for "timeout" msec. */
! while (count++ <= timeout / 10 && !got_int)
  {
(void)vpeekc_nomap();
if (winpos_x >= 0 && winpos_y >= 0)
{
*x = winpos_x;
*y = winpos_y;
return OK;
}
ui_delay(10, FALSE);
  }
! /* Do not reset "did_request_winpos", if we timed out the response might
!  * still come later and we must consume it. */
! 
! winpos_x = prev_winpos_x;
! winpos_y = prev_winpos_y;
! if (timeout < 10 && prev_winpos_y >= 0 && prev_winpos_y >= 0)
! {
!   /* Polling: return previous values if we have them. */
!   *x = winpos_x;
!   *y = winpos_y;
!   return OK;
! }
! 
  return FALSE;
  }
  # endif
***
*** 3365,3371 
  #endif
 || rbg_status == STATUS_SENT
 || rbm_status == STATUS_SENT
!|| rcs_status == STATUS_SENT))
(void)vpeekc_nomap();
check_for_codes_from_term();
}
--- 3382,3389 
  #endif
 || rbg_status == STATUS_SENT
 || rbm_status == STATUS_SENT
!|| rcs_status == STATUS_SENT
!|| winpos_status == STATUS_SENT))
(void)vpeekc_nomap();
check_for_codes_from_term();
}
***
*** 3439,3445 
  # endif
|| rbg_status == STATUS_SENT
|| rbm_status == STATUS_SENT
!   || rcs_status == STATUS_SENT)
{
  # ifdef UNIX
/* Give the terminal a chance to respond. */
--- 3457,3464 
  # endif
|| rbg_status == STATUS_SENT
|| rbm_status == STATUS_SENT
!   || rcs_status == STATUS_SENT
!   || winpos_status == STATUS_SENT)
{
  # ifdef UNIX
/* Give the terminal a chance to respond. */
***
*** 4468,4474 
 */
char_u *argp = tp[0] == ESC ? tp + 2 : tp + 1;
  
!   if ((*T_CRV != NUL || *T_U7 != NUL || waiting_for_winpos)
&& ((tp[0] == ESC && len >= 3 && tp[1] == '[')
|| (tp[0] == CSI && len >= 2))
&& (VIM_ISDIGIT(*argp) || *argp == '>' || *argp == '?'))
--- 4487,4493 
 */
char_u *argp = tp[0] == ESC ? tp + 2 : tp + 1;
  
!   if ((*T_CRV != NUL || *T_U7 != NUL || did_request_winpos)
&& ((tp[0] == ESC && len >= 3 && tp[1] == '[')
|| (tp[0] == CSI && len >= 2))
&& (VIM_ISDIGIT(*argp) |

Re: [patch] when `:echo getwinpos(1)` displays dust and next key is eaten

2018-03-05 Fir de Conversatie Bram Moolenaar

Hirohito Higashi wrote:

> patch for Vim 8.0.1563 or later. 
> Patch is here.
> https://gist.github.com/h-east/9eeebb2fc0f669c4f3cfb4c61e96e51a

Thanks.  However, I don't think it is enough, when calling getwinpos(1)
a few times in a row there can be multiple responses, we need to consume
them all.

I also think that we can use this to poll for the result.  If we
received the position while doing other work, then getwinpos(1) can
return that.

-- 
DENNIS: Oh, very nice. King, eh!  I expect you've got a palace and fine
clothes and courtiers and plenty of food.  And how d'you get that?  By
exploiting the workers! By hanging on to outdated imperialist dogma
which perpetuates the social and economic differences in our society!
 "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.0.1572

2018-03-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.1572
Problem:Mac: getting memory size doesn't work everywhere.
Solution:   Use MACOS_X instead of MACOS_X_DARWIN. (Kazunobu Kuriyama)
Files:  src/os_unix.c


*** ../vim-8.0.1571/src/os_unix.c   2018-03-05 10:54:49.412071984 +0100
--- src/os_unix.c   2018-03-05 21:57:58.943488995 +0100
***
*** 563,569 
  # if defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)
  #  include 
  # endif
! # ifdef MACOS_X_DARWIN
  #  include 
  #  include 
  # endif
--- 563,569 
  # if defined(HAVE_SYS_SYSINFO_H) && defined(HAVE_SYSINFO)
  #  include 
  # endif
! # ifdef MACOS_X
  #  include 
  #  include 
  # endif
***
*** 578,584 
  long_umem = 0;
  long_ushiftright = 10;  /* how much to shift "mem" right for Kbyte */
  
! # ifdef MACOS_X_DARWIN
  {
/* Mac (Darwin) way of getting the amount of RAM available */
mach_port_t host = mach_host_self();
--- 578,584 
  long_umem = 0;
  long_ushiftright = 10;  /* how much to shift "mem" right for Kbyte */
  
! # ifdef MACOS_X
  {
/* Mac (Darwin) way of getting the amount of RAM available */
mach_port_t host = mach_host_self();
*** ../vim-8.0.1571/src/version.c   2018-03-05 21:32:23.177321875 +0100
--- src/version.c   2018-03-05 21:58:54.783134078 +0100
***
*** 768,769 
--- 768,771 
  {   /* Add new patch number below this line */
+ /**/
+ 1572,
  /**/

-- 
ARTHUR: I've said I'm sorry about the old woman, but from the behind you
looked ...
DENNIS: What I object to is that you automatically treat me like an inferior...
ARTHUR: Well ... I AM king.
 "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.


Re: Cmdline autocommand event summaries missing from autocmd-events list

2018-03-05 Fir de Conversatie Bram Moolenaar

Gary Johnson wrote:

> The new cmdline autocommands are described in the alphabetical list
> of autocommand events (:help autocmd-events-abc), but their
> summaries are missing from the overview list (help
> autocommand-events) in Vim 8.0.1569.  A patch is attached.

Thanks, I'll include it (minus the typo :-).


-- 
If all you have is a hammer, everything looks like a nail.
When your hammer is C++, everything begins to look like a thumb.
-- Steve Hoflich, comp.lang.c++

 /// 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: Error: aggregate value used where an integer was expected

2018-03-05 Fir de Conversatie Bram Moolenaar

Larissa Braz wrote:

> I'm getting the following compilation error message:
> 
> misc2.c:2566:3: error: aggregate value used where an integer was expected
>return TERMCAP2KEY(modifier_keys_table[i + 1],
>^
> 
> OS: Ubuntu 14.04 - LTS
> Compiler: gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 

Strange, can't guess why this would happen.  Is TERMCAP2KEY() overruled
somewhere?  That would cause an error though.

-- 
Friends?  I have lots of friends!  In fact, I have all episodes ever made.

 /// 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.0.1571

2018-03-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.1571 (after 8.0.1571)
Problem:Can't build without GUI.
Solution:   Adjust #ifdef for gui_find_menu().
Files:  src/menu.c


*** ../vim-8.0.1570/src/menu.c  2018-03-05 21:06:19.763252514 +0100
--- src/menu.c  2018-03-05 21:31:09.609788729 +0100
***
*** 2462,2467 
--- 2462,2468 
  }
  
  #if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
+   || defined(FEAT_TERM_POPUP_MENU) \
|| defined(FEAT_BEVAL_TIP) || defined(PROTO)
  /*
   * Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy.
*** ../vim-8.0.1570/src/version.c   2018-03-05 21:06:19.763252514 +0100
--- src/version.c   2018-03-05 21:31:58.129480784 +0100
***
*** 768,769 
--- 768,771 
  {   /* Add new patch number below this line */
+ /**/
+ 1571,
  /**/

-- 
"Lisp has all the visual appeal of oatmeal with nail clippings thrown in."
 -- Larry Wall

 /// 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.0.1570

2018-03-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.1570
Problem:Can't use :popup for a menu in the terminal. (Wei Zhang)
Solution:   Make :popup work in the terminal.  Also fix that entries were
included that don't work in the current state.
Files:  src/ex_docmd.c, src/popupmnu.c, src/proto/popupmnu.pro,
src/menu.c, src/proto/menu.pro


*** ../vim-8.0.1569/src/ex_docmd.c  2018-03-04 20:14:08.244064367 +0100
--- src/ex_docmd.c  2018-03-05 20:33:27.651337765 +0100
***
*** 204,210 
  #else
  # define ex_tearoff   ex_ni
  #endif
! #if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU)
  static void   ex_popup(exarg_T *eap);
  #else
  # define ex_popup ex_ni
--- 204,211 
  #else
  # define ex_tearoff   ex_ni
  #endif
! #if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
!   || defined(FEAT_TERM_POPUP_MENU)) && defined(FEAT_MENU)
  static void   ex_popup(exarg_T *eap);
  #else
  # define ex_popup ex_ni
***
*** 8741,8751 
  }
  #endif
  
! #if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU)
  static void
  ex_popup(exarg_T *eap)
  {
! gui_make_popup(eap->arg, eap->forceit);
  }
  #endif
  
--- 8742,8762 
  }
  #endif
  
! #if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
!   || defined(FEAT_TERM_POPUP_MENU)) && defined(FEAT_MENU)
  static void
  ex_popup(exarg_T *eap)
  {
! # if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)
! if (gui.in_use)
!   gui_make_popup(eap->arg, eap->forceit);
! #  ifdef FEAT_TERM_POPUP_MENU
! else
! #  endif
! # endif
! # ifdef FEAT_TERM_POPUP_MENU
!   pum_make_popup(eap->arg, eap->forceit);
! # endif
  }
  #endif
  
*** ../vim-8.0.1569/src/popupmnu.c  2018-03-03 18:59:11.612531627 +0100
--- src/popupmnu.c  2018-03-05 21:01:01.461275616 +0100
***
*** 1132,1143 
  #ifdef FEAT_BEVAL_TERM
  int   save_bevalterm = p_bevalterm;
  #endif
  
  pum_undisplay();
  pum_size = 0;
  
  for (mp = menu->children; mp != NULL; mp = mp->next)
!   ++pum_size;
  
  array = (pumitem_T *)alloc_clear((unsigned)sizeof(pumitem_T) * pum_size);
  if (array == NULL)
--- 1132,1147 
  #ifdef FEAT_BEVAL_TERM
  int   save_bevalterm = p_bevalterm;
  #endif
+ int   mode;
  
  pum_undisplay();
  pum_size = 0;
+ mode = get_menu_mode_flag();
  
  for (mp = menu->children; mp != NULL; mp = mp->next)
!   if (menu_is_separator(mp->dname)
!   || (mp->modes & mp->enabled & mode))
!   ++pum_size;
  
  array = (pumitem_T *)alloc_clear((unsigned)sizeof(pumitem_T) * pum_size);
  if (array == NULL)
***
*** 1146,1152 
  for (mp = menu->children; mp != NULL; mp = mp->next)
if (menu_is_separator(mp->dname))
array[idx++].pum_text = (char_u *)"";
!   else
array[idx++].pum_text = mp->dname;
  
  pum_array = array;
--- 1150,1156 
  for (mp = menu->children; mp != NULL; mp = mp->next)
if (menu_is_separator(mp->dname))
array[idx++].pum_text = (char_u *)"";
!   else if (mp->modes & mp->enabled & mode)
array[idx++].pum_text = mp->dname;
  
  pum_array = array;
***
*** 1232,1237 
--- 1236,1259 
  mch_setmouse(TRUE);
  #  endif
  }
+ 
+ void
+ pum_make_popup(char_u *path_name, int use_mouse_pos)
+ {
+ vimmenu_T *menu;
+ 
+ if (!use_mouse_pos)
+ {
+   /* Hack: set mouse position at the cursor so that the menu pops up
+* around there. */
+   mouse_row = curwin->w_winrow + curwin->w_wrow;
+   mouse_col = curwin->w_wincol + curwin->w_wcol;
+ }
+ 
+ menu = gui_find_menu(path_name);
+ if (menu != NULL)
+   pum_show_popupmenu(menu);
+ }
  # endif
  
  #endif
*** ../vim-8.0.1569/src/proto/popupmnu.pro  2018-03-03 18:59:11.612531627 
+0100
--- src/proto/popupmnu.pro  2018-03-05 20:31:35.520024601 +0100
***
*** 10,13 
--- 10,14 
  void ui_post_balloon(char_u *mesg, list_T *list);
  void ui_may_remove_balloon(void);
  void pum_show_popupmenu(vimmenu_T *menu);
+ void pum_make_popup(char_u *path_name, int mouse_pos);
  /* vim: set ft=c : */
*** ../vim-8.0.1569/src/menu.c  2018-03-04 18:07:04.260592398 +0100
--- src/menu.c  2018-03-05 21:06:04.967346391 +0100
***
*** 1891,1896 
--- 1891,1906 
  return MENU_INDEX_INVALID;
  }
  
+ int
+ get_menu_mode_flag(void)
+ {
+ int mode = get_menu_mode();
+ 
+ if (mode == MENU_INDEX_INVALID)
+   return 0;
+ return 1 << mode;
+ }
+ 
  /*
   * Display the Special "PopUp" menu as a pop-up at the current mouse
   * position.  The "PopUpn" menu is for Normal mode, "PopUpi" for Insert mode,
***
*** 2044,2056 
  if (modes != 0x0)
mode = modes;
  else
! {
!   mode = get_menu_mode();
!   if (mode == MENU_INDEX_INVALID

Re: Patch 8.0.1558

2018-03-05 Fir de Conversatie Bram Moolenaar

Wei Zhang wrote:

> Thanks, great, I can use it with mouse now.
> 
> And one last wish, can I popup it in TUI via ':popup ...' command in
> vimscript ?  Or something like `:call inputlist()` but use popup menu
> to select item.

It does require a menu.  You can always create one when needed.

I'll make the :popup command work.  Not sure how useful it is, but it's
not much code.

Also need to fix that menu entries show up that don't work in the
current state.  E.g. PopUp.Cut only works in Visual mode.

-- 
LARGE MAN:   Who's that then?
CART DRIVER: (Grudgingly) I dunno, Must be a king.
LARGE MAN:   Why?
CART DRIVER: He hasn't got shit all over him.
 "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.


Re: Error using MSys2 with git

2018-03-05 Fir de Conversatie Axel Bender
I found the error: it turned out to be a setting in my .vimrc:

autocmd BufEnter * lcd %:p:h 

which I use in place of autochdir (which doesn't work for me with 
--remote-silent). So (besides I should have checked that beforehand) I will 
have to find a workaround for this.

Sorry for the noise...

-- 
-- 
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.


Error: aggregate value used where an integer was expected

2018-03-05 Fir de Conversatie Larissa Braz
Hi,

I'm getting the following compilation error message:

misc2.c:2566:3: error: aggregate value used where an integer was expected
   return TERMCAP2KEY(modifier_keys_table[i + 1],
   ^

OS: Ubuntu 14.04 - LTS
Compiler: gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 

Thank you,

-- 
-- 
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: Error using MSys2 with git

2018-03-05 Fir de Conversatie Christian Brabandt

On Mo, 05 Mär 2018, Axel Bender wrote:

> I use gvim as git's difftool, defined via .gitconfig as
> 
> gvim -d "LOCAL" "REMOTE"
> 
> From time to time new local files are created or old local files are deleted. 
> In the latter case (or when new remote files are introduced), git would call 
> gvim like so:
> 
> gvim -d "nul" ""
> 
> which (independent of the opendevice setting) results in gvim getting stuck 
> on the first file - having the special name "nul".

I cannot reproduce this. Is there a plugin interfering?

Is this git-for-windows with a Windows compiled gvim? Or does 
git-for-windows come with its own gvim?

> 
> In the opposite case, git would call gvim like so:
> 
> gvim -d "" "nul"
> 
> successfully open the existing file, and not fail on the special file (name) 
> "nul", which is a pretty inconsistent behavior...
> 
> As the LOCAL and REMOTE variables cannot be arbitrarily swapped, I had hoped 
> to use e.g. an autocmd with BufReadCmd to filter any special file names, 
> replacing them as needed, but it seems, that already at this point the list 
> of file names can no longer be changed.
> 
> Is there hope?

It should be possible to use a BufReadCmd autocommand to workaround the 
issue. However, I cannot reproduce it.


Best,
Christian
-- 
Beim Liebesspiel ist es wie beim Autofahren. Die Frauen mögen die
Umleitung, die Männer die Abkürzung.
-- Jeanne Moreau

-- 
-- 
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.


Cmdline autocommand event summaries missing from autocmd-events list

2018-03-05 Fir de Conversatie Gary Johnson
The new cmdline autocommands are described in the alphabetical list
of autocommand events (:help autocmd-events-abc), but their
summaries are missing from the overview list (help
autocommand-events) in Vim 8.0.1569.  A patch is attached.

Regards,
Gary

-- 
-- 
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.
diff -r 6ef2dba73dab runtime/doc/autocmd.txt
--- a/runtime/doc/autocmd.txt	Mon Mar 05 12:45:06 2018 +0100
+++ b/runtime/doc/autocmd.txt	Mon Mar 05 09:59:34 2018 -0800
@@ -324,6 +324,10 @@
 |CmdwinEnter|		after entering the command-line window
 |CmdwinLeave|		before leaving the command-line window
 
+|CmdlineChanged|	after a change was made to the command-line text
+|CmdlineEnter|		after the cursor movess to the command line
+|CmdlineLeave|		before the cursor leaves the command line
+
 |InsertEnter|		starting Insert mode
 |InsertChange|		when typing  while in Insert or Replace mode
 |InsertLeave|		when leaving Insert mode


Error using MSys2 with git

2018-03-05 Fir de Conversatie Axel Bender
I use gvim as git's difftool, defined via .gitconfig as

gvim -d "LOCAL" "REMOTE"

>From time to time new local files are created or old local files are deleted. 
>In the latter case (or when new remote files are introduced), git would call 
>gvim like so:

gvim -d "nul" ""

which (independent of the opendevice setting) results in gvim getting stuck on 
the first file - having the special name "nul".

In the opposite case, git would call gvim like so:

gvim -d "" "nul"

successfully open the existing file, and not fail on the special file (name) 
"nul", which is a pretty inconsistent behavior...

As the LOCAL and REMOTE variables cannot be arbitrarily swapped, I had hoped to 
use e.g. an autocmd with BufReadCmd to filter any special file names, replacing 
them as needed, but it seems, that already at this point the list of file names 
can no longer be changed.

Is there hope?

-- 
-- 
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] when `:echo getwinpos(1)` displays dust and next key is eaten

2018-03-05 Fir de Conversatie h_east
Hi Bram and List,

patch for Vim 8.0.1563 or later. 
Patch is here.
https://gist.github.com/h-east/9eeebb2fc0f669c4f3cfb4c61e96e51a

--
Best regards,
Hirohito Higashi (h_east)

-- 
-- 
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.0.1569

2018-03-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.1569
Problem:Warning for uninitialized variable from gcc.
Solution:   Initialize the variable.
Files:  src/quickfix.c


*** ../vim-8.0.1568/src/quickfix.c  2018-03-04 18:07:04.276592296 +0100
--- src/quickfix.c  2018-03-05 12:41:09.402675093 +0100
***
*** 4099,4105 
  win_T *wp = NULL;
  qf_info_T *qi = &ql_info;
  char_u*au_name = NULL;
! int   save_qfid;
  int   res;
  
  switch (eap->cmdidx)
--- 4099,4105 
  win_T *wp = NULL;
  qf_info_T *qi = &ql_info;
  char_u*au_name = NULL;
! int   save_qfid = 0;  // init for gcc
  int   res;
  
  switch (eap->cmdidx)
*** ../vim-8.0.1568/src/version.c   2018-03-05 10:54:49.416071960 +0100
--- src/version.c   2018-03-05 12:41:53.838414951 +0100
***
*** 768,769 
--- 768,771 
  {   /* Add new patch number below this line */
+ /**/
+ 1569,
  /**/

-- 
Why I like vim:
> I like VIM because, when I ask a question in this newsgroup, I get a
> one-line answer.  With xemacs, I get a 1Kb lisp script with bugs in it ;-)

 /// 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.0.1568

2018-03-05 Fir de Conversatie Kazunobu Kuriyama
2018-03-05 18:55 GMT+09:00 Bram Moolenaar :

>
> Patch 8.0.1568
> Problem:Can't build on older Mac, header file is missing.
> Solution:   Remove the header file. (Ozaki Kiichi, closes #2691)
> Files:  src/os_unix.c
>
>
> *** ../vim-8.0.1567/src/os_unix.c   2018-03-04 18:07:04.276592296 +0100
> --- src/os_unix.c   2018-03-05 10:51:57.229083087 +0100
> ***
> *** 566,572 
>   # ifdef MACOS_X_DARWIN
>

This should be MACOS_X since, as suggested by a comment in vim.h,
MACOS_X_DARWIN is meant for integrating the stuff of os_mac_conv.c and
os_macosx.m into Vim.  Obviously, that doesn't apply to this.. Sorry about
not giving a comment while the patch remained as PR, but there was little
chance for me to do that as the PR was closed affirmatively so quickly. :)

  #  include 
>   #  include 
> - #  include 
>   # endif
>
>   /*
> --- 566,571 
> *** ../vim-8.0.1567/src/version.c   2018-03-04 21:35:54.952059810 +0100
> --- src/version.c   2018-03-05 10:52:57.972726403 +0100
> ***
> *** 768,769 
> --- 768,771 
>   {   /* Add new patch number below this line */
> + /**/
> + 1568,
>   /**/
>
> --
> BODY:I'm not dead!
> CART DRIVER: 'Ere.  He says he's not dead.
> LARGE MAN:   Yes he is.
> BODY:I'm not!
>  "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.
>

-- 
-- 
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.0.1558

2018-03-05 Fir de Conversatie Wei Zhang
Thanks, great, I can use it with mouse now.

And one last wish, can I popup it in TUI via ':popup ...' command in vimscript ?
Or something like `:call inputlist()` but use popup menu to select item.

在 2018年3月5日星期一 UTC+8下午5:56:07,Bram Moolenaar写道:
> Wei Zhang wrote:
> 
> > Seems cool, but how to use this right-click popup menu ?
> > 
> > have tried: 
> > 
> > 1. click right mouse botton on text: it switched to visual mode
> > 2. shift+left/right botton: no use
> > 3. execute ":popup PopUp" : Sorry, the command is not available in this 
> > version
> > 
> > It doesn't have any documentation yet.
> 
> The popup menu has existed in the GUI for a very long time.
> To use it in a terminal:
>   :set mousemodel=popup
> or
>   :set mousemodel=popup_setpos
> 
> For MS-Windows the default already is "popup" and I checked it works in
> a console.  Unfortunately it doesn't have mouse move events.  Not sure
> if that is a problem of the console or of Vim...  Ah, we drop move
> events in decode_mouse_event().  Should keep them when p_bevalterm is
> set.
> 
> -- 
> I used to wonder about the meaning of life.  But I looked it
> up in the dictionary under "L" and there it was - the meaning
> of life.  It was less than I expected.  - Dogbert
> 
>  /// 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.0.1558

2018-03-05 Fir de Conversatie Bram Moolenaar

Wei Zhang wrote:

> Seems cool, but how to use this right-click popup menu ?
> 
> have tried: 
> 
> 1. click right mouse botton on text: it switched to visual mode
> 2. shift+left/right botton: no use
> 3. execute ":popup PopUp" : Sorry, the command is not available in this 
> version
> 
> It doesn't have any documentation yet.

The popup menu has existed in the GUI for a very long time.
To use it in a terminal:
:set mousemodel=popup
or
:set mousemodel=popup_setpos

For MS-Windows the default already is "popup" and I checked it works in
a console.  Unfortunately it doesn't have mouse move events.  Not sure
if that is a problem of the console or of Vim...  Ah, we drop move
events in decode_mouse_event().  Should keep them when p_bevalterm is
set.

-- 
I used to wonder about the meaning of life.  But I looked it
up in the dictionary under "L" and there it was - the meaning
of life.  It was less than I expected.  - Dogbert

 /// 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.0.1568

2018-03-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.1568
Problem:Can't build on older Mac, header file is missing.
Solution:   Remove the header file. (Ozaki Kiichi, closes #2691)
Files:  src/os_unix.c


*** ../vim-8.0.1567/src/os_unix.c   2018-03-04 18:07:04.276592296 +0100
--- src/os_unix.c   2018-03-05 10:51:57.229083087 +0100
***
*** 566,572 
  # ifdef MACOS_X_DARWIN
  #  include 
  #  include 
- #  include 
  # endif
  
  /*
--- 566,571 
*** ../vim-8.0.1567/src/version.c   2018-03-04 21:35:54.952059810 +0100
--- src/version.c   2018-03-05 10:52:57.972726403 +0100
***
*** 768,769 
--- 768,771 
  {   /* Add new patch number below this line */
+ /**/
+ 1568,
  /**/

-- 
BODY:I'm not dead!
CART DRIVER: 'Ere.  He says he's not dead.
LARGE MAN:   Yes he is.
BODY:I'm not!
 "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.