* * *

Author Topic: [SOLVED] Autoinsert replaces already typed-in code  (Read 1181 times)

Eugene Loza

  • Sr. Member
  • ****
  • Posts: 431
    • My "almost daily" development blog
[SOLVED] Autoinsert replaces already typed-in code
« on: February 27, 2017, 09:20:58 am »
When "completion box" is active automatically inserted value replaces a word that was in the code after the dot. It's not a critical bug, but often makes it less convenient to edit the code, as usually it replaces the word that should be inserted into the procedure/function/method parameters.

E.g. I want to replace
MyString := 'abrakadabra';
into
Memo1.lines.add(MyString);
I start typing
Memo1.lines.<cursor is here>MyString := 'abrakadabra';
The completion box popps up and I choose "add", and unexpectedly it removes "MyString", and I get:
Memo1.lines.Add();:='abrakadabra';
While expected:
Memo1.lines.Add<cursor is here>MyString := 'abrakadabra';
or at least
Memo1.lines.Add(<cursor is here>)MyString := 'abrakadabra';

Another example:

writeln(MyString);
//select "writeln(" and replace with memo1.lines. -- and select "add" from completion box
Memo1.lines.Add()); //result -> word MyString has disappeared


While expected:
Memo1.lines.Add(MyString);
or
Memo1.lines.Add<cursor here>MyString);
or at least:
Memo1.lines.Add()MyString);

Lazarus 1.6.2. FPC 3.0.0.
« Last Edit: March 03, 2017, 07:50:37 am by Eugene Loza »
My Free and Open Source games in Lazarus/FreePascal/CastleGameEngine:
https://decoherence.itch.io/
(and some ancient games in Turbo Pascal too)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4323
    • wiki
Re: Autoinsert replaces already typed-in code
« Reply #1 on: February 27, 2017, 05:44:46 pm »
It is not a bug, it is a feature. But really it is whatever you are used too.

I am annoyed every time that I use notepad++ (which does not do so).

If I have:  Foo.setSome()
And I want: Foo.setOther()

I expect to be able to place the cursor after the "set"..., type an O, open autocomplete and choose setOther, and it should remove the unwanted "Some".

Even worse, if setSome, should change to setHelpSome, if I type the H after set, then N++ offers the full setHelpSome, but choosing this end up with setHelpSomeSome, because the Some was not overwritten.

Of course I understand, if you are used to keep the text, then the removal is equally annoying.
« Last Edit: February 27, 2017, 05:47:47 pm by Martin_fr »

Eugene Loza

  • Sr. Member
  • ****
  • Posts: 431
    • My "almost daily" development blog
Re: Autoinsert replaces already typed-in code
« Reply #2 on: March 03, 2017, 07:50:12 am »
Solved! Lazarus forever!!!  :D
My Free and Open Source games in Lazarus/FreePascal/CastleGameEngine:
https://decoherence.itch.io/
(and some ancient games in Turbo Pascal too)

Rizanharus

  • Newbie
  • Posts: 1
Re: [SOLVED] Autoinsert replaces already typed-in code
« Reply #3 on: June 08, 2017, 12:36:56 pm »
I want to be the best I have to do it anyway.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3042
  • I like bugs.
Re: [SOLVED] Autoinsert replaces already typed-in code
« Reply #4 on: June 08, 2017, 01:03:58 pm »
I want to be the best I have to do it anyway.
Rizanharus, are you a bot or a spammer?

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus