summaryrefslogtreecommitdiffstatshomepage
path: root/src/gen/hashy.lua
AgeCommit message (Collapse)AuthorFiles
2026-03-09fix: silence LuaLS's `no-unknown` warnings in `src/`Riccardo Mazzarini1
2025-03-09build(generator): add dependencies on hashy (#32796)zeertzjq1
This allows generated sources to be automatically rebuilt when modifying hashy code. Also, appending to NVIM_GENERATED_FOR_{HEADERS,SOURCES} in the middle of custom commands is a bit strange. Move that after the custom commands.
2025-03-09refactor(hashy): use case labels instead of TOLOWER_ASC() (#32795)zeertzjq1
Follow-up to #32768 This is slightly faster according to the benchmark. This also makes it a build error if hashy is used incorrectly (generating a case-insensitive hash function from mixed-case strings), as duplicate case labels aren't allowed.
2025-03-09vim-patch:9.1.1184: Unnecessary use of vim_tolower() in vim_strnicmp_asc() ↵zeertzjq1
(#32792) Problem: Unnecessary use of vim_tolower() in vim_strnicmp_asc(). Solution: Use TOLOWER_ASC() instead (zeertzjq). It was passing *s1 and *s2 to vim_tolower(). When char is signed, which is the case on most platforms, c < 0x80 is always true, so it already behaves the same as TOLOWER_ASC(). closes: vim/vim#16826 https://github.com/vim/vim/commit/b7dc5d3b6169efc8aa0b9d86476072877e74bc2c Use this function for hashy case-insensitive lookup, as it's ASCII-only. Note that this function doesn't cast TOLOWER_ASC() argument to uint8_t, so it'll treat a UTF-8 byte as smaller than NUL. It doesn't matter, as one of the strings being compared is ASCII-only, and its behavior still leads to consistent ordering.
2025-03-08perf(keycodes): use hashy for string lookupzeertzjq1
This is slightly faster than the binary search as per the benchmark, and allows handling the vim/vim#16821 situation in generator code.
2025-02-26build: move all generator scripts to `src/gen/`Lewis Russell1
- Move all generator Lua scripts to the `src/gen/` - Add a `.luarc.json` to `src/gen/` - Add a `preload.lua` to `src/gen/` - Add `src` to `package.path` so it aligns with `.luarc.json' - Fix all `require` statements in `src/gen/` so they are consistent: - `require('scripts.foo')` -> `require('gen.foo')` - `require('src.nvim.options')` -> `require('nvim.options')` - `require('api.dispatch_deprecated')` -> `require('nvim.api.dispatch_deprecated')`