IDE : Paste as Comment ( Ctrl + Shift + V )
Posted: Fri Jun 10, 2016 10:38 am
When pasting in the IDE some non-code text, it gets "cleaned up" as if was source code (ie: words like "not", "and", "if", "or", ecc., get capitalized as if they were keywords: "Not", "And", "If", ecc.). Needless to say, many PB keywords match common use English words.
This is troublesome when one wishes to paste some text destined to become a comment, or split into strings, and so on. This is especially true in the latter case: if one needs to paste some text into a string definition, pasting inside quotes is not enough if pasted text contains newline characters -- the IDE will syntax-cleanup all text on newlines. Presently, one is forced to rely on some external editors to manually enlclose all text lines either in quotes or in comments.
Since the IDE currently doesn't assign any actions to Ctrl + Shift + V key-combination, it could be employed to paste clipboard contents as comments, ie: add a leading semicolon and space "; " to the each line of the raw pasted text. Alternatively, when the IDE sees that the cursor is inside double quotes, it could assume user wants to paste a string definition and paste clipboard contents as an escaped string definition, ie: converting newline characters to \n and double quotes to \", ecc. Or paste-as-string could be another pasting mode altogether, via Ctrl + Alt + V, auto-magically enclosing escaped pasted text within ~"…". Whatever...
In many applications Ctrl + Shift + V is already the standard for alternative pasting modes, so it should look familiar to most users.
This is troublesome when one wishes to paste some text destined to become a comment, or split into strings, and so on. This is especially true in the latter case: if one needs to paste some text into a string definition, pasting inside quotes is not enough if pasted text contains newline characters -- the IDE will syntax-cleanup all text on newlines. Presently, one is forced to rely on some external editors to manually enlclose all text lines either in quotes or in comments.
Since the IDE currently doesn't assign any actions to Ctrl + Shift + V key-combination, it could be employed to paste clipboard contents as comments, ie: add a leading semicolon and space "; " to the each line of the raw pasted text. Alternatively, when the IDE sees that the cursor is inside double quotes, it could assume user wants to paste a string definition and paste clipboard contents as an escaped string definition, ie: converting newline characters to \n and double quotes to \", ecc. Or paste-as-string could be another pasting mode altogether, via Ctrl + Alt + V, auto-magically enclosing escaped pasted text within ~"…". Whatever...
In many applications Ctrl + Shift + V is already the standard for alternative pasting modes, so it should look familiar to most users.