patch 9.1.0871: getcellpixels() can be further improved

Problem:  getcellpixels() can be further improved
Solution: Fix floating point exception, implement getcellpixels() in the
          UI (mikoto2000)

closes: #16059

Signed-off-by: mikoto2000 <mikoto2000@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
mikoto2000
2024-11-18 21:12:21 +01:00
committed by Christian Brabandt
parent bd4614f43d
commit a73dfc2f55
8 changed files with 82 additions and 50 deletions

View File

@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2024 Nov 14
*builtin.txt* For Vim version 9.1. Last change: 2024 Nov 18
VIM REFERENCE MANUAL by Bram Moolenaar
@ -3790,8 +3790,13 @@ getbufvar({buf}, {varname} [, {def}]) *getbufvar()*
getcellpixels() *getcellpixels()*
Returns a |List| of terminal cell pixel size.
List format is [xpixels, ypixels].
Only works on (terminal) Unix. For gVim, on other systems and
on failure returns [].
Only works on Unix (terminal and gVim) and Windows (gVim only).
Returns [] on other systems or on failure.
Note that there could be variations across different terminals.
On macOS, system Terminal.app returns sizes in points (before
Retina scaling), whereas third-party terminals return raw pixel
sizes (post Retina scaling).
Return type: list<any>