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

Can't recognized root directory when use terminal to output #34

Open
qsdrqs opened this issue Jun 20, 2020 · 4 comments
Open

Can't recognized root directory when use terminal to output #34

qsdrqs opened this issue Jun 20, 2020 · 4 comments

Comments

@qsdrqs
Copy link

qsdrqs commented Jun 20, 2020

Hello! It's a nice vim plugin and I get a lot of benefit from it!
But I meet a problem that I can't change to my root directory on terminal output mode. Here is my project tree.

.
├── .root
├── src
│   └── 1.cpp
└── .tasks

When I open 1.cpp in src directory, and run asynctasks configured like that:

[file-build]
command=pwd
cwd=$(VIM_ROOT)

output=terminal

It shows

/home/qsdrqs/test/src

[Process exited 0]

When I change output into quickfix, it shows

|| [pwd]
|| /home/qsdrqs/test
|| [Finished in 0 seconds]

In a word, the "terminal" mode may not works well in changing directory.

@skywind3000
Copy link
Owner

I can't reproduce your problem, could you diagnose this with:

:echo asyncrun#get_root('%')

And see if the output is correct.

@qsdrqs
Copy link
Author

qsdrqs commented Jun 22, 2020

I can't reproduce your problem, could you diagnose this with:

:echo asyncrun#get_root('%')

And see if the output is correct.

Yes, it is correct.

I make some steps to reproduce this problem, at least it works for me.

  1. create a directory called test and cd into it
  2. create a empty file .root
  3. create a directory called src and cd into it
  4. create a file called 1.c and use vim to edit it.
  5. config vimrc file as below:
Plug 'skywind3000/asynctasks.vim'
Plug 'skywind3000/asyncrun.vim'
let g:asyncrun_open = 7

let g:asynctasks_confirm=0
let g:asynctasks_term_pos = 'bottom'
let g:asynctasks_term_rows = 14

6.use

:AsyncTaskEdit

to edit .task file (which is correctly at the ".root" position)

[file-build]
command=pwd
cwd=$(VIM_ROOT)
output=terminal

save it.
7.use

:AsyncTask file-build

then it shows

/home/qsdrqs/test/src

[Process exited 0]

I have noticed that when I config

let g:asynctasks_term_pos 

as quickfix , vim , tab and external it just works well. But when I set it as top , bottom , left and right , it shows the wrong directory.

@skywind3000
Copy link
Owner

what is your vim version number ?? operating system ??

@qsdrqs
Copy link
Author

qsdrqs commented Jun 23, 2020

what is your vim version number ?? operating system ??

My vim version is 8.2, OS is archlinux and kernel version is 5.7.2

I noticed a trick that if I add cd $(VIM_ROOT) before pwd and the :AsyncTask file-build will show the correct result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants