diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-06-10 19:28:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-10 19:28:47 +0200 |
commit | 673b3a780e969132330099c9b6008a766280e384 (patch) | |
tree | cd6b0dbad292dcbfaae637ffad385298594a2ff2 /src/nvim/api/private/helpers.c | |
parent | e15d31b530c443daea04d7a772b24da737397c53 (diff) | |
parent | a732c253b71f89702285d5ec6fd7803045f6add9 (diff) | |
download | rneovim-673b3a780e969132330099c9b6008a766280e384.tar.gz rneovim-673b3a780e969132330099c9b6008a766280e384.tar.bz2 rneovim-673b3a780e969132330099c9b6008a766280e384.zip |
Merge pull request #18461 from dundargoc/refactor/change-linenr-to-int32
refactor: change type of linenr_T from long to int32_t
Diffstat (limited to 'src/nvim/api/private/helpers.c')
-rw-r--r-- | src/nvim/api/private/helpers.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index af4aaf01aa..1ddaf63743 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -1397,7 +1397,8 @@ bool set_mark(buf_T *buf, String name, Integer line, Integer col, Error *err) return res; } } - pos_T pos = { line, (int)col, (int)col }; + assert(INT32_MIN <= line && line <= INT32_MAX); + pos_T pos = { (linenr_T)line, (int)col, (int)col }; res = setmark_pos(*name.data, &pos, buf->handle); if (!res) { if (deleting) { @@ -1773,9 +1774,9 @@ void build_cmdline_str(char **cmdlinep, exarg_T *eap, CmdParseInfo *cmdinfo, cha // Command range / count. if (eap->argt & EX_RANGE) { if (eap->addr_count == 1) { - kv_printf(cmdline, "%ld", eap->line2); + kv_printf(cmdline, "%" PRIdLINENR, eap->line2); } else if (eap->addr_count > 1) { - kv_printf(cmdline, "%ld,%ld", eap->line1, eap->line2); + kv_printf(cmdline, "%" PRIdLINENR ",%" PRIdLINENR, eap->line1, eap->line2); eap->addr_count = 2; // Make sure address count is not greater than 2 } } |