Skip to content

Commit

Permalink
Merge pull request #174 from pieces-app/fix-export
Browse files Browse the repository at this point in the history
Fix export
  • Loading branch information
bishoy-at-pieces authored Sep 18, 2024
2 parents 2c19bb8 + 384d9b7 commit 0bc7407
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions assets/export_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
- Tab Trigger: <a href='subl:pieces_edit_snippet_sheet {{"field":"trigger","sheet_id":{sheet_id}}}'>{trigger}</a>
- Description: <a href='subl:pieces_edit_snippet_sheet {{"field":"description","sheet_id":{sheet_id}}}'>{description}</a>
- Description: <a href='subl:pieces_edit_snippet_sheet {{"field":"asset_description","sheet_id":{sheet_id}}}'>{description}</a>
- Scope: <a href='subl:pieces_edit_snippet_sheet {{"field":"scope","sheet_id":{sheet_id}}}'>{scope}</a>
Expand Down Expand Up @@ -116,7 +116,7 @@ def run(self,sheet_id):
kwargs={
"asset_id":instance.asset_id,
"content":instance.content,
"description":instance.asset_description,
"asset_description":instance.asset_description,
"scope":instance.scope,
"trigger":instance.trigger
}
Expand All @@ -138,10 +138,11 @@ def run(self,field:str,sheet_id):
field (str):
- trigger
- scope
- description
- asset_description
- content
- asset_id
"""
print(field)
self.field = field
self.instance = PiecesExportAssetToSublimeCommand.get_instance(sheet_id)
self.window.show_input_panel(f"{field.title()}:", getattr(self.instance,field), self.on_done, None, None)
Expand Down
5 changes: 4 additions & 1 deletion copilot/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ def run(self,context,pieces_asset_id=None,context_remove=None):
PiecesSettings.api_client.copilot.context.assets.append(BasicAsset(pieces_asset_id))

def is_enabled(self):
return sublime.active_window().active_view().settings().get("PIECES_GPT_VIEW",False) and PiecesSettings.is_loaded
v = sublime.active_window().active_view()
if v:
return v.settings().get("PIECES_GPT_VIEW",False) and PiecesSettings.is_loaded

def input(self,args):
return PiecesContextInputHandler()

Expand Down

0 comments on commit 0bc7407

Please sign in to comment.