Skip to content

Commit a3cc253

Browse files
committed
Fixed some issues in the previous commit.
1 parent 58f8e68 commit a3cc253

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ local xpm32 = {folder=not CURSES and [[/* XPM */ static char *folder[] = { /* co
2525
--- Returns a normalized version of the given path that `lfs` can work with.
2626
-- @param path String path to normalize.
2727
local function normalize_path(path)
28-
path = path:gsub('^~', os.getenv('HOME'))
28+
if not WIN32 then path = path:gsub('^~', os.getenv('HOME')) end
2929

3030
-- Convert relative path into an absolute one.
3131
if not path:find('^%a?:?[/\\]') then
@@ -64,7 +64,7 @@ local function complete()
6464
-- Determine the current directory and file prefix (if any).
6565
local dir, part = normalize_path(ui.command_entry:get_text()):match('^(.-)\\?([^/\\]*)$')
6666
if WIN32 and dir:find('^%a:$') then dir = dir .. '\\' end -- C: --> C:\
67-
if not lfs.attributes(dir, 'mode') == 'directory' then return end
67+
if lfs.attributes(dir, 'mode') ~= 'directory' then return end
6868

6969
-- Iterate over directory, finding file matches.
7070
for filename in lfs.walk(dir, nil, 0, true) do

init_test.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ end)
3535
test('open_file_mode should select unique items after typing and pressing Tab again', function()
3636
local file = 'file.txt'
3737
local file2 = 'file2.txt'
38-
local dir<close> = test.tmpdir({file, file2}, true)
38+
local _<close> = test.tmpdir({file, file2}, true)
3939

4040
local auto_c_show = test.stub()
4141
local _<close> = test.mock(ui.command_entry, 'auto_c_show', auto_c_show)

0 commit comments

Comments
 (0)