Patch 8.1.0055

2018-06-13 Fir de Conversatie Bram Moolenaar


Patch 8.1.0055 (after 8.1.0053)
Problem:Complete test has wrong order of arguments. Wrong type for
sentinel variable.
Solution:   Swap arguments, use VAR_UNKNOWN. (Ozaki Kiichi)
Files:  src/mbyte.c, src/testdir/test_ins_complete.vim


*** ../vim-8.1.0054/src/mbyte.c 2018-06-12 22:05:10.656251565 +0200
--- src/mbyte.c 2018-06-13 21:22:38.711055156 +0200
***
*** 4799,4805 
  
  argv[0].v_type = VAR_NUMBER;
  argv[0].vval.v_number = active ? 1 : 0;
! argv[1].v_type = VAR_NUMBER;
  (void)call_func_retnr(p_imaf, 1, argv, FALSE);
  }
  
--- 4799,4805 
  
  argv[0].v_type = VAR_NUMBER;
  argv[0].vval.v_number = active ? 1 : 0;
! argv[1].v_type = VAR_UNKNOWN;
  (void)call_func_retnr(p_imaf, 1, argv, FALSE);
  }
  
*** ../vim-8.1.0054/src/testdir/test_ins_complete.vim   2018-06-12 
22:05:10.656251565 +0200
--- src/testdir/test_ins_complete.vim   2018-06-13 21:22:38.711055156 +0200
***
*** 126,140 
  
set completefunc=CompleteFunc
call feedkeys("i\\\", 'x')
!   call assert_equal(s:args[0], [1, 1])
!   call assert_equal(s:args[1][0], 0)
set completefunc=
  
let s:args = []
set omnifunc=CompleteFunc
call feedkeys("i\\\", 'x')
!   call assert_equal(s:args[0], [1, 1])
!   call assert_equal(s:args[1][0], 0)
set omnifunc=
  
bwipe!
--- 126,140 
  
set completefunc=CompleteFunc
call feedkeys("i\\\", 'x')
!   call assert_equal([1, 1], s:args[0])
!   call assert_equal(0, s:args[1][0])
set completefunc=
  
let s:args = []
set omnifunc=CompleteFunc
call feedkeys("i\\\", 'x')
!   call assert_equal([1, 1], s:args[0])
!   call assert_equal(0, s:args[1][0])
set omnifunc=
  
bwipe!
*** ../vim-8.1.0054/src/version.c   2018-06-13 20:49:47.444338292 +0200
--- src/version.c   2018-06-13 21:25:28.718171776 +0200
***
*** 763,764 
--- 763,766 
  {   /* Add new patch number below this line */
+ /**/
+ 55,
  /**/

-- 
Everybody lies, but it doesn't matter since nobody listens.
-- Lieberman's Law

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

2018-06-13 Fir de Conversatie Bram Moolenaar


Patch 8.1.0054
Problem:Compiler warning for using %ld for "long long".
Solution:   Add a type cast. (closes #3002)
Files:  src/os_unix.c


*** ../vim-8.1.0053/src/os_unix.c   2018-06-12 20:25:47.887923393 +0200
--- src/os_unix.c   2018-06-13 20:49:32.360424689 +0200
***
*** 4199,4205 
  #  ifdef FEAT_TERMINAL
  if (is_terminal)
  {
!   sprintf((char *)envbuf, "%ld",  get_vim_var_nr(VV_VERSION));
setenv("VIM_TERMINAL", (char *)envbuf, 1);
  }
  #  endif
--- 4199,4205 
  #  ifdef FEAT_TERMINAL
  if (is_terminal)
  {
!   sprintf((char *)envbuf, "%ld",  (long)get_vim_var_nr(VV_VERSION));
setenv("VIM_TERMINAL", (char *)envbuf, 1);
  }
  #  endif
***
*** 4227,4233 
  if (is_terminal)
  {
vim_snprintf(envbuf_Version, sizeof(envbuf_Version),
!  "VIM_TERMINAL=%ld", get_vim_var_nr(VV_VERSION));
putenv(envbuf_Version);
  }
  #  endif
--- 4227,4233 
  if (is_terminal)
  {
vim_snprintf(envbuf_Version, sizeof(envbuf_Version),
!"VIM_TERMINAL=%ld", (long)get_vim_var_nr(VV_VERSION));
putenv(envbuf_Version);
  }
  #  endif
*** ../vim-8.1.0053/src/version.c   2018-06-12 22:05:10.656251565 +0200
--- src/version.c   2018-06-13 20:48:19.840840420 +0200
***
*** 763,764 
--- 763,766 
  {   /* Add new patch number below this line */
+ /**/
+ 54,
  /**/

-- 
A fine is a tax for doing wrong.  A tax is a fine for doing well.

 /// 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: Bug Report: fnamemodify() fails on Windows

2018-06-13 Fir de Conversatie Bram Moolenaar


Jason Franklin wrote:

> I wanted to fix this myself, but I'm not having any fun fighting with the
> Microsoft build tools.  Hopefully, someone else has time to look into this
> issue.
> 
> System:   Windows 10
> Vim Version:  8.1.0001
> 
> To reproduce:
> 
> :echo fnamemodify('C:\__nodir__\__nofile__', ':.')
> 
> You'll see that the "C:" is removed from the given path.  If
> "C:\__nodir__\__nofile__" doesn't exist, the path should not be modified 
> (because
> it's not relative to the working directory).
> 
> See ":help filename-modifiers" for the description of how ":." should cause
> fnamemodify() to behave.

On MS-Windows the drive is sticky, thus \dir\path will use the current
drive.  Thus the resulting path will work.  We can adjust the help to
explain this.

-- 
Despite the cost of living, have you noticed how it remains so popular?

 /// 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: Test whether a glyph can be displayed

2018-06-13 Fir de Conversatie Christian Brabandt


On Mi, 13 Jun 2018, Luc Hermitte wrote:

> Hi,
> 
> Is there a way to test whether vim can display a glyph with the current font?
> Given it defaults to some made-up glyphs I suspect it has a way to do it 
> internally, but I haven't found in the doc whether this information is 
> exposed.
> 
> The objective is to be able to select the fallback solution
> 
>:let warning_sign = FirstSupportedAmong("\u26a0", "\u26DB", "!!")

I don't think there is a good way, because especially in the terminal 
Vim won't know what the result of a character will actually look like. 
Best way I can think of, put the character on the tabline. Then capture 
the result and compare using `:echo nr2char(screenchar(1,1))`

That is probably nothing that can be done without the user noticing it 
(e.g. it most likely requires a redraw for the tabline to be displayed 
before capturing the result and then hiding and restoring the tabline 
again).

Best,
Christian
-- 
Letzte Worte eines Chemikers:
  "So, jetzt die Knallgasprobe."

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


Bug Report: fnamemodify() fails on Windows

2018-06-13 Fir de Conversatie Jason Franklin
I wanted to fix this myself, but I'm not having any fun fighting with the
Microsoft build tools.  Hopefully, someone else has time to look into this
issue.

System:   Windows 10
Vim Version:  8.1.0001

To reproduce:

:echo fnamemodify('C:\__nodir__\__nofile__', ':.')

You'll see that the "C:" is removed from the given path.  If
"C:\__nodir__\__nofile__" doesn't exist, the path should not be modified 
(because
it's not relative to the working directory).

See ":help filename-modifiers" for the description of how ":." should cause
fnamemodify() to behave.

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


Test whether a glyph can be displayed

2018-06-13 Fir de Conversatie Luc Hermitte
Hi,

Is there a way to test whether vim can display a glyph with the current font?
Given it defaults to some made-up glyphs I suspect it has a way to do it 
internally, but I haven't found in the doc whether this information is exposed.

The objective is to be able to select the fallback solution

   :let warning_sign = FirstSupportedAmong("\u26a0", "\u26DB", "!!")

-- 
Luc Hermitte

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