Re: [vim/vim] Defaulting mouse=a in a terminal is incorrect (new as of 7.4.2111) (#2841)

2022-12-10 Fir de Conversatie Yegappan Lakshmanan
On Sun, Dec 11, 2022 at 5:28 AM Alex von Gluck IV 
wrote:

> I wonder if it is related to how your system clipboard is configured in
> your session.
>
> Default configuration.
>
> Also, is your vim running on the same system, or you ssh or tmux or
> somewhere in there?
>
> Same system, or other system via ssh. Same behaviour
>
>1. Done
>2. Done
>3. Done
>4.a Highlight clipboard. Highlight text. p to paste in vim. E353:
>Nothing in register ''
>4.b I copy text in Opera (by actually clicking copy). Highlight and do
>a full copy.. press p in vim E353: Nothing in register ''
>4. I never do this. Just yy, y1l, y1w, etc.
>5. etc
>
> As I mentioned, using the selection clipboard. You don't have to copy and
> paste in Linux, just highlighting text puts it into your "selection
> clipboard" which you paste via clicking the middle mouse wheel.
>

When selecting the text using the mouse, can you try pressing the Shift key?

- Yegappan

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAAW7x7%3Dkkjrjp94KL%3DKMf5O9Xm7M6WESKinTY5PCFTvsmPshkA%40mail.gmail.com.


Patch 9.0.1046

2022-12-10 Fir de Conversatie Bram Moolenaar


Patch 9.0.1046
Problem:Class method disassemble test fails on MS-Windows.
Solution:   Do not match with a specific size.
Files:  src/testdir/test_vim9_class.vim


*** ../vim-9.0.1045/src/testdir/test_vim9_class.vim 2022-12-10 
18:42:09.094378801 +
--- src/testdir/test_vim9_class.vim 2022-12-10 19:02:06.152433041 +
***
*** 166,172 
  
var instr = execute('disassemble TextPosition.new')
assert_match('new\_s*' ..
! '0 NEW TextPosition size 72\_s*' ..
  '\d PUSHNR 1\_s*' ..
  '\d STORE_THIS 0\_s*' ..
  '\d PUSHNR 1\_s*' ..
--- 166,172 
  
var instr = execute('disassemble TextPosition.new')
assert_match('new\_s*' ..
! '0 NEW TextPosition size \d\+\_s*' ..
  '\d PUSHNR 1\_s*' ..
  '\d STORE_THIS 0\_s*' ..
  '\d PUSHNR 1\_s*' ..
*** ../vim-9.0.1045/src/version.c   2022-12-10 18:42:09.098378785 +
--- src/version.c   2022-12-10 19:03:19.760399859 +
***
*** 697,698 
--- 697,700 
  {   /* Add new patch number below this line */
+ /**/
+ 1046,
  /**/

-- 
The software said it requires Windows 95 or better, so I installed Linux.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221210190437.85B431C1752%40moolenaar.net.


Patch 9.0.1045

2022-12-10 Fir de Conversatie Bram Moolenaar


Patch 9.0.1045
Problem:In a class object members cannot be initialized.
Solution:   Support initializing object members. Make "dissassemble" work on
an object method.
Files:  src/vim9class.c, src/proto/vim9class.pro, src/vim9compile.c,
src/vim9execute.c, src/vim9expr.c, src/vim9instr.c,
src/proto/vim9instr.pro, src/structs.h, src/userfunc.c,
src/eval.c, src/vim9.h, src/testdir/test_vim9_class.vim


*** ../vim-9.0.1044/src/vim9class.c 2022-12-09 22:49:19.447580421 +
--- src/vim9class.c 2022-12-10 18:09:29.470008096 +
***
*** 147,158 
--- 147,176 
if (type == NULL)
break;
  
+   char_u *expr_start = skipwhite(type_arg);
+   if (*expr_start == '=' && (!VIM_ISWHITE(expr_start[-1])
+  || !VIM_ISWHITE(expr_start[1])))
+   {
+   semsg(_(e_white_space_required_before_and_after_str_at_str),
+   "=", type_arg);
+   break;
+   }
+   expr_start = skipwhite(expr_start + 1);
+ 
+   char_u *expr_end = expr_start;
+   evalarg_T   evalarg;
+   init_evalarg();
+   skip_expr(_end, );
+   clear_evalarg(, NULL);
+ 
if (ga_grow(, 1) == FAIL)
break;
objmember_T *m = ((objmember_T *)objmembers.ga_data)
  + objmembers.ga_len;
m->om_name = vim_strnsave(varname, varname_end - varname);
m->om_type = type;
+   if (expr_end > expr_start)
+   m->om_init = vim_strnsave(expr_start, expr_end - expr_start);
++objmembers.ga_len;
}
  
***
*** 190,195 
--- 208,216 
// TODO: how about errors?
if (uf != NULL && ga_grow(, 1) == OK)
{
+   if (STRNCMP(uf->uf_name, "new", 3) == 0)
+   uf->uf_flags |= FC_NEW;
+ 
((ufunc_T **)objmethods.ga_data)[objmethods.ga_len] = uf;
++objmethods.ga_len;
}
***
*** 333,338 
--- 354,360 
  {
objmember_T *m = ((objmember_T *)objmembers.ga_data) + i;
vim_free(m->om_name);
+   vim_free(m->om_init);
  }
  ga_clear();
  
***
*** 520,525 
--- 542,593 
  }
  
  /*
+  * If "arg" points to a class or object method, return it.
+  * Otherwise return NULL.
+  */
+ ufunc_T *
+ find_class_func(char_u **arg)
+ {
+ char_u *name = *arg;
+ char_u *name_end = find_name_end(name, NULL, NULL, FNE_CHECK_START);
+ if (name_end == name || *name_end != '.')
+   return NULL;
+ 
+ size_t len = name_end - name;
+ typval_T tv;
+ tv.v_type = VAR_UNKNOWN;
+ if (eval_variable(name, len, 0, , NULL, EVAL_VAR_NOAUTOLOAD) == FAIL)
+   return NULL;
+ if (tv.v_type != VAR_CLASS && tv.v_type != VAR_OBJECT)
+ {
+   clear_tv();
+   return NULL;
+ }
+ 
+ class_T *cl = tv.v_type == VAR_CLASS ? tv.vval.v_class
+: tv.vval.v_object->obj_class;
+ if (cl == NULL)
+   return NULL;
+ char_u *fname = name_end + 1;
+ char_u *fname_end = find_name_end(fname, NULL, NULL, FNE_CHECK_START);
+ if (fname_end == fname)
+   return NULL;
+ len = fname_end - fname;
+ 
+ for (int i = 0; i < cl->class_obj_method_count; ++i)
+ {
+   ufunc_T *fp = cl->class_obj_methods[i];
+   // Use a separate pointer to avoid that ASAN complains about
+   // uf_name[] only being 4 characters.
+   char_u *ufname = (char_u *)fp->uf_name;
+   if (STRNCMP(fname, ufname, len) == 0 && ufname[len] == NUL)
+   return fp;
+ }
+ 
+ return NULL;
+ }
+ 
+ /*
   * Make a copy of an object.
   */
  void
***
*** 585,590 
--- 653,659 
{
objmember_T *m = >class_obj_members[i];
vim_free(m->om_name);
+   vim_free(m->om_init);
}
vim_free(cl->class_obj_members);
  
*** ../vim-9.0.1044/src/proto/vim9class.pro 2022-12-08 20:41:55.433288306 
+
--- src/proto/vim9class.pro 2022-12-10 17:38:19.147340414 +
***
*** 5,10 
--- 5,11 
  void ex_enum(exarg_T *eap);
  void ex_type(exarg_T *eap);
  int class_object_index(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int 
verbose);
+ ufunc_T *find_class_func(char_u **arg);
  void copy_object(typval_T *from, typval_T *to);
  void object_unref(object_T *obj);
  void copy_class(typval_T *from, typval_T *to);
*** ../vim-9.0.1044/src/vim9compile.c   2022-12-09 21:41:43.908327271 +
--- src/vim9compile.c   2022-12-10 16:24:08.356778584 +
***
*** 2118,2123 
--- 2118,2188 
  }
  
  /*
+  * Generate an instruction to push the default value for "vartype".
+  * if "dest_local" is TRUE then 

Re: Profile Cursor move (very slow)

2022-12-10 Fir de Conversatie Enan Ajmain
On Sat, 10 Dec 2022 10:16:19 +0100
N i c o l a s I I T h e B l o o d y  wrote:
> I mean when i open 'tagbar.vim' in vim, about 4500 lines code.
> 
> I feel that the pb comes from the call of executable 'ctags': when you move
> Cursor vertically from top to down, it pass through several functions, and
> tagbar wants to show current function Cursor is in. So it calls many times
> 'ctags executable' and this is causes delay on my win11 Os.

That'll do it.  Executing binaries in Windows is costly.  I don't know
how tagbar works, but if it depends on the output of a system call
without saving the results for using later, it'll be slow in both
versions of VimScript _and_ Lua.  I had to deal with a similar situation
for a simple VimL function that made calls to 'git' three-four times.  I
solved it by relying on the fugitive plugin.  It saves the pertinent
values in buffer-local variables, so my VimL function didn't need to
call the 'git' binary.

To hammer home my point: if fugitive didn't save the frequently-used git
values, vim users couldn't use fugitive in Windows because of how slow
it would be to execute any fugitive command.

Windows is a pain.

> I am currently trying to port tagbar legacy to vim9script. But if i am
> right, the pb will still be there.

Most probably.

> I have noticed your advise Enan.
> Thank
> Nicolas

The name you assigned to your email address still has inter-letter
spaces.  See how the attribution text (see at the very beginning of this
email) spells your name with your email address?  That name comes from
the From: header of your email, which is set by either your email client
or, if you are using Google's web interface, your Google username.


P.S. You forgot to CC vim-dev list.  I'm appending your original email
with this email for posterity; see below after the marker for forwarded
message.


-- 
Enan
3nan.ajm...@gmail.com
https://git.sr.ht/~enan/
https://www.github.com/3N4N



= Begin forwarded message =

Date: Sat, 10 Dec 2022 10:16:19 +0100
From: N i c o l a s I I T h e B l o o d y 
To: Enan Ajmain <3nan.ajm...@gmail.com>
Subject: Re: Profile Cursor move (very slow)


I mean when i open 'tagbar.vim' in vim, about 4500 lines code.

I feel that the pb comes from the call of executable 'ctags': when you
move Cursor vertically from top to down, it pass through several
functions, and tagbar wants to show current function Cursor is in. So
it calls many times 'ctags executable' and this is causes delay on my
win11 Os.

I am currently trying to port tagbar legacy to vim9script. But if i am
right, the pb will still be there.

I have noticed your advise Enan.
Thank
Nicolas

Le sam. 10 déc. 2022 à 06:07, Enan Ajmain <3nan.ajm...@gmail.com> a
écrit :

> On Fri, 9 Dec 2022 12:12:07 -0800 (PST)
> N i c o l a s I I T h e B l o o d y  wrote:  
> > Thank you Enan, I saw thé profile help but don't happen to find  
> particular  
> > sample for Cursor move.  
>
> That's because there is none.  Profiling, as defined in ':h profiling'
> only measures the runtime of either a script or a function, not a cursor
> move.
>
> I think you're looking for profiling because you want to see which
> function call or which command is consuming time when you move the
> cursor.  If that's correct, you could check what your arrow keys are
> mapped to.  Remember to invoke these commands from the exact buffer
> where arrows keys are slow.
>
> :map 
> :map 
> :map 
> :map 
>
> If the arrows are not mapped to any function call or user command, then
> the problem is somewhere else; see below.
>
> On Fri, 9 Dec 2022 08:36:18 -0800 (PST)
> You wrote:  
> > Vertical moving cursor with arrow keys on such a file
> > like https://github.com/preservim/tagbar/blob/master/autoload/tagbar.vim  
> is  
> > very very slow.  
>
> What did you mean by "such a file"?  Do you mean when you open
> 'tagbar.vim' in vim?  or do you mean when you are in the buffer created
> by the tagbar plugin?  If the latter, then that's a problem with the
> plugin and you should open a ticket in its issue tracker.
>
> P.S. The spaces between each letter in your name makes it hard to read.
> I would change it to a normal spelling.
>
> --
> Enan
> 3nan.ajm...@gmail.com
> https://git.sr.ht/~enan/
> https://www.github.com/3N4N
>  

= End forwarded message =

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221210161056.0876%40gmail.com.


Patch 9.0.1044

2022-12-10 Fir de Conversatie Bram Moolenaar


Patch 9.0.1044
Problem:Setting window height using Python may cause errors.
Solution:   When setting "curwin" also set "curbuf". (closes #11687)
Files:  src/if_py_both.h, src/testdir/test_python3.vim


*** ../vim-9.0.1043/src/if_py_both.h2022-12-08 15:32:11.083034191 +
--- src/if_py_both.h2022-12-10 11:15:57.834222926 +
***
*** 4081,4090 
--- 4081,4092 
  #endif
savewin = curwin;
curwin = self->win;
+   curbuf = curwin->w_buffer;
  
VimTryStart();
win_setheight((int) height);
curwin = savewin;
+   curbuf = curwin->w_buffer;
if (VimTryEnd())
return -1;
  
***
*** 4103,4112 
--- 4105,4116 
  #endif
savewin = curwin;
curwin = self->win;
+   curbuf = curwin->w_buffer;
  
VimTryStart();
win_setwidth((int) width);
curwin = savewin;
+   curbuf = curwin->w_buffer;
if (VimTryEnd())
return -1;
  
*** ../vim-9.0.1043/src/testdir/test_python3.vim2022-09-30 
21:57:07.547153409 +0100
--- src/testdir/test_python3.vim2022-12-10 11:14:56.746215664 +
***
*** 540,545 
--- 540,563 
%bw!
  endfunc
  
+ " This was causing trouble because "curbuf" was not matching curwin->w_buffer
+ func Test_python3_window_set_height()
+   enew!
+   call setline(1, ['aaa', 'bbb', 'ccc'])
+   call cursor(2, 1)
+   set foldmethod=expr
+   new
+   wincmd w
+   python3 vim.windows[0].height = 5
+   call assert_equal(5, winheight(1))
+ 
+   call feedkeys('j', 'xt')
+   call assert_equal(3, getpos('.')[1])
+ 
+   bwipe!
+   bwipe!
+ endfunc
+ 
  " Test for the python List object
  func Test_python3_list()
" Try to convert a null List
*** ../vim-9.0.1043/src/version.c   2022-12-10 10:22:25.873096527 +
--- src/version.c   2022-12-10 11:16:23.530225875 +
***
*** 697,698 
--- 697,700 
  {   /* Add new patch number below this line */
+ /**/
+ 1044,
  /**/

-- 
   Bravely bold Sir Robin, rode forth from Camelot,
   He was not afraid to die, Oh Brave Sir Robin,
   He was not at all afraid to be killed in nasty ways
   Brave, brave, brave, brave Sir Robin.
 "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/ ///
 \\\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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221210111810.6B7411C1742%40moolenaar.net.


Patch 9.0.1043

2022-12-10 Fir de Conversatie Bram Moolenaar


Patch 9.0.1043
Problem:Macro has confusing name and is duplicated.
Solution:   Use one macro with an understandable name. (closes #11686)
Files:  src/cmdexpand.c


*** ../vim-9.0.1042/src/cmdexpand.c 2022-12-08 12:00:32.414054432 +
--- src/cmdexpand.c 2022-12-10 10:20:27.353051881 +
***
*** 35,41 
  static int compl_startcol;
  static int compl_selected;
  
! #define SHOW_FILE_TEXT(m) (showtail ? showmatches_gettail(matches[m]) : 
matches[m])
  
  /*
   * Returns TRUE if fuzzy completion is supported for a given cmdline 
completion
--- 35,41 
  static int compl_startcol;
  static int compl_selected;
  
! #define SHOW_MATCH(m) (showtail ? showmatches_gettail(matches[m]) : 
matches[m])
  
  /*
   * Returns TRUE if fuzzy completion is supported for a given cmdline 
completion
***
*** 339,345 
  compl_match_array = ALLOC_MULT(pumitem_T, compl_match_arraysize);
  for (i = 0; i < numMatches; i++)
  {
!   compl_match_array[i].pum_text = SHOW_FILE_TEXT(i);
compl_match_array[i].pum_info = NULL;
compl_match_array[i].pum_extra = NULL;
compl_match_array[i].pum_kind = NULL;
--- 339,345 
  compl_match_array = ALLOC_MULT(pumitem_T, compl_match_arraysize);
  for (i = 0; i < numMatches; i++)
  {
!   compl_match_array[i].pum_text = SHOW_MATCH(i);
compl_match_array[i].pum_info = NULL;
compl_match_array[i].pum_extra = NULL;
compl_match_array[i].pum_kind = NULL;
***
*** 489,495 
  int   match,
  int   showtail)
  {
- #define L_MATCH(m) (showtail ? showmatches_gettail(matches[m]) : matches[m])
  int   row;
  char_u*buf;
  int   len;
--- 489,494 
***
*** 525,531 
highlight = FALSE;
  }
  // count 1 for the ending ">"
! clen = status_match_len(xp, L_MATCH(match)) + 3;
  if (match == 0)
first_match = 0;
  else if (match < first_match)
--- 524,530 
highlight = FALSE;
  }
  // count 1 for the ending ">"
! clen = status_match_len(xp, SHOW_MATCH(match)) + 3;
  if (match == 0)
first_match = 0;
  else if (match < first_match)
***
*** 538,544 
  {
// check if match fits on the screen
for (i = first_match; i < match; ++i)
!   clen += status_match_len(xp, L_MATCH(i)) + 2;
if (first_match > 0)
clen += 2;
// jumping right, put match at the left
--- 537,543 
  {
// check if match fits on the screen
for (i = first_match; i < match; ++i)
!   clen += status_match_len(xp, SHOW_MATCH(i)) + 2;
if (first_match > 0)
clen += 2;
// jumping right, put match at the left
***
*** 549,555 
clen = 2;
for (i = match; i < num_matches; ++i)
{
!   clen += status_match_len(xp, L_MATCH(i)) + 2;
if ((long)clen >= Columns)
break;
}
--- 548,554 
clen = 2;
for (i = match; i < num_matches; ++i)
{
!   clen += status_match_len(xp, SHOW_MATCH(i)) + 2;
if ((long)clen >= Columns)
break;
}
***
*** 560,566 
  if (add_left)
while (first_match > 0)
{
!   clen += status_match_len(xp, L_MATCH(first_match - 1)) + 2;
if ((long)clen >= Columns)
break;
--first_match;
--- 559,565 
  if (add_left)
while (first_match > 0)
{
!   clen += status_match_len(xp, SHOW_MATCH(first_match - 1)) + 2;
if ((long)clen >= Columns)
break;
--first_match;
***
*** 581,587 
  clen = len;
  
  i = first_match;
! while ((long)(clen + status_match_len(xp, L_MATCH(i)) + 2) < Columns)
  {
if (i == match)
{
--- 580,586 
  clen = len;
  
  i = first_match;
! while ((long)(clen + status_match_len(xp, SHOW_MATCH(i)) + 2) < Columns)
  {
if (i == match)
{
***
*** 589,595 
selstart_col = clen;
}
  
!   s = L_MATCH(i);
// Check for menu separators - replace with '|'
  #ifdef FEAT_MENU
emenu = (xp->xp_context == EXPAND_MENUS
--- 588,594 
selstart_col = clen;
}
  
!   s = SHOW_MATCH(i);
// Check for menu separators - replace with '|'
  #ifdef FEAT_MENU
emenu = (xp->xp_context == EXPAND_MENUS
***
*** 1129,1135 
// Expansion was done here, file names are literal.
isdir = mch_isdir(matches[j]);
if (showtail)
!   p = SHOW_FILE_TEXT(j);
else
{
home_replace(NULL, matches[j], NameBuff, MAXPATHL,
--- 1128,1134 
 

Re: Test Failure

2022-12-10 Fir de Conversatie Bram Moolenaar


> * Bram Moolenaar  [2022-11-20 15:20 +]:
> 
> > > Environment: Linux
> > > Terminal: tmux
> > > Compiler: clang-15
> > > Version: 9.0.0915
> > > 
> > > There is a test failure:
> > > Found errors in Test_autocmd_user_clear_group():
> > > Run 1, 15:38:56 - 15:39:01:
> > > command line..script 
> > > /source/vim/vim-9.0.0915/src/vim-motif/testdir=
> > > /runtest.vim[515]..function 
> > > RunTheTest[52]..Test_autocmd_user_clear_group[1=
> > > 8]..StopVimInTerminal[14]..WaitForAssert[2]..5_WaitForCommon[11].. > > bda>47 line 1: Expected 'finished' but got 'running'
> > 
> > It does not fail for me in a similar setup, and CI also doesn't show
> > this failure.  Can you think of anything that matters?  I can't really
> > fix a test failure if I can't reproduce it.
> > 
> > You could try increasing the "50" argument of TermWait() in line 2239
> > and see if that makes a difference.
> 
> In which file?

In the test that fails, which is in src/testdir/test_autocmd.vim.
The line number is now 2394.

-- 
Ten bugs in the hand is better than one as yet undetected.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221210102356.B169B1C1742%40moolenaar.net.


Re: vim9script : how to port mechanism of 'functions'dictionary ~ classes

2022-12-10 Fir de Conversatie N i c o l a s I I T h e B l o o d y
Sorry I missed this in the vim9 help :)


















**vim9-no-dict-function*Later classes will be added, which replaces the 
"dict function" mechanism.For now you will need to pass the dictionary 
explicitly: >def DictFunc(self: dict, arg: string)   echo 
self[arg]enddefvar ad = {item: 'value', func: DictFunc}
ad.func(ad, 'item')You can call a legacy dict function though: >func 
Legacy() dict  echo self.valueendfuncdef CallLegacy()  var 
d = {func: Legacy, value: 'text'}  d.func()enddef*
Le samedi 10 décembre 2022 à 10:37:53 UTC+1, N i c o l a s I I T h e B l o 
o d y a écrit :

> Hello Bram,
>
> Hope your health is back to its best.
>
> Question: Until the classes are implemented in vim9script, how to replace 
> the mechanism of 'functions'dictionary ' historically used in legacy 
> vimscript in vim9script?
>
> Here is an example of a state machine used in tagbar 
> https://github.com/preservim/tagbar/blob/master/autoload/tagbar/state.vim
>
> Thanks
> Nicholas
>

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/5ca0ee0a-9ae7-4199-a470-116238cd26f4n%40googlegroups.com.


vim9script : how to port mechanism of 'functions'dictionary ~ classes

2022-12-10 Fir de Conversatie N i c o l a s I I T h e B l o o d y
Hello Bram,

Hope your health is back to its best.

Question: Until the classes are implemented in vim9script, how to replace 
the mechanism of 'functions'dictionary ' historically used in legacy 
vimscript in vim9script?

Here is an example of a state machine used in tagbar 
https://github.com/preservim/tagbar/blob/master/autoload/tagbar/state.vim

Thanks
Nicholas

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/5198d170-dc76-4cd4-b13b-4e3a1b556431n%40googlegroups.com.


Re: Test Failure

2022-12-10 Fir de Conversatie Elimar Riesebieter
* Bram Moolenaar  [2022-11-20 15:20 +]:

> 
> > Environment: Linux
> > Terminal: tmux
> > Compiler: clang-15
> > Version: 9.0.0915
> > 
> > There is a test failure:
> > Found errors in Test_autocmd_user_clear_group():
> > Run 1, 15:38:56 - 15:39:01:
> > command line..script /source/vim/vim-9.0.0915/src/vim-motif/testdir=
> > /runtest.vim[515]..function RunTheTest[52]..Test_autocmd_user_clear_group[1=
> > 8]..StopVimInTerminal[14]..WaitForAssert[2]..5_WaitForCommon[11].. > bda>47 line 1: Expected 'finished' but got 'running'
> 
> It does not fail for me in a similar setup, and CI also doesn't show
> this failure.  Can you think of anything that matters?  I can't really
> fix a test failure if I can't reproduce it.
> 
> You could try increasing the "50" argument of TermWait() in line 2239
> and see if that makes a difference.

In which file?

Thanks
Elimar
-- 
  Learned men are the cisterns of knowledge,
  not the fountainheads ;-)

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221210080051.iw4oz6nyu7hg2bsi%40baumbart.home.lxtec.de.