Skip to content

Commit bece9f8

Browse files
committed
fix(replay): fix on windows (non-wsl)
1 parent f9d4191 commit bece9f8

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

tests/manual/init_replay.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
local plugin_root = vim.fn.expand('$PWD')
1+
local plugin_root = vim.fn.getcwd()
2+
3+
vim.notify(plugin_root)
24
vim.opt.runtimepath:append(plugin_root)
35

46
local plenary_path = plugin_root .. '/deps/plenary.nvim'
5-
if vim.fn.isdirectory(plenary_path) == 1 then
6-
vim.opt.runtimepath:append(plenary_path)
7+
8+
-- Check if plenary exists, if not, clone it
9+
if vim.fn.isdirectory(plenary_path) ~= 1 then
10+
-- Create deps directory if it doesn't exist
11+
if vim.fn.isdirectory(plugin_root .. '/deps') ~= 1 then
12+
vim.fn.mkdir(plugin_root .. '/deps', 'p')
13+
end
14+
15+
print('Cloning plenary.nvim for testing...')
16+
local clone_cmd = 'git clone --depth 1 https://github.com/nvim-lua/plenary.nvim.git ' .. plenary_path
17+
vim.fn.system(clone_cmd)
718
end
819

20+
vim.opt.runtimepath:append(plenary_path)
21+
922
vim.o.laststatus = 3
1023
vim.o.termguicolors = true
1124
vim.g.mapleader = ' '

tests/manual/renderer_replay.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ M.headless_mode = false
1414

1515
function M.load_events(file_path)
1616
file_path = file_path or 'tests/data/simple-session.json'
17-
local data_file = vim.fn.expand('$PWD') .. '/' .. file_path
17+
local data_file = vim.fn.getcwd() .. '/' .. file_path
1818
local f = io.open(data_file, 'r')
1919
if not f then
2020
vim.notify('Could not open ' .. data_file, vim.log.levels.ERROR)

tests/manual/replay.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Get the directory containing this script
2+
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
3+
4+
# Get the project root (two directories up)
5+
$ProjectRoot = Resolve-Path (Join-Path $ScriptDir "..\..")
6+
7+
# Change to project root
8+
Set-Location $ProjectRoot
9+
10+
Write-Host "Starting Streaming Renderer Replay Test..."
11+
Write-Host ""
12+
13+
# Run Neovim with the test init file, passing all arguments through
14+
nvim -u "tests/manual/init_replay.lua" @Args
15+

tests/minimal/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ vim.opt.runtimepath:remove(vim.fn.expand('~/.config/nvim'))
66
vim.opt.packpath:remove(vim.fn.expand('~/.local/share/nvim/site'))
77

88
-- Add the plugin to the runtimepath
9-
local plugin_root = vim.fn.expand('$PWD')
9+
local plugin_root = vim.fn.getcwd()
1010
vim.opt.runtimepath:append(plugin_root)
1111

1212
-- Add plenary to the runtimepath for testing

0 commit comments

Comments
 (0)