Recent

Author Topic: Can't copy Lazarus help text  (Read 18969 times)

BobS

  • Full Member
  • ***
  • Posts: 153
Can't copy Lazarus help text
« on: October 08, 2015, 02:17:41 am »
Windows 8.1:

When I use the Lazarus help system, I select some text (say a procedure name) and right click and choose copy or hit Ctrl-C go to the editor and try to paste to find the clipboard does not have what I just copied.

Only way I've found is to go to the individual chm (or pdf) files from which I can copy fine.

Closing and restarting the help system and then Lazarus made no difference.

Tried searching for people with a similar problem couldn't find any:
any ideas?

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Can't copy Lazarus help text
« Reply #1 on: October 08, 2015, 05:44:20 am »
A little more:
Some things can be copied like certain parts of the text, but things like procedure names can't. 

I know it not that important but wondered if anyone else is having this problem?

A detailed example:
  Open Lazarus help, in search type 'arctan' and open the help page on the arctan function.  Now select 'arctan' and copy it.  Now go somewhere and try to paste.
At least on my system with 1.4.2 32bit on Windows 8.1 64bit this does not work. 
You can however go into the rtl.chm routines by unit/math/arctan and copy the definition there.

So seems like something about how the help program is placing certain types of text seems to be killing the copy ability.

BitBangerUSA

  • Full Member
  • ***
  • Posts: 183
Re: Can't copy Lazarus help text
« Reply #2 on: October 08, 2015, 05:57:17 am »
i see the same in Windows 10 and Lazarus 1.4.2 - if you have used CTRL-C and CTRL-V
the shortcut (CTRL-C) doesn't work - but right-clicking after selecting the text in the help app does copy and then CTRL-V works as expecting in another app.

additional - same-same issue in Windows 7 and Lazarus 1.4.0
« Last Edit: October 08, 2015, 06:42:58 am by BitBangerUSA »
Lazarus Ver 2.2.6 FPC Ver 3.2.2
Windows 10 Pro 64-bit

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Can't copy Lazarus help text
« Reply #3 on: October 08, 2015, 08:29:30 am »
I remember having this problem a little while ago, it even applies to the source editor (can't ctrl+c - ctrl+v, but copy - paste context menu works). Probably a bug in 1.4.2, try with 1.4.4. One thing for sure, it no longer exists in current trunk.

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Can't copy Lazarus help text
« Reply #4 on: October 08, 2015, 08:41:27 am »
Good to know, though in 8.1 right click-copy doesn't work either.  I looked through the bug tracker before posting but didn't see anything, oh well.  At least I'm not going crazy.  Thanks BitRanger, Lele.

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Can't copy Lazarus help text
« Reply #5 on: October 08, 2015, 09:03:24 am »
1.4.4. has the same bug.  I can wait for the next stable release (for some reason today I can't seem to type anything right which is why I was using copy paste :( ).

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4468
  • I like bugs.
Re: Can't copy Lazarus help text
« Reply #6 on: October 08, 2015, 10:54:33 am »
Tried searching for people with a similar problem couldn't find any:
any ideas?

There is a bug report:
  http://bugs.freepascal.org/view.php?id=21935
Unfortunately nobody is actively investigating it now. The TurboPower component is nasty.
Ideas? Well, somebody should dive into the code and fix it.

Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Can't copy Lazarus help text
« Reply #7 on: October 09, 2015, 10:27:55 pm »
Lele says the problem is gone in current trunk.  I'll see if I can get it tonight and verify if it is still a problem or not under 8.1 (it's been a long time since I used a repository ;) ).  If it is I'll see if I can look into it once I'm finished with my current project which is about getting me back up to speed on Lazarus/FPC.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Can't copy Lazarus help text
« Reply #8 on: October 09, 2015, 11:23:10 pm »
Just uploaded a patch to the issue cited by Juha which catches the CTRL+C and CTRL+INSERT key presses and copies the selected text to the clipboard. Seems to work for me although I am not 100% sure if the patch is at the correct location.

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Can't copy Lazarus help text
« Reply #9 on: October 10, 2015, 09:10:41 am »
Ok I downloaded 1.5 and made it.  Still the same problem.  So I applied the patch suggested by wp and remade it and still the same problem... I doubled checked I'd applied the patch in the correct place.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Can't copy Lazarus help text
« Reply #10 on: October 10, 2015, 11:56:42 am »
Did you manually recompile lhelp? I think the IDE does not do this if it finds an exe already.

[EDIT] I see now that selection is limited to one paragraph only...
« Last Edit: October 10, 2015, 12:23:10 pm by wp »

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Can't copy Lazarus help text
« Reply #11 on: October 10, 2015, 06:32:24 pm »
I checked the time it was recompiled.

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Can't copy Lazarus help text
« Reply #12 on: October 10, 2015, 06:43:03 pm »
Since right click and choose copy doesn't work either, I'm wondering if the problem is in lhelp.  I'd need to watch in the debugger to figure out exactly what's going on.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Can't copy Lazarus help text
« Reply #13 on: October 10, 2015, 07:56:17 pm »
Can you open lhelp (it is in lazarus/components/chmhelp/lhelp) and load any chm file? Select some text and copy it to the clipboard, then paste it somewhere. Does it work? It does work here (Laz 1.5/fpc2.6.4, Laz 1.4.4/fpc2.6.4, Win 7)...

Is the patch applied correctly? Load lazarus/components/turbopower_ipro/iphtml.pas. The patch added the two lines marked as "new" near the bottom of TIpHtmlInternalPanel.KeyDown:

Code: Pascal  [Select][+][-]
  1. ...
  2.   end
  3.   else if ((key = VK_C) or (key = VK_INSERT)) and (ssCtrl in Shift) then  // <--- new
  4.     FHyper.CopyToClipboard                                                // <--- new
  5.   else if (key = VK_A) and (ssCtrl in Shift) then
  6.     FHyper.SelectAll
  7.   else
  8.     inherited KeyDown(Key, Shift);
  9. end;  

Not 100% sure, but I see from the other key processing a bit up in the code that there should be a "Key := 0" after "FHyper.CopyToClipboard" to inhibit further processing of the key press. Could you try that? (Of course, add a "begin"/"end" to enclose the "CopyToClipboard" and the "Key := 0").

paweld

  • Hero Member
  • *****
  • Posts: 1003
Re: Can't copy Lazarus help text
« Reply #14 on: October 10, 2015, 08:44:39 pm »
turbopower_ipro has problem with copy data from html-table.
A detailed example:
  Open Lazarus help, in search type 'arctan' and open the help page on the arctan function.  Now select 'arctan' and copy it.  Now go somewhere and try to paste.

arctan page html-source:
Code: HTML5  [Select][+][-]
  1. <h1>arctan</h1>
  2. <p>Calculate inverse tangent</p>
  3. <h2>Declaration</h2>
  4. <p>Source position: mathh.inc line 73</p>
  5. <table cellpadding="0" cellspacing="0">
  6. <td><p><tt><span class="code"><span class="kw">function</span> arctan<span class="sym">(</span></span></tt></p></td>
  7. </tr>
  8. <tr>
  9. <td><p><tt><span class="code">&nbsp;&nbsp;d<span class="sym">: </span><a href="../system/valreal.html">ValReal</a></span></tt></p></td>
  10. </tr>
  11. <tr>
  12. <td><p><tt><span class="code"><span class="sym">):</span><a href="../system/valreal.html">ValReal</a><span class="sym">;</span></span></tt></p></td>
  13. </tr>
  14. <h2>Description</h2>
  15. <p><var>Arctan</var> returns the Arctangent of <var>X</var>, which can be any Real type. The resulting angle is in radial units. </p>
« Last Edit: October 10, 2015, 08:48:34 pm by paweld »
Best regards / Pozdrawiam
paweld

 

TinyPortal © 2005-2018