[Lazarus] Lazarus code editor improvement?

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
When I am working on a multi-unit application I very often want to
check the implementation of a function which is called from somewhere.
So I right click the function name in the code line and select
 "Find Declaration of <function name>"
This brings me invariably to the interface section function
declaration from which I have to jump to the actual implementation
(Ctrl-Shift-Downarrow).

I would like to avoid this 2-step process if possible by having a
second right-click command: "Find Implemnentation of <function name>"

Is this possible already (but hidden in the standard config of
Lazarus) or is it a new feature noone has requested before?

When I work in other IDE:s for different languages this is a common
feature I use a lot when troubleshooting....


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
Bo Berglund via lazarus <[hidden email]> schrieb am Sa., 2. Nov. 2019, 11:10:
Is this possible already (but hidden in the standard config of
Lazarus) or is it a new feature noone has requested before?

Tools -> Options -> Codetools -> General -> Jump directly to method body

Regards, 
Sven 

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sat, 02 Nov 2019 11:10:32 +0100, Bo Berglund via lazarus
<[hidden email]> wrote:

I just found another strange IDE "feature":

If I am in a tab to the right (not the left-most tab) with the cursor
anywhere in the code and I want to add say a { character, I need to
press AltGr (the right hand Alt key) and the 7 key. This normally
results in a { character being output at the cursor.

But in Lazarus the focus immediately shifts to a different tab when
AltGr is pressed!!
How did that happen? All European languages to my knowledge uses the
AltGr key to compose special chars like {[]}\|~
Why is Lazarus stealing the AltGr key?
 

--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
Bo Berglund via lazarus <[hidden email]> schrieb am Sa., 2. Nov. 2019, 14:59:
On Sat, 02 Nov 2019 11:10:32 +0100, Bo Berglund via lazarus
<[hidden email]> wrote:

I just found another strange IDE "feature":

If I am in a tab to the right (not the left-most tab) with the cursor
anywhere in the code and I want to add say a { character, I need to
press AltGr (the right hand Alt key) and the 7 key. This normally
results in a { character being output at the cursor.

But in Lazarus the focus immediately shifts to a different tab when
AltGr is pressed!!
How did that happen? All European languages to my knowledge uses the
AltGr key to compose special chars like {[]}\|~
Why is Lazarus stealing the AltGr key?

Check the key mappings in Lazarus' options. 

Regards, 
Sven 

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
On Sat, 2 Nov 2019 15:04:15 +0100, Sven Barth via lazarus
<[hidden email]> wrote:

>Bo Berglund via lazarus <[hidden email]> schrieb am Sa., 2.
>Nov. 2019, 14:59:
>
>> On Sat, 02 Nov 2019 11:10:32 +0100, Bo Berglund via lazarus
>> <[hidden email]> wrote:
>>
>> I just found another strange IDE "feature":
>>
>> If I am in a tab to the right (not the left-most tab) with the cursor
>> anywhere in the code and I want to add say a { character, I need to
>> press AltGr (the right hand Alt key) and the 7 key. This normally
>> results in a { character being output at the cursor.
>>
>> But in Lazarus the focus immediately shifts to a different tab when
>> AltGr is pressed!!
>> How did that happen? All European languages to my knowledge uses the
>> AltGr key to compose special chars like {[]}\|~
>> Why is Lazarus stealing the AltGr key?
>>
>
>Check the key mappings in Lazarus' options.
>

Nothing to see there (don't even know how the AltGr key would be
listed).
But now I have tested all threee versions I have on the RPi4 (2.0.2,
2.0.4 and 2.0.6) and all of them do this...

So I started my 2.0.4 on the Windows7 laptop (that is where I started
the console project), and this does NOT happen there. No tab switching
just inserting the correct characters.

Also started a text editor on the RPi4 and typed in my commands there
to create the special chars. Worked like a charm. No problems there at
all.

So it seems like Lazarus on Raspbian (maybe also on Debian in general)
will hook into the AltGr key and do something unexpected with it.
The fact that I am using RealVNC to access the desktop from Windows
does not really matter because then it would be a problem also in text
editor outside of Lazarus, which it isn't.

Right now in RPi4 I have to use a text editor window from which I can
copy the needed special chars and paste them into Lazarus since
Lazarus itself is unable to handle them correctly...

Funny note:
If I am on the leftmost tab in Lazarus on RPi4, then I can compose the
special chars just fine...
So another workaround would be to move the tab holding the file to
edit to the leftmost position before editing...


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
On 02/11/2019 15:34, Bo Berglund via lazarus wrote:

> On Sat, 2 Nov 2019 15:04:15 +0100, Sven Barth via lazarus
> <[hidden email]> wrote:
>
>> Bo Berglund via lazarus <[hidden email]> schrieb am Sa., 2.
>> Nov. 2019, 14:59:
>>
>>> If I am in a tab to the right (not the left-most tab) with the cursor
>>> anywhere in the code and I want to add say a { character, I need to
>>> press AltGr (the right hand Alt key) and the 7 key. This normally
>>> results in a { character being output at the cursor.
>>>
>>> But in Lazarus the focus immediately shifts to a different tab when
>>> AltGr is pressed!!
>>> How did that happen? All European languages to my knowledge uses the
>>> AltGr key to compose special chars like {[]}\|~
>>> Why is Lazarus stealing the AltGr key?
>>>
>> Check the key mappings in Lazarus' options.
>>
> Nothing to see there (don't even know how the AltGr key would be
> listed).
> But now I have tested all threee versions I have on the RPi4 (2.0.2,
> 2.0.4 and 2.0.6) and all of them do this...
>
Alt - n (1-9) is "goto source editor n" (switch to tab n)

Why this triggers on altgr for you, I am not sure
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
On Sat, 2 Nov 2019 15:42:54 +0100, Martin Frb via lazarus
<[hidden email]> wrote:

>Alt - n (1-9) is "goto source editor n" (switch to tab n)
>Why this triggers on altgr for you, I am not sure

OK, but then where in Key Mappings do I find it so I can disable it?
It is very confusing for me not having used these before.
I go to Tools/Options/Editor/Key Mappings
And here I find a bewildering number of functions...

SourceNotebookCommands/GoToPriorEditor is set to use Ctrl+Shift+Tab

And this does exactly what the AltGr key by itself does, except it
wraps around from the first tab to the last (rightmost) when used in
the leftmost tab. AltGr does not do that, it stops at he leftmost tab.

Very confusing....


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
On 02/11/2019 16:10, Bo Berglund via lazarus wrote:
> On Sat, 2 Nov 2019 15:42:54 +0100, Martin Frb via lazarus
> <[hidden email]> wrote:
>
>> Alt - n (1-9) is "goto source editor n" (switch to tab n)
>> Why this triggers on altgr for you, I am not sure
> OK, but then where in Key Mappings do I find it so I can disable it?
> It is very confusing for me not having used these before.
> I go to Tools/Options/Editor/Key Mappings
> And here I find a bewildering number of functions...
You can search for the name (left filter edit).  Though there is a space
"Go to source editor"
Or you can search by key (button "Find Key combination")

In this case the entries are in "Source Notebook commands" if you look
at the main tree nodes.


> SourceNotebookCommands/GoToPriorEditor is set to use Ctrl+Shift+Tab
>
> And this does exactly what the AltGr key by itself does, except it
> wraps around from the first tab to the last (rightmost) when used in
> the leftmost tab. AltGr does not do that, it stops at he leftmost tab.
>
I have no idea what your alt-gr key does....

You mention using  RealVNC in another mail.

IIRC there were some very strange key effects reported with vnc in the
past (no idea if that applies to RealVNC).
 From distant memory, vnc sends control keys with a timestamp that does
not match the interpretation that I would have from the doc of this
field.... That said I have no idea if vnc is right or not.
There is an argument that it works with other apps, but that is void,
because other apps may not use this (timestamp) field at all, and then
if it was wrong they would ignore that. Not sure what happened with
regards to this entire story.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 11/2/2019 7:42 AM, Martin Frb via lazarus wrote:
> Alt - n (1-9) is "goto source editor n" (switch to tab n)
>
> Why this triggers on altgr for you, I am not sure

I am almost certain that this is an issue with the access VNC, and would
not occur on the RPi if you connect a keyboard to it and test it thus
directly...

Ralf


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Martin Frb via lazarus <[hidden email]> schrieb am Sa., 2. Nov. 2019, 16:29:
You mention using  RealVNC in another mail.

IIRC there were some very strange key effects reported with vnc in the
past (no idea if that applies to RealVNC).
 From distant memory, vnc sends control keys with a timestamp that does
not match the interpretation that I would have from the doc of this
field.... That said I have no idea if vnc is right or not.
There is an argument that it works with other apps, but that is void,
because other apps may not use this (timestamp) field at all, and then
if it was wrong they would ignore that. Not sure what happened with
regards to this entire story.

I myself had reported something similar with VNC, so it's indeed likely to be the culprit. 

Regards, 
Sven 

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list


On Sat, 2 Nov 2019, Sven Barth via lazarus wrote:

> Martin Frb via lazarus <[hidden email]> schrieb am Sa., 2.
> Nov. 2019, 16:29:
>
>> You mention using  RealVNC in another mail.
>>
>> IIRC there were some very strange key effects reported with vnc in the
>> past (no idea if that applies to RealVNC).
>>  From distant memory, vnc sends control keys with a timestamp that does
>> not match the interpretation that I would have from the doc of this
>> field.... That said I have no idea if vnc is right or not.
>> There is an argument that it works with other apps, but that is void,
>> because other apps may not use this (timestamp) field at all, and then
>> if it was wrong they would ignore that. Not sure what happened with
>> regards to this entire story.
>>
>
> I myself had reported something similar with VNC, so it's indeed likely to
> be the culprit.

Yes. I've found Lazarus or any LCL app to be unworkable with VNC :(

Michael.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
On Sat, 2 Nov 2019 17:46:09 +0100 (CET), Michael Van Canneyt via
lazarus <[hidden email]> wrote:

>> I myself had reported something similar with VNC, so it's indeed likely to
>> be the culprit.
>
>Yes. I've found Lazarus or any LCL app to be unworkable with VNC :(

Yes, now that you mention it...
I had a similar situation several years ago when I was using TightVNC
on the RPi to access Lazarus. At that time nothing at all happened
when I tried to enter the characters {[]}\|.

So I created a text document with these chars and had it open when I
programmed so I could go there and select-and copy the wanted char to
be pasted into the editor.
If I remember correctly it was ONLY the code editor that ill behaved,
if I entered the characters into any other Lazarus window accepting
strings as parameter it worked OK.

And so it does now as well...
For example the search box in Object Inspector is OK with these
characters composed using the AltGr key.

So now I have connected a monitor to my RPi4 and a spare TV keyboard
with a mousepad to the RPi4 as well. When I use this to run a session
the problem does not appear any longer...

So indeed it is connected with VNC, but it also is connected with
Lazarus' code editor window. It seems like this is the only affected
window on the RPi, all others accept the composition key AltGr as part
of entering a special char.

I cannot use the direct connection, though, because I am heavily
depending on being able to copy stuff across between the two systems
and I also need to have access to my other tools on the Windows
computer. So I have to stick with VNC anyway and work around the
problem.

And back again to Lazarus 2.0.6...


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
On 03/11/2019 08:25, Bo Berglund via lazarus wrote:

> On Sat, 2 Nov 2019 17:46:09 +0100 (CET), Michael Van Canneyt via
> lazarus <[hidden email]> wrote:
>
>>> I myself had reported something similar with VNC, so it's indeed likely to
>>> be the culprit.
>> Yes. I've found Lazarus or any LCL app to be unworkable with VNC :(
> And so it does now as well...
> For example the search box in Object Inspector is OK with these
> characters composed using the AltGr key.
>
Native controls (edit/memo) may not be affected. But anything that
relies on LCL for keyhandling is.

You could write some editor macros, and assign them to keys that work.
ecChar('{');

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Am 03.11.2019 um 08:25 schrieb Bo Berglund via lazarus:

> On Sat, 2 Nov 2019 17:46:09 +0100 (CET), Michael Van Canneyt via
> lazarus<[hidden email]>  wrote:
>
>>> I myself had reported something similar with VNC, so it's indeed likely to
>>> be the culprit.
>> Yes. I've found Lazarus or any LCL app to be unworkable with VNC :(
> Yes, now that you mention it...
> I had a similar situation several years ago when I was using TightVNC
> on the RPi to access Lazarus. At that time nothing at all happened
> when I tried to enter the characters {[]}\|.
>
> So I created a text document with these chars and had it open when I
> programmed so I could go there and select-and copy the wanted char to
> be pasted into the editor.
> If I remember correctly it was ONLY the code editor that ill behaved,
> if I entered the characters into any other Lazarus window accepting
> strings as parameter it worked OK.
>
> And so it does now as well...
> For example the search box in Object Inspector is OK with these
> characters composed using the AltGr key.
>
> So now I have connected a monitor to my RPi4 and a spare TV keyboard
> with a mousepad to the RPi4 as well. When I use this to run a session
> the problem does not appear any longer...
>
> So indeed it is connected with VNC, but it also is connected with
> Lazarus' code editor window. It seems like this is the only affected
> window on the RPi, all others accept the composition key AltGr as part
> of entering a special char.
>
> I cannot use the direct connection, though, because I am heavily
> depending on being able to copy stuff across between the two systems
> and I also need to have access to my other tools on the Windows
> computer. So I have to stick with VNC anyway and work around the
> problem.
>
> And back again to Lazarus 2.0.6...
>
>

Please look at  issue 0030544 on https://bugs.freepascal.org. If I
remember correctly, Mattias eventually found the reason and fixed it.
Don't know why the problerm rearises...
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
On 11/3/2019 4:31 AM, Joe via lazarus wrote:
>
> Please look at  issue 0030544 on https://bugs.freepascal.org. If I
> remember correctly, Mattias eventually found the reason and fixed it.
> Don't know why the problerm rearises...

Going by the description (and interception of keycodes with and with out
VNC), it seems to be pretty clear that this seems to be an issue related
to VNC rather to Lazarus, so I am not sure what you could possibly fix,
beside maybe a single fringe case... :-\

I have seen similar, kind of random issues when using RealVNC on the
client (like when using it on my Mac) rather than TightVNC, which I use
for various reasons (like the file transfer option) on all my Windows
machines.

Ralf


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Bo Berglund via lazarus wrote:

> On Sat, 2 Nov 2019 15:42:54 +0100, Martin Frb via lazarus
> <[hidden email]> wrote:
>
>> Alt - n (1-9) is "goto source editor n" (switch to tab n)
>> Why this triggers on altgr for you, I am not sure
>
> OK, but then where in Key Mappings do I find it so I can disable it?
> It is very confusing for me not having used these before.
> I go to Tools/Options/Editor/Key Mappings
> And here I find a bewildering number of functions...
>
> SourceNotebookCommands/GoToPriorEditor is set to use Ctrl+Shift+Tab
>
> And this does exactly what the AltGr key by itself does, except it
> wraps around from the first tab to the last (rightmost) when used in
> the leftmost tab. AltGr does not do that, it stops at he leftmost tab.
>
> Very confusing....
>

It is. The Ctrl+Shift is (on windows) a alternative key combo for AltGr,
meant for keyboards without AltGr.

So if, what I read further on this thread, use some remoting tools, it
can be that the AltGr is translated to Ctrl+Shift by those tools.

Marc

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus code editor improvement?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Le 03/11/2019 à 08:25, Bo Berglund via lazarus a écrit :
>
> I cannot use the direct connection, though, because I am heavily
> depending on being able to copy stuff across between the two systems
> and I also need to have access to my other tools on the Windows
> computer. So I have to stick with VNC anyway and work around the
> problem.

Did you try to use X11 forwarding ?

You need to install something like XMing (
http://www.straightrunning.com/XmingNotes/ ), a X Window server running
on Windows, and connect to the Raspberry Pi with a PuTTY connexion with
X11 Forwarding enabled.

I use it sometimes to access my Ubuntu machine from a Windows 10
machine. (in PuTTY: Connection/SSH/X11, enable X11 forwarding, X Display
location localhost:0.0, Remote X11 authentication protocol:
MIT-Magic-cookie)

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus