Skip to content

Add option to copy only part of the code #1

@polyrand

Description

@polyrand

This would be useful to add examples inside the code snippet, for example:

"""tag1 array flatten tag2 numpy tag3""" 

import numpy as np

matrix = np.array([[1, 2, 3],
                               [4, 5, 6],
                               [7, 8, 9]])
#pasteon
matrix.flatten()  # array([1, 2, 3, 4, 5, 6, 7, 8, 9])
#pasteoff

When ctrl-p (or any key is finally chosen) is pressed, only the code between #pasteon and #pasteoff will be copied to clipboard, that way you can have an example inside the snippet but without having it copied to the clipboard.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions