SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: jamesson on June 26, 2012, 04:14:12 AM

Title: right-click open #include files (sublime text style)?
Post by: jamesson on June 26, 2012, 04:14:12 AM
Howdy folks

Just got my hands on this thing a couple days ago. Great package overall, but...

One thing I miss from sublime text is the ability to right-click an #include /foo/bar.c statement and be able to pop /foo/bar.c open in another pane. Is this perhaps one of the optional commands in the right-click context menu?

Many thanks in advance

Joe
Title: Re: right-click open #include files (sublime text style)?
Post by: Graeme on June 26, 2012, 05:01:29 AM
You could try right click -> go to definition (Ctrl+dot)

Ctrl+comma to return.
Slickedit will need to know how to find the file so it will either need to be in your project or found through the path settings in your project - or maybe in the current folder, or be an absolute path.
It's easy to customise the right click menu to add an entry with a more intuitive name if you wanted to.

Title: Re: right-click open #include files (sublime text style)?
Post by: jamesson on June 26, 2012, 02:31:55 PM
Graeme

Many thakns for your answer, it confirms my own suspicions

However

In all cases, this returns symbol not found!

example statement;

#include "swirly/playback/swirly_time.js" - it's there, I checked.

I can imagine the possibility that this is formatted incorrectly, but if why does sublime text find it?

Thanks again

Joe
Title: Re: right-click open #include files (sublime text style)?
Post by: Dan on June 26, 2012, 02:55:05 PM
I can think of a couple of possibilities:

* The current working directory of the editor is different (you can check this on the File menu, or type "cd" on the SlickEdit command line)

* I don't know how projects work in your other editor, but you might need to add this to the include paths for your project in your SlickEdit project.  This is on the Project Properties dialog.
Title: Re: right-click open #include files (sublime text style)?
Post by: jamesson on June 26, 2012, 06:23:57 PM
Tried both, same result

Thanks again

Joe
Title: Re: right-click open #include files (sublime text style)?
Post by: Graeme on June 27, 2012, 11:31:56 AM
I assume you mean it still doesn't work.

Slickedit needs a leading / to treat this as an absolute path
Quote
#include "swirly/playback/swirly_time.js" - it's there, I checked.

How does your compiler find this and what type of file is doing the #include ?

I don't get "symbol not found" for a relative path that slick can't find  - instead I get a dialog that asks me to enter the path where the file can be found ??

Title: Re: right-click open #include files (sublime text style)?
Post by: jamesson on June 27, 2012, 01:41:19 PM
The include is handled by make - it's a weird system that uses make to assemble javascripts, don't think about it too hard :).

Re symbol not found, I am in 2011 - maybe your version is different?

And it's not an absolute path (assuming you mean path from root directory) - it's local relative to the open file
Title: Re: right-click open #include files (sublime text style)?
Post by: Dan on June 27, 2012, 01:43:14 PM
But you did try adding the include path to the SlickEdit project, correct?
Title: Re: right-click open #include files (sublime text style)?
Post by: jamesson on June 27, 2012, 02:31:58 PM
Yep, sure
Title: Re: right-click open #include files (sublime text style)?
Post by: Dan on June 27, 2012, 02:33:29 PM
OK, I had to double check.

Does this work for a simple path?  #include "a.h", where a.h is in the same path as the file you are editing?
Title: Re: right-click open #include files (sublime text style)?
Post by: jamesson on June 27, 2012, 03:17:34 PM

Same deal
Specifically it says "tag not found". I suspect this is a js issue, wherein SE cannot comprehend the existence of a make include within a jscript file. If so, it is forgiven.
Title: Re: right-click open #include files (sublime text style)?
Post by: Dan on June 27, 2012, 03:21:04 PM
Sorry, your last answer confused me a little bit.  What sort of file are you including, and what sort of file are you including it from?
Title: Re: right-click open #include files (sublime text style)?
Post by: jamesson on June 27, 2012, 03:33:07 PM
As I mentioned, this is a kludge that uses make to combine ("include") javascript files. All the files are javascript. Make is supposed to take a bunch of them and make a bigger one out of them. Sorry if I was unclear.
Title: Re: right-click open #include files (sublime text style)?
Post by: Graeme on June 28, 2012, 11:51:11 AM
Javascript doesn't support #include so slick doesn't recognize the text as a filename.  That's why you get symbol not found.  It's not hard to write a macro to do what you want.  I'll see if I can do it sometime.
Title: Re: right-click open #include files (sublime text style)?
Post by: Dan on June 28, 2012, 12:23:18 PM
You might try running the "cursor-error" command.  It may be bound to a key already, but it is a different command from what that menu item uses.
Title: Re: right-click open #include files (sublime text style)?
Post by: Graeme on June 28, 2012, 12:40:02 PM
Hey, that seems to work.  Thanks Dan.

Joe, you just need to add cursor_error to the right click menu  - so go right click, then select "edit this menu".  In the list box with the list of menu items, select the position where you want the new menu item to appear, then click "insert after"  -= then fill in the caption - e.g. "edit this file", for "command" you need to enter cursor_error  - then click OK.