Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2019-03

IDE Ctrl+W key

19 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Frb
to Anthony Walter
Anthony Walter wrote
I support this idea, although manually remapping hotkeys thanks to the fantastic key bindings dialog is very easy.

The problem with changing this default (this one particularly) is that anyone used to the current behaviour will not only get a new behaviour, but one that close the current tab for them. So that is one, that cannot just undone by ctrl-z.
And they might get it repeatedly, as "old habits die hard".

Reply by email

Sven Barth
to Anthony Walter

Anthony Walter via lazarus schrieb am So.,
17. März 2019, 19:04:

You can still keep the old hotkey of ctrl+f4 and add ctrl+w. I really think worldwide there are is a grand total of zero people who use the word completion feature currently mapped to ctrl+w.

Wrong. I use it very often, especially when CodeTools fails due to me working on features that are not yet supported. Or if some include file is not picked up correctly.

Regards,
Sven

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190317/eae952a8/attachment-0001.html>

Reply by email

Mattias Gaertner
to Sven Barth
Show quoted text 11 lines
Anthony Walter via lazarus schrieb am So., 17. März 2019, 19:04: > You can still keep the old hotkey of ctrl+f4 and add ctrl+w. I > really think worldwide there are is a grand total of zero people > who use the word completion feature currently mapped to ctrl+w. > Wrong. I use it very often, especially when CodeTools fails due to me working on features that are not yet supported. Or if some include file is not picked up correctly.

+1

Ctrl+Space is for parseable Pascal files, Ctrl+W is for all other files.

Mattias

Reply by email

Mattias Gaertner
to Dmitry Boyarintsev
Show quoted text 7 lines
On Sun, Mar 17, 2019 at 4:58 PM Mattias Gaertner via lazarus < > wrote: > Ctrl+Space is for parseable Pascal files, Ctrl+W is for all other > files. > and what's the issue to have Ctrl+Space for both cases?

Are you aware that if Ctrl+Space fails it jumps to the syntax error?

Mattias

Reply by email

Dmitry Boyarintsev
to Mattias Gaertner

On Sun, Mar 17, 2019 at 7:35 PM Mattias Gaertner via lazarus <

Show quoted text 10 lines
wrote: > > > Ctrl+Space is for parseable Pascal files, Ctrl+W is for all other > > files. > > > and what's the issue to have Ctrl+Space for both cases? Are you aware that if Ctrl+Space fails it jumps to the syntax error?

Yes. And it's irritating, because I do remember when Ctrl+Space used to work even with incomplete sources.
I often trying to use Ctrl+Space to complete the word on incomplete sources. (because I don't remember an API, and I need a hint.). But instead of showing me a list of options, it just doesn't work or jumps somewhere else. (...and jumping can be turned off, yet it won't do anything useful).

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190317/7f0391ee/attachment.html>

Reply by email

Mattias Gaertner
to Dmitry Boyarintsev
Show quoted text 5 lines
[...] > Are you aware that if Ctrl+Space fails it jumps to the syntax error? Yes. And it's irritating, because I do remember when Ctrl+Space used to work even with incomplete sources.

Ctrl+Space always jumped to an error.
Although over the years codetools parser matured. So some syntax, that was formerly skipped/ignored, now raises an error. Maybe you mean this?

Show quoted text 5 lines
I often trying to use Ctrl+Space to complete the word on incomplete sources. (because I don't remember an API, and I need a hint.). But instead of showing me a list of options, it just doesn't work or jumps somewhere else. (...and jumping can be turned off, yet it won't do anything useful).

IMO hiding an error is asking for trouble.
A good GUI must indicate somehow when the results are not reliable or incomplete. For example by showing as first result a red line with the error message, which when selected will jump to the error. Then the user can deliberately choose to fix or ignore the error.

I guess that would substitute a good deal of word-completion. Although word-completion is also much faster.

Mattias

Reply by email

Dmitry Boyarintsev
to Mattias Gaertner

On Mon, Mar 18, 2019 at 1:57 PM Mattias Gaertner via lazarus <

Show quoted text 6 lines
wrote: Ctrl+Space always jumped to an error. Although over the years codetools parser matured. So some syntax, that was formerly skipped/ignored, now raises an error. Maybe you mean this?

I would think, this is exactly the problem. Though I'd expect the mature parser to be more tolerant to user errors and do some sort of self recovery.

Also, I don't think me simply complaining about the "here and there" would help.
However, sometimes I just cannot bug-report the issue, because restarting the IDE resolves the problem.

Is there any sort of stand-alone code-tools log happening? Something that could be used for bug reporting?

IMO hiding an error is asking for trouble. A good GUI must indicate somehow when the results are not reliable or incomplete.

That's what C-language developers are relying on. In Pascal world compilation is fast, so it will be quite a short time when the compiler would remind a developer about the error.
(btw, the "slowness" retains even in modern faster languages. i.e. C#. It's not because the compiler is slow, but because an IDE is slow. Lazarus manages to keep very high performance)

For example by showing as first result a red line with the error message, which when selected will jump to the error. Then the user can deliberately choose to fix or ignore the error.

I hate my cursor to jump anywhere, when I'm asking for word-completion at a particular placement.
As well as the concentration on the particular part of the code is lost. The error can be pretty far away, and returning to the where I was might take some time.

(btw, due to aggressive jumping in the past. I.e. when Objective-P support was only introduced to code tools I taught myself to use bookmarks often. Just for a quick jump back to the line of code I was working at.)

I guess that would substitute a good deal of word-completion. Although

word-completion is also much faster.

All in all, why can't both of them be the same thing? Typical single-form application template:

procedure TForm1.FormCreate(Sender: TObject);
begin
  For|
end;

Ctrl+Space produces:
* FormCreate
* FormIsUpdating
* FormState
* FormStyle
...

Ctrl+W produces:
* Forms
* FormsCreate (how did it know?)
* Form1

thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190318/6892e0c4/attachment.html>

Reply by email

Martin Frb
to Dmitry Boyarintsev

On 19/03/2019 03:44, Dmitry Boyarintsev via lazarus wrote

Show quoted text 15 lines
error message, which when selected will jump to the error. Then the user can deliberately choose to fix or ignore the error. I hate my cursor to jump anywhere, when I'm asking for word-completion at a particular placement. As well as the concentration on the particular part of the code is lost. The error can be pretty far away, and returning to the where I was might take some time. (btw, due to aggressive jumping in the past. I.e. when Objective-P support was only introduced to code tools I taught myself to use bookmarks often. Just for a quick jump back to the line of code I was working at.)

History back should work after an codetools error. IIRC Ctrl-H, but I move it to Alt-Cursor-Left.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190319/c2458816/attachment.html>

Reply by email

Dmitry Boyarintsev
to Martin Frb

On Mon, Mar 18, 2019 at 10:58 PM Martin Frb via lazarus <

Show quoted text 5 lines
wrote: History back should work after an codetools error. IIRC Ctrl-H, but I move it to Alt-Cursor-Left.

The first time I hear about that thing. What's "History point"? how is it defined?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190318/dd0b4dd8/attachment-0001.html>

Reply by email

Martin Frb
to Dmitry Boyarintsev
Dmitry Boyarintsev wrote 11 lines
On Mon, Mar 18, 2019 at 10:58 PM Martin Frb via lazarus < <mailto:>> wrote: History back should work after an codetools error. IIRC Ctrl-H, but I move it to Alt-Cursor-Left. The first time I hear about that thing. What's "History point"?  how is it defined?

View menu: jump history

Everytime you jump to a declaration, method body, ... (and some others like go to begin/end of file) a point is inserted. (except, if it is just 1 or 2 lines from where you were).

You can navigate back and forward on those points.
- mouse buttons 4 and 5 (like in webbrowesrs)
- ctrl-h (IIRC.., I recommand mapping it to alt cursor left/right)
- editor toolbar can provide buttons too

The usual way is, that you look up the definition of some identifier (I mapped "jump to declaration" to alt cursor up), maybe follow it forward, follow another declaration inside it...., and then jump back as far as you need.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190319/daed72f4/attachment.html>

Reply by email

Ondrej Pokorny
On Sun, 17 Mar 2019 19:16:40 -0400 Dmitry Boyarintsev via lazarus < <https://lists.lazarus-ide.org/listinfo/lazarus>> wrote: >/On Sun, Mar 17, 2019 at 4:58 PM Mattias Gaertner via lazarus < /> >

<https://lists.lazarus-ide.org/listinfo/lazarus>> wrote: /> >//> >/> Ctrl+Space is for parseable Pascal files, Ctrl+W is for all other /> >/> files. /> >/> /> >/and what's the issue to have Ctrl+Space for both cases? /

Are you aware that if Ctrl+Space fails it jumps to the syntax error?

You can disable it in IDE options (Codetools -> Identifier Completion -> Miscellaneous -> Jump to error) You still get the information about the syntax error in the messages window.

You can include word completion in the identifier completion in the IDE options as well (IDE Options -> Codetools -> Identifier Completion -> Include words) - there is a note about it in http://wiki.freepascal.org/Lazarus_2.0.0_release_notes - then you have both cases in Ctrl+Space.

I worked on it.

Ondrej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190319/af939130/attachment.html>

Reply by email

Kostas Michalopoulos
to Martin Frb: View menu: jump history Everytime you jump to a declaration, method body, ... (and some…

I always saw the cursor jumping due to a syntax error as a bug, not a feature and has always been an annoyance that breaks my code flow. Honestly, i do not see what the point is, i am trying to complete the word, not find syntax errors (this is what Ctrl+F9 is for). I also think Ctrl+Space should display word completion in addition to parsed-based words - it could put an icon with a pair of question marks or whatever in front of the "guessed" words to indicate where they come from.

Going back through the jump history is just a bandaid to a problem that shouldn't exist in the first place.

AM Martin Frb wrote 27 lines
On 19/03/2019 04:39, Dmitry Boyarintsev via lazarus wrote: On Mon, Mar 18, 2019 at 10:58 PM Martin Frb via lazarus wrote: > > History back should work after an codetools error. IIRC Ctrl-H, but I move it to Alt-Cursor-Left. The first time I hear about that thing. What's "History point"? how is it defined? View menu: jump history Everytime you jump to a declaration, method body, ... (and some others like go to begin/end of file) a point is inserted. (except, if it is just 1 or 2 lines from where you were). You can navigate back and forward on those points. - mouse buttons 4 and 5 (like in webbrowesrs) - ctrl-h (IIRC.., I recommand mapping it to alt cursor left/right) - editor toolbar can provide buttons too The usual way is, that you look up the definition of some identifier (I mapped "jump to declaration" to alt cursor up), maybe follow it forward, follow another declaration inside it...., and then jump back as far as you need. -- _______________________________________________ lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus

Reply by email

Ondrej Pokorny
to Kostas Michalopoulos

There is no need to discuss this. As I said before both your points are customizable.

Kostas Michalopoulos wrote
I always saw the cursor jumping due to a syntax error as a bug, not a feature and has always been an annoyance that breaks my code flow. Honestly, i do not see what the point is, i am trying to complete the word, not find syntax errors (this is what Ctrl+F9 is for).

IDE options -> Codetools -> Identifier Completion -> Miscellaneous -> Jump to error

Show quoted text 5 lines
I also think Ctrl+Space should display word completion in addition to parsed-based words - it could put an icon with a pair of question marks or whatever in front of the "guessed" words to indicate where they come from.

IDE Options -> Codetools -> Identifier Completion -> Include words

Going back through the jump history is just a bandaid to a problem that shouldn't exist in the first place.

Does the problem persist if you change the options from above?

Ondrej

Reply by email

Kostas Michalopoulos
to Ondrej Pokorny

Thanks, those two options seem to be exactly what i had in mind :-)

PM Ondrej Pokorny wrote 30 lines
There is no need to discuss this. As I said before both your points are customizable. On 25.03.2019 11:40, Kostas Michalopoulos via lazarus wrote: > I always saw the cursor jumping due to a syntax error as a bug, not a > feature and has always been an annoyance that breaks my code flow. > Honestly, i do not see what the point is, i am trying to complete the > word, not find syntax errors (this is what Ctrl+F9 is for). IDE options -> Codetools -> Identifier Completion -> Miscellaneous -> Jump to error > I also > think Ctrl+Space should display word completion in addition to > parsed-based words - it could put an icon with a pair of question > marks or whatever in front of the "guessed" words to indicate where > they come from. IDE Options -> Codetools -> Identifier Completion -> Include words > Going back through the jump history is just a bandaid to a problem > that shouldn't exist in the first place. Does the problem persist if you change the options from above? Ondrej

Reply by email