add copy function
This commit is contained in:
parent
96ffcae953
commit
30f2585d33
|
|
@ -67,6 +67,11 @@ def parse_commands(text):
|
||||||
context_query = '\n\nThe following is context provided by the user:\n'
|
context_query = '\n\nThe following is context provided by the user:\n'
|
||||||
context_query += get_string_from_clipboard() + '\n'
|
context_query += get_string_from_clipboard() + '\n'
|
||||||
return text.split('/clipboard ')[1] + context_query
|
return text.split('/clipboard ')[1] + context_query
|
||||||
|
case '/copy':
|
||||||
|
blocks = extract_code_block(history[-1]['content'])
|
||||||
|
if len(blocks):
|
||||||
|
copy_string_to_clipboard(blocks[0])
|
||||||
|
return True
|
||||||
case '/exit':
|
case '/exit':
|
||||||
exit()
|
exit()
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue