A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/e67cd22c38493d4dff90f6afa17bfeacd0ba953d below:

handle edge case with maximum value · neovim/neovim@e67cd22 · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+10

-1

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+10

-1

lines changed Original file line number Diff line number Diff line change

@@ -5495,11 +5495,19 @@ static int buf_signcols_inner(buf_T *buf, int maximum)

5495 5495 5496 5496

int buf_signcols(buf_T *buf, int maximum)

5497 5497

{

5498 +

// The maximum can be determined from 'signcolumn' which is window scoped so

5499 +

// need to invalidate signcols if the maximum is greater than the previous

5500 +

// maximum.

5501 +

if (maximum > buf->b_signcols_max) {

5502 +

buf->b_signcols_valid = false;

5503 +

}

5504 + 5498 5505

if (!buf->b_signcols_valid) {

5499 5506

int signcols = buf_signcols_inner(buf, maximum);

5500 5507

// Check if we need to redraw

5501 5508

if (signcols != buf->b_signcols) {

5502 5509

buf->b_signcols = signcols;

5510 +

buf->b_signcols_max = maximum;

5503 5511

redraw_buf_later(buf, NOT_VALID);

5504 5512

}

5505 5513 Original file line number Diff line number Diff line change

@@ -864,6 +864,7 @@ struct file_buffer {

864 864

sign_entry_T *b_signlist; // list of placed signs

865 865

int b_signcols; // last calculated number of sign columns

866 866

bool b_signcols_valid; // calculated sign columns is valid

867 +

int b_signcols_max; // Maximum value b_signcols is valid for.

867 868 868 869

Terminal *terminal; // Terminal instance associated with the buffer

869 870 Original file line number Diff line number Diff line change

@@ -8165,7 +8165,7 @@ int win_signcol_configured(win_T *wp, int *is_fixed)

8165 8165

}

8166 8166 8167 8167

int needed_signcols = buf_signcols(wp->w_buffer, maximum);

8168 -

int ret = MAX(minimum, needed_signcols);

8168 +

int ret = MAX(minimum, MIN(maximum, needed_signcols));

8169 8169

assert(ret <= SIGN_SHOW_MAX);

8170 8170

return ret;

8171 8171

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4