Sublime Forum

[BUG] opening files with "(" in the file path doesn't work

#1

On Ubuntu 13.04, when using SearchMonkey to search for files, I currently have it configured to open files with SublimeText2. (version 2.0.1 build 2217)
The command it calls is:

/opt/SublimeText2/sublime_text

with the attribute
%f

But, when I try to load a file with “(” or “)” in the path, it fails to load the file correctly.
For example, the path:
“/home/jameslefeu/liferay/Git/CE/trunk/portal-web/docroot/html (another copy)/portlet/directory/view_users.jsp”
fails to load correctly and instead loads a blank text file.
It actually opens two windows of blank text files instead of the file which needs to be opened.
See screenshot here:
ftp.liferay.com/SublimeTextFails2OpenFile.png

0 Likes

#2

It’s probably because of the spaces, not the bracket. Try again with spaces but no bracket and see it if works.

0 Likes

#3

ah. Very insightful.

I tried two tests:

  1. I removed the spaces and left the “(” and “)” and it worked fine.
  2. I removed the “(” and “)” and left the spaces and it broke just as before.

This, then, appears to be a problem not with “(” or “)” but with whitespace in the path.

0 Likes

#4

So in case it’s not apparent, you need to change the %f to “%f” so the filename will be quoted when sublime is invoked.

0 Likes

#5

Excellent!

I just tried it with “%f” instead of %f and it works perfectly now!

Thank you so much!
:smile:

0 Likes