This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright 2025 Igor Burago. Released under the ISC License. | |
| #include <limits.h> // CHAR_BIT | |
| #include <stddef.h> // ptrdiff_t | |
| #include <stdint.h> | |
| #include <string.h> // memcpy(), memmove(), memset() | |
| // Built-in u128 is not strictly required, but it makes it easier to guarantee | |
| // the absence of overflows during sampling in rank_partition() for all possible | |
| // input array lengths. It also simplifies the implementation of the mcg64 RNG. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright 2013 Igor Burago. Released under the ISC License. | |
| #include <limits.h> | |
| #include <stdio.h> | |
| static unsigned | |
| enum_bit(unsigned q, unsigned x, unsigned *xs) { | |
| if (q == 0) { | |
| *xs = x; | |
| return 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Copyright 2022 Igor Burago. Released under the ISC License. | |
| " Simple emulation of indentation guides. | |
| " | |
| " For tab-based indentation, using the 'listchars' option works fine. | |
| " For space-based indentation, one can either: | |
| " • use the match highlighting feature (see ':help match-highlight'), | |
| " as shown in ToggleMatchHighlightIndentGuides(); or | |
| " • use the 'leadmultispace' setting of the 'listchars' option (added | |
| " in Vim 9.0), as shown in ToggleListCharsIndentGuides(). |