Saturday, January 2, 2021

Re: why doesn't min take more than 1 parameter?

Just do ":help min()", it will tell you:

min({expr}) Return the minimum value of all items in {expr}.
{expr} can be a |List| or a |Dictionary|.

So the simplest solution seems to be:

trunc(min([3, float2nr(1+log(1+line('$'))/log(10))]))

On Sat, 2 Jan 2021 at 22:49, L A Walsh <vim@tlinx.org> wrote:
I have the expression:

trunc(1+log(1+line('$'))/log(10))

to give me the width of the number columns when numbering is
on.  Seems that it is reserving a minimum of 3 columns, so I tried
using the 'min' function:

trunc(min(3,1+log(1+line('$'))/log(10)))

but I get E118: Too many arguments for function: min.

huh?  so how does one use 'min' to determine the lowest of 2 or
more numbers, or why doesn't the above work? :-(


*sigh*,
tnx


--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5FF08799.3040702%40tlinx.org.


--
Yongwei Wu
URL: http://wyw.dcweb.cn/

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CADs46ifKSZWXycw-ft%2B-F8OFFLqcxcOFb9zasYSxta%3D3RDYSRw%40mail.gmail.com.

No comments: