Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move workaround for "Press ENTER or type command to continue" to test runner #109

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions tests/batch_ftdetect_res.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ set nomore

bufdo redir >> $OUTPUT | echo @% | set ft? | redir END

" Prevent stalling on 'Press ENTER or type command to continue'
call feedkeys("\<CR>")

qa
8 changes: 6 additions & 2 deletions tests/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{
env,
ffi::OsString,
fs::canonicalize,
io::{self, ErrorKind},
io::{self, prelude::*, ErrorKind},
os::unix::fs as ufs,
path::{Path, PathBuf},
process::{Command, Stdio},
Expand Down Expand Up @@ -76,12 +76,16 @@ pub fn run_vim(
.env("HOME", home)
.env("XDG_CONFIG_HOME", home)
.env("XDG_DATA_HOME", home)
.stdin(Stdio::null())
.stdin(Stdio::piped())
.stdout(Stdio::null())
.stderr(Stdio::piped())
.spawn()
.unwrap();

let mut vim_stdin = vim.stdin.take().unwrap();
// Prevent stalling on "Press ENTER or type command to continue"
vim_stdin.write_all(b"\r")?;

let status = loop {
let poll_interval = Duration::from_millis(200);
match vim.wait_timeout(poll_interval) {
Expand Down