Author Topic: Can't edit files with spaces in SE 17 (64-bit) for Linux  (Read 3270 times)

AriP

  • Community Member
  • Posts: 7
  • Hero Points: 0
Can't edit files with spaces in SE 17 (64-bit) for Linux
« on: February 06, 2014, 04:15:29 PM »
Ah, the pains of dealing with a trial user! Right-clicking a file in the Ubuntu file manager (Nautilus) and picking 'Edit with SE' works fine if there are no spaces anywhere in the fully qualified file name. If there are, Slick attempts to edit a non-existent file! For example, if I try to edit "/home/me/financial reports/qtr1.txt" what pops up in Slick is an empty file named "/home/me/financial". Please, someone, tell me there's a way around this or I'll have to let the trial expire. Thanks.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2898
  • Hero Points: 153
Re: Can't edit files with spaces in SE 17 (64-bit) for Linux
« Reply #1 on: February 06, 2014, 04:18:30 PM »
Filenames with spaces need to be double quoted (because the command line accepts multiple files).  Is there a way to adjust the command that Nautilus uses so the filename is always double quoted?

AriP

  • Community Member
  • Posts: 7
  • Hero Points: 0
Re: Can't edit files with spaces in SE 17 (64-bit) for Linux
« Reply #2 on: February 06, 2014, 04:33:13 PM »
To the best of  my knowledge that can't be done without modifying Nautilus. It's easy enough to use gedit to do the job, but gedit is so pathetic I was hoping to use Slick. Looking at the problem in reverse, is there a way via configuration files to modify SE? This is really important to me. I know the rule in *nix is, "You'll be sorry if you use spaces in path names even though it's allowed," but my predecessor was a non-conformist.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2898
  • Hero Points: 153
Re: Can't edit files with spaces in SE 17 (64-bit) for Linux
« Reply #3 on: February 06, 2014, 05:03:41 PM »
There isn't really a way to configure this in SlickEdit.

What if you replaced vs with a script that gathered all the command line arguments, quoted them, and then ran the original vs?  This introduces another problem.  There are invocation options that can be space delimited, so you would have to skip items that start with - or +.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Can't edit files with spaces in SE 17 (64-bit) for Linux
« Reply #4 on: February 06, 2014, 05:29:27 PM »
Nautilus does allow you to define scripts that show up in the right click menus for files.  But it doesn't look like you can associate with the with the default double-click action for that file type.  But if you don't mind right clicking all of the time...

Create a file called "slickedit_open" under ~/.local/share/nautilus/scripts/ for Gnome3, or ~/.gnome2/nautilus-scripts for Gnome2.  Here's the text for the script:

#!/bin/bash

for f in $NAUTILUS_SCRIPT_SELECTED_URIS
do
   f=`echo $f | sed 's/%20/ /g' | sed 's/file:\/\///g'`
   PATH_TO_YOUR_VS_INSTALL/bin/vs \"$f\"
done


chmod +x the file, and then when you select a file or files in nautilus and right click, there should be a Scripts -> slickedit_open option now that will launch the files in slickedit.

This script doesn't even try to deal with the space delimited options that Dan mentioned. :)
« Last Edit: February 06, 2014, 05:36:11 PM by patrick »

AriP

  • Community Member
  • Posts: 7
  • Hero Points: 0
Re: Can't edit files with spaces in SE 17 (64-bit) for Linux
« Reply #5 on: February 06, 2014, 06:27:23 PM »
Dan and Patrick: Thanks very much for the quick response. I'll give your suggestions a try after lunch.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Can't edit files with spaces in SE 17 (64-bit) for Linux
« Reply #6 on: February 10, 2014, 03:30:49 PM »
Out of curiosity, what version of Ubuntu are you on?  It looks like on newer versions of nautilus, as long as we supply a proper .desktop file, we can launch v17 just fine for files that are in directories with spaces. Without knowing what version you're on, can't tell how relevant that is.  Thanks.