Skip to content

Commit

Permalink
Editor: fix the Vim version detection (#1356)
Browse files Browse the repository at this point in the history
  • Loading branch information
apocelipes authored Oct 26, 2024
1 parent 19902fa commit 53e0861
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/detection/editor/editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const char* ffDetectEditor(FFEditorResult* result)

if (ffStrbufEqualS(&result->exe, "nvim"))
ffBinaryExtractStrings(result->path.chars, extractNvimVersionFromBinary, &result->version, (uint32_t) strlen("NVIM v0.0.0"));
else if (ffStrbufEqualS(&result->exe, "vim"))
else if (ffStrbufEqualS(&result->exe, "vim") || ffStrbufStartsWithS(&result->exe, "vim."))
ffBinaryExtractStrings(result->path.chars, extractVimVersionFromBinary, &result->version, (uint32_t) strlen("VIM - Vi IMproved 0.0"));
else if (ffStrbufEqualS(&result->exe, "nano"))
ffBinaryExtractStrings(result->path.chars, extractNanoVersionFromBinary, &result->version, (uint32_t) strlen("GNU nano 0.0"));
Expand All @@ -106,6 +106,7 @@ const char* ffDetectEditor(FFEditorResult* result)
if (
ffStrbufEqualS(&result->exe, "nano") ||
ffStrbufEqualS(&result->exe, "vim") ||
ffStrbufStartsWithS(&result->exe, "vim.") || // vim.basic/vim.tiny
ffStrbufEqualS(&result->exe, "nvim") ||
ffStrbufEqualS(&result->exe, "micro") ||
ffStrbufEqualS(&result->exe, "emacs") ||
Expand Down

0 comments on commit 53e0861

Please sign in to comment.