Skip to content

Commit 0b2008a

Browse files
committed
feat(findNvim): version parsing robustness
Problem: Version parsing makes some assumptions about the `nvim -v` output that could be more robust. For example, - "NVIM" may change to "Nvim": neovim/neovim@98ba65b - "v" is not guaranteed to precede the version Solution: - match case-insensitive "NVIM" - match "v?" instead of "v" - Note: `--api-info` is not used because it is a big payload (thus requires streamed decoding, thus more complex code).
1 parent ba4c247 commit 0b2008a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [5.4.0](https://github.com/neovim/node-client/compare/v5.3.0...v5.4.0)
44

5-
- TODO
5+
- feat(findNvim): version parsing robustness
66

77
## [5.3.0](https://github.com/neovim/node-client/compare/v5.2.1...v5.3.0)
88

packages/neovim/src/utils/findNvim.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export type FindNvimResult = {
6767
};
6868

6969
const versionRegex = /^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/;
70-
const nvimVersionRegex = /^NVIM\s+v(.+)$/m;
70+
const nvimVersionRegex = /^[nN][vV][iI][mM]\s+v?(.+)$/m;
7171
const buildTypeRegex = /^Build\s+type:\s+(.+)$/m;
7272
const luaJitVersionRegex = /^LuaJIT\s+(.+)$/m;
7373
const windows = process.platform === 'win32';

0 commit comments

Comments
 (0)