Skip to content
Myr

Merge branch 'zero-lines'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Closes #92

authored by Daniel Eklöf · committed by Daniel Eklöf · parents aa456b7, 20940f2 · Browse files · 2 files+15 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+15 added−11 removed

  • other:+15 added−11 removed

2 files+15 added−11 removed

modified:CHANGELOG.md+2 added
67 unmodified lines
68* Tab and Shift+Tab not wrapping around69 (https://codeberg.org/dnkl/fuzzel/issues/78).70* Visual glitches in the corners, when using rounded corners71 (https://codeberg.org/dnkl/fuzzel/issues/90).72* Regression: `--dmenu --lines=0` crashing73 (https://codeberg.org/dnkl/fuzzel/issues/92).747576### Security77### Contributors
227 unmodified lines
modified:match.c+13 added-11 removed
217 unmodified lines
218matches_get_page_count(const struct matches *matches)219{220 return matches->max_matches_per_page != 0221 ? matches->match_count / matches->max_matches_per_page222 : 0;222 : matches->match_count;223}224225size_t226matches_get_page(const struct matches *matches)227{228 return matches->max_matches_per_page != 0229 ? matches->selected / matches->max_matches_per_page230 : 0;230 : matches->selected;231}232233const struct match *234matches_get(const struct matches *matches, size_t idx)
27 unmodified lines
262{263 const size_t total = matches->match_count;264 const size_t page_no = matches_get_page(matches);265266 if (matches->max_matches_per_page == 0)267 return 0;268269 if (total == 0)270 return 0;271 else if (page_no + 1 >= matches->page_count) {272 size_t remainder = total % matches->max_matches_per_page;
129 unmodified lines
402403void404matches_update(struct matches *matches, const struct prompt *prompt)405{403 assert(matches->max_matches_per_page > 0);404406 if (matches->applications == NULL)407 return;408409 const wchar_t *ptext = prompt_text(prompt);
16 unmodified lines
426427 if (matches->selected >= matches->match_count && matches->selected > 0)428 matches->selected = matches->match_count - 1;429429 matches->page_count = (430 matches->match_count + (matches->max_matches_per_page - 1)) /431 matches->max_matches_per_page;432430 matches->page_count = matches->max_matches_per_page > 0431 ? ((matches->match_count + (matches->max_matches_per_page - 1)) /432 matches->max_matches_per_page)433 : 1;434 return;435 }436437 const enum match_fields fields = matches->fields;
123 unmodified lines
561562 /* Sort */563 qsort(matches->matches, matches->match_count, sizeof(matches->matches[0]), &match_compar);564564 matches->page_count = (565 matches->match_count + (matches->max_matches_per_page - 1)) /566 matches->max_matches_per_page;565 matches->page_count = matches->max_matches_per_page566 ? ((matches->match_count + (matches->max_matches_per_page - 1)) /567 matches->max_matches_per_page)568 : 1;569570 if (matches->selected >= matches->match_count && matches->selected > 0)571 matches->selected = matches->match_count - 1;572}