Forum > Editor

anything in the clipboard of MS Word shows up in my project file

(1/2) > >>

This is weird and I am wondering if anyone else has seen this. 

If I copy some code into MS Word so I can format it better for printing, that text will later show up in my project file next time I open the IDE and load the project, even is Word is closed.

It took me a while to narrow this down and I am still not sure I have it figured out exactly, but here is what I did the most recent time this happened.

I opened the Lazarus IDE, and my most recent project loaded
I close all the open files
I created a new project and entered some code. I compiled it, ran it.
I copied that code into MS Word, reformatted it, printed it, shut Word down.
I closed the IDE, saving the new project as a "temp.lpr" project.
I clicked directly on my primary project (not the temp.lpr) and loaded it in the IDE

All the main project code was there, but what I copied into MS word was inserted into the main project. I have to let the complier find where it was inserted (to get the error messages to locate it) and delete it to get the code to compile.  Maybe it has nothing to do with Word, but rather with the copy operation. To copy, I am highlighting the text and using Ctrl-C and then pasting it into Word with Ctrl-V. 

Do the Ctrl-C and Ctrl-V keys do something different in the IDE causing this, or is something going on with MS Word and Lazarus?

Totally confused here.

 - Bill


I use Ctrl+C and Ctrl+V without problem with LibreOffice Write, PSPad or directly from Firefox.

Perhaps Word insert some special formatting characters?


Cannot reproduce based on your description.

Since you use Word, you must be on Windows. Which version? And which version of Word?
Next version question: Which version of Lazarus? Of FPC? 32bit or 64 bit?

If I understand correctly, the only copy operation goes from the IDE to Word? You copy a section of your source code? Just to make sure you do not make any intentional paste operation into the IDE? And within Word? You do only the only initial paste or any other copy/paste operations?

When I do a Ctrl+C with some highlighted text in the IDE, and paste it into word (with Ctrl+V), my clipboard viewer ( shows me that the clipboard contains the formats

49991 - Application/X-Laz-SynEdit-Tagged

I would say: This is nothing special: When I copy some text into the clipboard from Notepad++ I get the same formats, except for the Lazarus specific 49991.

You say: "I clicked directly on my primary project (not the temp.lpr) and loaded it in the IDE". Does this mean that you double-click on the project.lpr (or .lpi) file in the Windows explorer? Maybe this is a difference because I cannot do this since I have so many parallel versions of Lazarus. Does the error also appear when you first open the IDE and then open the project in the "File" menu or the recently-used files menu?

Since you had closed all main project units in one of the previous steps, the project now opens will all forms closed. Same with you? Do you open any files here again? Or do you simply start compiling and notice the broken source code now?

Do you have any utility apps running which create a "Ctrl+V" on special occasions?

Thanks for the thoughtful reply.  I will try to do some more tests tomorrow and nail things down so I can answer your question.  I first want to back up all my .Lxx files and put them in a different folder so this doesn't happen again...just in case.

I was hoping that it was something easily identifiable, but that would have been lucky.

I am running Win10 Pro and I think it is Word 2016.  It's the latest download from Lazarus and I am running in console mode with "simple projects"

It is almost as if whatever is in the Word clipboard is getting dumped into my Lazarus file. 

I have more information.

It does  not appear to be Word causing this. It happens when I use a ^F in the IDE to find something.  I went searching for the string "note:=--"

The IDE found the string, I did not use any paste operations.  I went back to compile my program and the "note:--" was in the middle of a procedure (and obviously the compile failed).  This is especially odd because I searched for some other strings before this and they did not show up. I must be doing something to cause this, but I can't figure out what it is.

One thing that was different, for the previous searches, I typed the search term in the search box. For the last search, I highlighted the "note:--" string so it would automatically show up in the search box.  Now that I think more about it, when it was happening with MS Word, I was highlighting also.

Could selecting the area have something to do with this paste operation I don't think I am causing?

Thanks for your insight

- Bill


[0] Message Index

[#] Next page

Go to full version