-
Notifications
You must be signed in to change notification settings - Fork 86
Use the working folder of the search to used it to open the result file. #345
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
base: master
Are you sure you want to change the base?
Conversation
…used when the query ran
I think you should use |
It is indeed a solution but when your project is in a deep file structure the output of CtrlSF is clutter with the path prefix that add no value to the user. I believe the pull request bring something to some users (;-)) |
@@ -83,6 +83,7 @@ let s:backend_args_map = { | |||
" BuildCommand() | |||
" | |||
func! s:BuildCommand(args, for_shell) abort | |||
let g:ctrlsf_pwd = getcwd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using global variables as they're typically reserved for options. Instead, define it as s:current_pwd
(similar to s:current_mode
), and add a new public method ctrlsf#GetFilePath(path)
.
@@ -426,21 +426,28 @@ func! s:OpenFileInWindow(file, lnum, col, mode, split) abort | |||
endif | |||
endif | |||
|
|||
let file_path = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you verified that ctrlsf#edit#Save
still works correctly when the CWD changes? I suspect there might be issues with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review.
I'll do more tests and I'll come back to you.
This pull request intent to solve issue #344:
Fail to open the file of the search result when the working directory change