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.
IDE : Paste as Comment ( Ctrl + Shift + V )
IDE : Paste as Comment ( Ctrl + Shift + V )
The PureBASIC Archives:
- GitHub Repo + Wiki + Website
- https://tajmone.github.io/purebasic-archives
- PB Sourcecode Highlighters for Websites and Documents
- Dräc OOP Tutorial reprint
- Pandoc2BBCode: Post on PB Forums from Markdown, ReST, Docx, and other formats…
Re: IDE : Paste as Comment ( Ctrl + Shift + V )
+1. That's all about stupid IDE behavior with any text (auto-formatting is applied just after paste or typing, but should be applied only after user switched to another line, or optionally by demand)
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
Re: IDE : Paste as Comment ( Ctrl + Shift + V )
Thanks for the link @kenmo! didn't realize some users' workarounds were already available — but doesn't surprise me either, this should be a common problem to all of us IDE users.kenmo wrote:Some user implementations are here:
http://www.purebasic.fr/english/viewtop ... as+comment
The PureBASIC Archives:
- GitHub Repo + Wiki + Website
- https://tajmone.github.io/purebasic-archives
- PB Sourcecode Highlighters for Websites and Documents
- Dräc OOP Tutorial reprint
- Pandoc2BBCode: Post on PB Forums from Markdown, ReST, Docx, and other formats…
Re: IDE : Paste as Comment ( Ctrl + Shift + V )
Gonna give it a +1 as well.
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
Re: IDE : Paste as Comment ( Ctrl + Shift + V )
+1
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
Re: IDE : Paste as Comment ( Ctrl + Shift + V )
As a side note...
I've been using Michael's code since he posted it on the forum and it works so flawlessly that I was starting to think it was part of the IDE. {grin}
Thanks Michael
I've been using Michael's code since he posted it on the forum and it works so flawlessly that I was starting to think it was part of the IDE. {grin}
Thanks Michael
- It was too lonely at the top.
System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem