-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add ability to print unsaved text #31
Comments
I have reproduced this behaviour. I don't use a file directly unless you print a document other than the active document using the file explorer. The problem you are seeing is a consequence of the way VS Code manages menus and toolbars -- it needs to know the file type, and this is inferred from the file extension, which depends on the file existing. Think through the behaviour you expect in the absence of a file type, and we can discuss supporting your use case. Without type you won't get syntax colouring. This is why I usually create a file called junk.sql and paste snippets of SQL into it, then select them and print the selection. This gives me syntax colouring. Currently this produces line numbers matching the junk file unless I turn off numbering. If you do it a lot and you don't want numbering I could add a context menu item |
It should print without syntax coloring by default (i.e. Plain Text). If I want language support such as syntax coloring, then I just click "Plain Text" in the lower right corner next to the smiley face and select the desired language. I think by default unsaved buffers ought to print without line numbers. Perhaps a context menu option or a default setting would be good. |
I'm currently in the middle of internationalising the extension so it may be a while before I have time to deal with this. I have a feeling it's one of those small things with far-reaching effects -- I will no longer be able to let VS Code manage the UI automatically. |
I think I may have a solution. Would you mind testing 0.7.5 and if it solves your problem let me know by closing this issue. |
Perfect - thanks! |
It appears that saving a file is required before the print icon becomes available. However, there are times when I simply need to print a temporary snippet of text (e.g. sql query results, error message) and I don't need nor want to save the file. If a file on disk is absolutely necessary, perhaps it can save it to a temp file that it can delete later.
The text was updated successfully, but these errors were encountered: