Skip to content
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

Open the project #43

Closed
wants to merge 1 commit into from
Closed

Open the project #43

wants to merge 1 commit into from

Conversation

audinue
Copy link

@audinue audinue commented Mar 15, 2017

Open the newly created project in new window instead of opening its directory.

Open the newly created project in new window instead of opening its directory.

__ST3 = int(sublime.version()) >= 3000
if __ST3:
from STProjectMaker.configuration import ConfigurationReader
else:
from configuration import ConfigurationReader

def subl(args=[]):
# learnt from SideBarEnhancements
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a proper doc string here.

@@ -225,7 +240,8 @@ def customize_project(self):
self.rename_files()
self.find_project_file()
self.read_configuration()
self.window.run_command("open_dir", {"dir":self.project_path})
subl(["-n", self.project_file])
#self.window.run_command("open_dir", {"dir":self.project_path})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment.

@@ -6,13 +6,28 @@
import sublime
import sublime_plugin

import subprocess
Copy link
Collaborator

@pykong pykong Mar 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may also use the inbuilt exec module.
I believe it is cleaner to stick to ST's own modules, even if they only wrap the same python core modules.

Use like:

sublime.active_window().run_command("exec", args)

See: http://docs.sublimetext.info/en/latest/reference/commands.html?highlight=commands


__ST3 = int(sublime.version()) >= 3000
if __ST3:
from STProjectMaker.configuration import ConfigurationReader
else:
from configuration import ConfigurationReader

def subl(args=[]):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name should be more descriptive. What about open_project_window?
The args should default to None, not a list object here.
args should not be named other than args, as the convention reserves *args for overloading.

@pykong
Copy link
Collaborator

pykong commented Mar 14, 2018

@audinue Thank you for your effort out into this PR. I believe it is a great step forward to a better user experience! I left a couple of minor comments throughout the code. If you address those, we may proceed with merging.

@pykong
Copy link
Collaborator

pykong commented Mar 19, 2018

Closing in favor of fresh PR #53

@pykong pykong closed this Mar 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants