Recent

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

Eugene Loza

  • Hero Member
  • *****
  • Posts: 663
    • My games in Pascal
[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 FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • 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

  • Hero Member
  • *****
  • Posts: 663
    • My games in Pascal
Re: Autoinsert replaces already typed-in code
« Reply #2 on: March 03, 2017, 07:50:12 am »
Solved! Lazarus forever!!!  :D
My FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: [SOLVED] Autoinsert replaces already typed-in code
« Reply #3 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?
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018