-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New command: "Cut to New File" #108
Comments
Good idea. Funny enough, I implemented something similar as a one off solution for someone before. I'll try to get this implemented soon! |
@nemoDreamer, Sorry for taking so long on this. Been a bit busy lately. Got most of the functionality implemented last night, but hit an issue with multiple selections. Anyways, just wanted to give an update. |
BRILLIANT! The project I really needed this for got put on hold for a few weeks, so I'm fine! |
I've just pushed 1.4.0 which has this feature! Let me know how it works for you. The small thing I did, that I should have toggled was opening the specified file. If you find that bothersome, please let me know. Thanks for using AdvancedNewFile! |
On OS X 10.9.5 and ST 2.0.2 I am getting the following traceback in the console on every invocation of this command: Traceback (most recent call last):
File "./sublime_plugin.py", line 339, in run_
File "./advanced_new_file/commands/cut_to_file.py", line 16, in run
Boost.Python.ArgumentError: Python argument types in
View.add_regions(View, str, RegionSet)
did not match C++ signature:
add_regions(SP<TextBufferView>, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, boost::python::list, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >)
add_regions(SP<TextBufferView>, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, boost::python::list, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, int)
add_regions(SP<TextBufferView>, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, boost::python::list, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >)
add_regions(SP<TextBufferView>, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, boost::python::list, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, int) |
@nemoDreamer Sublime uses a bundled Python which you can see the version of in the Sublime console. In my case with ST2 it is: >>> import sys
>>> sys.version
'2.6.8 (unknown, Mar 9 2014, 22:16:00) \n[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]' What Sublime version are you on? |
Woops, looks like one of those undocumented API changes that happened between ST2 and ST3. I generally program for ST3, since that's what I use. But the plugin doesn't really utilize any new features, I'll keep in compatible with both versions. Will try to push a fix later today. |
@nemoDreamer and @jpcirrus I've pushed a new version (1.4.1) that should fix the issue. Please let me know if you have any other issues! |
I confirm this is now working on ST2. Many thanks @skuroda |
Sorry for the delay: working for me too! And I like the fact that you open the new file: makes sense so you can add a header block, etc... Thanks so much! |
Haha google? Just kidding, honestly I don't have anything set up to accept donations. Glad you enjoy the plugin! |
I love the new "Copy Current File" command! That's why I'm suggesting a feature for this package that I haven't been able to find for a stand-alone package:
"Cut to New File"
Enhanced functionality
Rationale
This is a workflow commonly used while refactoring monolithic files, to split modules, CSS groups, etc... into a more sensible folder/file hierarchy.
What do you think?
The text was updated successfully, but these errors were encountered: