mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 23:06:14 +00:00
refactor: change type of linenr_T from long to int32_t
The size of long varies depending on architecture, in contrast to the MAXLNUM constant which sets the maximum allowable number of lines to 2^32-1. This discrepancy may lead to hard to detect bugs, for example https://github.com/neovim/neovim/issues/18454. Setting linenr_T to a fix maximum size of 2^32-1 will prevent this type of errors in the future. Also change the variables `amount` and `amount_after` to be linenr_T since they're referring to "the line number difference" between two texts.
This commit is contained in:
@@ -5933,7 +5933,7 @@ static void show_pat_in_path(char_u *line, int type, bool did_show, int action,
|
||||
if (action == ACTION_SHOW_ALL) {
|
||||
snprintf((char *)IObuff, IOSIZE, "%3ld: ", count); // Show match nr.
|
||||
msg_puts((const char *)IObuff);
|
||||
snprintf((char *)IObuff, IOSIZE, "%4ld", *lnum); // Show line nr.
|
||||
snprintf((char *)IObuff, IOSIZE, "%4" PRIdLINENR, *lnum); // Show line nr.
|
||||
// Highlight line numbers.
|
||||
msg_puts_attr((const char *)IObuff, HL_ATTR(HLF_N));
|
||||
msg_puts(" ");
|
||||
|
Reference in New Issue
Block a user