automatically escape file path's if necessary#21
Conversation
|
Somehow this command is not triggered by a |
|
Why do you need this? |
|
Because every line |
|
If the question referred to the BufWrite trigger, it is a saner alternative to the BufWriteCmd trigger, see #22 (comment) . Indeed, the |
|
I don't understand. For me, it always escapes spaces. And that is what it actually should: Here for the automatic check on saving: CheckAttach/ftplugin/mail/CheckAttach.vim Lines 180 to 181 in b583efd Here when using an external file browser: CheckAttach/ftplugin/mail/CheckAttach.vim Lines 211 to 212 in b583efd Here when using CheckAttach/ftplugin/mail/CheckAttach.vim Line 269 in b583efd So when do you exactly see that problem? |
|
Yes, CheckAttach escapes spaces when a file is appended by the |
|
Well, regarding CheckAttach/ftplugin/mail/CheckAttach.vim Lines 180 to 181 in b583efd I am lost, it didn't escape spaces over here. |
|
Well, perhaps use |
|
I think the script has been created, when Regarding:
Can you step through the function and check why it doesn't work for you? You can manually start debugging by running |
There was a misunderstanding. I thought CheckAttach/ftplugin/mail/CheckAttach.vim Lines 180 to 181 in b583efd is there to automatize the escaping when saving or quitting Vim. But it seems to me that let ans = input(prompt, "", "file")
while (ans != '') && (ans != 'n')
if empty(s:external_file_browser)
let list = split(expand(ans), "\n")only escapes file names attached by the |
|
so you are manually adding the pseudo attach header and want the plugin to escape the filename automatically on save? |
|
That's it, I think. I frequently paste file paths from a file manager, such as Krusader. If these aren't escaped, they disappear on entering the send dialog of mutt. |
|
Please check current head. I made some changes to your patch and implemented it slightly different. The result should work however. Note, I intentionally did not use |
This checks if the file path is already escaped or not. If the system already recognizes the file, then it must not be escaped.
I am not sure why |
It escapes things such as '%' or '#' for use by e.g. internal Vim commands, that would otherwise expand e.g. '%' to the currently edited file. However, I think those shouldn't be escaped, or else mutt won't find it. |
No description provided.