mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 08:56:29 +00:00
eval: Refactor get_tv_lnum_buf
This commit is contained in:
@@ -2026,6 +2026,7 @@ bool tv_check_str_or_nr(const typval_T *const tv)
|
||||
///
|
||||
/// @return Line number or -1 or 0.
|
||||
linenr_T tv_get_lnum(const typval_T *const tv)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
linenr_T lnum = get_tv_number_chk(tv, NULL);
|
||||
if (lnum == 0) { // No valid number, try using same function as line() does.
|
||||
@@ -2046,6 +2047,7 @@ linenr_T tv_get_lnum(const typval_T *const tv)
|
||||
///
|
||||
/// @return Floating-point value of the variable or zero.
|
||||
float_T tv_get_float(const typval_T *const tv)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
switch (tv->v_type) {
|
||||
case VAR_NUMBER: {
|
||||
|
Reference in New Issue
Block a user