Author Topic: Open project file macro and new open local symbol macro  (Read 49401 times)

asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
Open project file macro and new open local symbol macro
« on: November 14, 2007, 11:42:30 AM »
Here's another macro. This one, once triggered, opens list of all project file. The list is search-able, like in open local symbol macro (http://community.slickedit.com/index.php?topic=2245.0). Note that older version of open local symbol WILL NOT work with this macro. Hence the new version of open local symbol. Have fun!


asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
Re: Open project file macro and new open local symbol macro
« Reply #1 on: November 18, 2007, 02:38:32 PM »
One important note. Thanks to hs2 for inspiring me to fix old abandoned macro and bring it to daylight  ;D ;D ;D

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Open project file macro and new open local symbol macro
« Reply #2 on: November 19, 2007, 01:01:06 AM »
Hi Alexander, it's really good to read this kind of feedback !!
And as already mentioned it also helped me to get a long missed feature and to get better in Slick-C programming too.
Because I'm using it very, very often I didn't stop to improve 'ols'...
(Added 'Quick tag filter' + Preview TB support and it scales much better with buffers containing a large number of tags.)
But there were quite a lot of internal changes so I need to do some more testing (simple enough - I'm just using it).
I've to say that I learned a lot again since I've done some of the things the first time.
I'll post it here when it passed (my own) QA and I've finished a short description to be prepared for the new 'User Macros' list/board/whatever ;)
Stay tuned,
HS2

BTW: I don't want to get in conflict with your versions - any idea about a proper naming scheme ?

asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
Re: Open project file macro and new open local symbol macro
« Reply #3 on: November 19, 2007, 12:59:07 PM »
Oh.. it's getting messy. In general I'd like to keep single branch of both macros. They are simply too small to make several different versions. Also, you'll need changes that I made in ols3 to run opf3. I suggest that you pick changes from ols3 (diff ols2 ols3 - there are not so many of them) and merge them into your version of the macro. How about that?

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Open project file macro and new open local symbol macro
« Reply #4 on: November 20, 2007, 12:58:08 AM »
Ok Alex - I've checked the diffs and it should be pretty easy to merge/resolve the 'namespace' conflict.
Oh my - after I've finished the version which could handle a large number of tags better (in UI) I've realized that there is already a probably even better (undocumented) method available ...
Tested it and now I know that this is the way to go. It's really blazing fast even for large tree lists and also simplifies the code. This would speed up 'opf' as well. I'll send you an example howto use it after finishing the changes.
HS2
Edit: My bad - the super-fast method filters the caption only but this makes not much sense for 'ols' b/c we don't want to get argument list matches...
« Last Edit: November 20, 2007, 01:57:02 AM by hs2 »

asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
Re: Open project file macro and new open local symbol macro
« Reply #5 on: December 09, 2007, 10:03:29 AM »
Latest open_local_symbol release by hs2 from here
http://community.slickedit.com/index.php?topic=2245.30
has no conflicts with open_project_file macro. Therefore, open_project_file3 is void. Please find attached "without '3'" version of the macro. It also includes nice copyright notice ;D and distributed as hotfix (credit goes to hs2 ;D) From now on, please download this version of the macro.

myrkle

  • Community Member
  • Posts: 21
  • Hero Points: 1
Re: Open project file macro and new open local symbol macro
« Reply #6 on: December 14, 2007, 08:25:10 PM »
 I really like this macro, but it doesn't work as-is for me. It assumes that the files in the project share a common root path with the project file. I keep my project files in a separate directory and so this doesn't work. For now I've hacked it to just prepend the drive letter part of the project file path to the file path.

asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
Re: Open project file macro and new open local symbol macro
« Reply #7 on: December 15, 2007, 11:34:36 AM »
I see. Thanks for reporting this. Give me few days and I'll fix it for you.

asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
Re: Open project file macro and new open local symbol macro
« Reply #8 on: January 03, 2008, 12:31:11 PM »
Finally got some time to work on it. Sorry for delay.
I think I fixed the issue you reported. Please give this new version a try.
Thanks.
In general, this is the latest version of the macro and is the version that should be downloaded.

myrkle

  • Community Member
  • Posts: 21
  • Hero Points: 1
Re: Open project file macro and new open local symbol macro
« Reply #9 on: January 04, 2008, 07:44:21 PM »
I gave the new version a try but it doesn't fix the issue.


The problem is here: (~line 355)
Code: [Select]
        name = _TreeGetCaption( index );
        proj = _project_get_filename();
        proj = strip_filename( proj, "N" );
        name = proj :+ name;

This assumes the path part of the project filename can be prepended to the relative path of the file to get the full path. The problem is, my project files are not in some parent directory of the source files. So, for example:

My project file is here: c:\projects\oob
My source files are here: c:\source\test\test.cpp

The code above tries to open: c:\projects\oob\/source/test/test.cpp

Thanks!


asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
Re: Open project file macro and new open local symbol macro
« Reply #10 on: January 06, 2008, 01:51:18 PM »
You are right. My tests were incomplete and I missed this point. I fixed this in a new version and hope that it will work now. Sorry for the inconvenience and thanks a lot for pointing this spot.

This version supersede any previous versions of the macro.

myrkle

  • Community Member
  • Posts: 21
  • Hero Points: 1
Re: Open project file macro and new open local symbol macro
« Reply #11 on: January 10, 2008, 01:43:18 AM »
It works perfectly now!

Thanks for fixing this and creating this very useful macro in the first place!

asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
Re: Open project file macro and new open local symbol macro
« Reply #12 on: January 21, 2008, 02:54:43 PM »
I found another bug in the code. Sometimes, depending on the slickedit's current directory, it wouldn't open the file. I fixed it and it should now work well. Please use this version if you experience the problem I described.

This version supersedes any previous versions of the macro.

asandler

  • Senior Community Member
  • Posts: 303
  • Hero Points: 27
Re: Open project file macro and new open local symbol macro
« Reply #13 on: January 25, 2008, 08:22:00 PM »
Finally, as promised, my macros for SlickEdit web-page:
http://www.alexandersandler.net/stuff/software-projects/slickedit-macros

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Open project file macro and new open local symbol macro
« Reply #14 on: January 25, 2008, 10:32:42 PM »
Congratulations - it's an absolutely great web site ! HP++
HS2