-1

I am quite new to Delphi 10 Seattle and suddenly I am getting some extra text everytime when pressing ENTER. This is very annoying...

Anyone knows why this happens and how I can get back to a plain ENTER-code?

When pressing ENTER it results in a line break and a new line

  until ;

I don't know what I did to get the extra text until ;.

Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
Peter F
  • 29
  • 4
  • Maybe it's an IDE problem. – Filipe Martins Apr 24 '17 at 17:32
  • 2
    Peter, your English is fine. What's missing is the contextual code that's triggering the problem. Somewhere above you have a **repeat...until** which the IDE's parser is failing to recognise as closed.That's a crucial part of this question. Please [edit] your question to include it. Might I suggest you also mark Rudy's answer as accepted. – Disillusioned Apr 25 '17 at 06:10

1 Answers1

6

This looks like (automatic) block completion (or one of the other completions the IDE offers). I assume you have a repeat somewhere in your code and that repeat block is not properly closed with an until, so block completion tries to close it, somehow, by putting an until ; at the cursor each time your press return.

Either complete your code properly, or switch off block completion, e.g. from the main menu:

Tools -> Options -> Editor Options -> Code Insight -> [ ] Block completion

FWIW, I personally always leave it on, even if it can be a nuisance sometimes, because it shows me when I made a typo or similar mistake, and it usually takes away some of the typing I would have to do otherwise.

Rudy Velthuis
  • 28,387
  • 5
  • 46
  • 94
  • Thank you for answering. You are probably right. I tried to use enter above the last changes I made and it didn't happen there, but when I put an enter-code in the last text it gives the extra "until ; " I am trying to use parallel coding so I have to investigate. Strange is that it gives no error when running... Many thanks for answering!! /Peter – Peter F Apr 24 '17 at 18:21
  • I have removed all REPEAT and using WHILE instead and that solved the problem. Thanks again! //Peter – Peter F Apr 24 '17 at 18:37
  • 3
    @PeterF It is worth noting that the IDE and compiler don't use the same engine to parse code. (This fact is evident by other IDE peculiarities reported in the past.) So it's possible there's a bug in the IDE's engine for the particular pattern you're using. I suggest you distil a minimal and ***complete*** example; and report it at the [Quality Portal](https://quality.embarcadero.com/secure/Dashboard.jspa) – Disillusioned Apr 25 '17 at 06:04
  • Thanks Craig. I have reported the bug in Embarcadero's Quality Portal as "Delphi 10 Seattle - IDE bug when using REPEAT in Parallel functions" and hoping they will look to it. (Hope it was the right place). – Peter F Apr 25 '17 at 08:19
  • @PeterF: I doubt it is related to `repeat` only. You are now using `while` and that is unproblematic, because there is no `while...endwhile` block. But you can get an `end;` on unclosed `begin` blocks too. Or a `finally` after a `try`, and similar. – Rudy Velthuis Apr 25 '17 at 16:11