Skip to content

Commit

Permalink
Merge pull request #33 from mistweaverco/fix/win-infinite-loop
Browse files Browse the repository at this point in the history
fix(fs): infinite loop on windows
  • Loading branch information
gorillamoe authored Jul 5, 2024
2 parents 06eef2a + dc4ebe0 commit 005cd22
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# kulala.nvim <small>1.5.0</small>
# kulala.nvim <small>1.5.1</small>

> A minimal 🤏 HTTP-client 🐼 interface 🖥️ for Neovim ❤️.
Expand Down
2 changes: 1 addition & 1 deletion lua/kulala/globals/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local FS = require("kulala.utils.fs")

local M = {}

M.VERSION = "1.5.0"
M.VERSION = "1.5.1"
M.UI_ID = "kulala://ui"
M.HEADERS_FILE = FS.get_plugin_tmp_dir() .. "/headers.txt"
M.BODY_FILE = FS.get_plugin_tmp_dir() .. "/body.txt"
Expand Down
7 changes: 6 additions & 1 deletion lua/kulala/utils/fs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ local M = {}
-- @usage local p = fs.find_file_in_parent_dirs('Makefile')
M.find_file_in_parent_dirs = function(filename)
local dir = vim.fn.expand('%:p:h')
while dir ~= '/' and dir ~= '' do
-- make sure we don't go into an infinite loop
-- if the file is in the root directory of windows or unix
-- we should stop at the root directory
-- for linux, the root directory is '/'
-- for windows, the root directory is '[SOME_LETTER]:\'
while dir ~= '/' and dir:match('[A-Z]:\\') == nil do
local parent = dir .. '/' .. filename
if vim.fn.filereadable(parent) == 1 then
return parent
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kulala.nvim",
"version": "1.5.0",
"version": "1.5.1",
"scripts": {
"docs": "docsify serve docs"
},
Expand Down

0 comments on commit 005cd22

Please sign in to comment.