-
Notifications
You must be signed in to change notification settings - Fork 318
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
I can not open a file that contains LF in the name #365
Comments
Can probably fix this, although it might be the kind of thing that is very susceptible to platform differences. I also wonder how sane it is to create/use files with newlines in their names. Do you really have such files in your use case? |
Something like this will probably do it; works for me locally at least. Care to try it on your system @rkuchumov? diff --git a/ruby/command-t/lib/command-t/controller.rb b/ruby/command-t/lib/command-t/controller.rb
index 6f0187b..ebded6a 100644
--- a/ruby/command-t/lib/command-t/controller.rb
+++ b/ruby/command-t/lib/command-t/controller.rb
@@ -416,7 +416,7 @@ def case_sensitive?
def sanitize_path_string(str)
# for details on escaping command-line mode arguments see: :h :
# (that is, help on ":") in the Vim documentation.
- str.gsub(/[ \\|%#"]/, '\\\\\0')
+ str.gsub(/[ \n\\|%#"]/, '\\\\\0')
end
def current_buffer_visible_in_other_window |
Probably a better/safer fix: diff --git a/ruby/command-t/lib/command-t/controller.rb b/ruby/command-t/lib/command-t/controller.rb
index 6f0187b..0323d54 100644
--- a/ruby/command-t/lib/command-t/controller.rb
+++ b/ruby/command-t/lib/command-t/controller.rb
@@ -412,11 +412,9 @@ def case_sensitive?
false
end
- # Backslash-escape space, \, |, %, #, "
+ # Backslash-escape space, \, |, %, #, " etc.
def sanitize_path_string(str)
- # for details on escaping command-line mode arguments see: :h :
- # (that is, help on ":") in the Vim documentation.
- str.gsub(/[ \\|%#"]/, '\\\\\0')
+ ::VIM::evaluate("fnameescape('#{str}')")
end
def current_buffer_visible_in_other_window |
The last one works, thanks! |
When I create a file that contains LF:
I can not use command-t to open it:
One of the workaround that I've found is to use
:edit **/*
instead of command-tThe text was updated successfully, but these errors were encountered: