Author Topic: Suggest completions only after typed n chars  (Read 3601 times)

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
Suggest completions only after typed n chars
« on: May 13, 2009, 11:53:49 AM »
Related >to< feature wish:   "Suggest only after typed [ 5] chars"

Scenario:
I have:
-- set "Suggest completions when they save [ 8] chars"
-- typed 'automobil' once before in my text.

If i type now an 'a' i get an suggestion about 'automobil'

Problem:
But this is to much "noise" for me. I mean i get to often an suggestion.

Solution to discuss:
In other editors i have seen an option like:
"Suggest only after typed [ 5] chars "

So in my case i would get an suggestion only if i had typed at least 'autom' , but not for 'auto' .

Implementation brain storming:
"Suggest completions when they save n chars" need to have an own check box in options dialog to enable this feature,
"Suggest completions only after typed n chars" need to have an check box there too

"Suggest completions only after typed n chars" should be checked first,
then "Suggest completions when they save n chars" as second
and if this all is true show the suggestion.


Conclusion:
Perhaps this is an candidate for the todo list? :D
« Last Edit: May 13, 2009, 11:59:47 AM by Stefan »
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2215
  • Karma: +37/-3
    • HippoEDIT
Re: Suggest completions only after typed n chars
« Reply #1 on: May 13, 2009, 12:21:23 PM »
Hello Stefan,

saying the truth, I could not understand why you need this...
Reason for this feature to save your typing. So if you can save at least n characters (do not type by yourself but allow HE to insert them for you) then hint should be shown.

With your example 'automobil' you can save only 4 characters after typing 'autom', so why to at all suggest something. Probably the feature you need is to disable code hints if it is not a template hint, because you typing too fast :) And you always can use Completion List (Ctrl+Space) to see full list of completions when you want.

I would assume if you set to Suggest completions when they save [ 255] chars then you should not see  suggestion code hints. But this is does not work, and probably this is a bug that should be fixed.

And also, in which other editor you have seen this (would like to check what they are doing):
Quote
In other editors i have seen an option like:
"Suggest only after typed [ 5] chars "

Best regards,
Alex.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
Re: Suggest completions only after typed n chars
« Reply #2 on: May 13, 2009, 12:40:11 PM »
1) i like suggestion for longer words
2) i don't like to see hints that often, even on first char

> With your example 'automobil' you can save only 4 characters after typing 'autom', so why to at all suggest something.
I don't want suggestion for this example ( i have set "Suggest completions when they save [ 8] chars")
But i want suggestion if this  'automobil' would be the begin of an longer word, like  'var=automobiles_still_in_stock'   (well, or like this)
But if i want to type 'auto' only, i don't want to see any suggestions for other, longer words.

My point is:
- i like auto completion
- i don't like to see this if i would type short words only.

To often i want type 'fun' and then do an RETURN,
but i was auto suggested with 'function'   - which was be entered then by pressing RETURN, and i have to undo it.


I think i want to set:
"[  ] Suggest completions when they save [   ] chars"
"[X] Suggest completions only after typed [ 6]  chars"  , no matter what i save :D





>And also, in which other editor you have seen this
I don't remember by now, please wait an moment (or two)
EDIT:
- first is Boxer
- second is UltraEdit
-


----       ----       ----       ----       ----       ----       

EDIT 2:

Oh, i see i was not clear:

Quote from: Stefan
Solution to discuss:
In other editors i have seen an option like:
"Suggest only after typed [ 5] chars "

So in my case i would get an suggestion only if i had typed at least 'autom' , but not for 'auto' .
Quote from: Alex
With your example 'automobil' you can save only 4 characters after typing 'autom', so why to at all suggest something.
...because other editor didn't have this HE feature ("[  ] Suggest completions when they save [  8] chars") :D ;D


This correspond  to my statement above:
Quote from: Stefan
I think i want to set:
"[  ] Suggest completions when they save [   ] chars"
"[X] Suggest completions only after typed [ 6]  chars"  , no matter what i save



--- but please don't make extra work for me, if you didn't see an use ---

.
« Last Edit: May 17, 2009, 05:54:40 PM by Stefan »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2215
  • Karma: +37/-3
    • HippoEDIT
Re: Suggest completions only after typed n chars
« Reply #3 on: May 13, 2009, 04:59:53 PM »
Ok, I am convinced.
This is not too much work, so I can add this in new beta.
I would only add this option in same way as it already done for save suggestions (edit field with slider) because default can be set to 1 and then it would work same way as without it. And also you can combine it with save suggestion option.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
Re: Suggest completions only after typed n chars
« Reply #4 on: May 13, 2009, 07:02:21 PM »
No need for hurriedness, but thank you for  consider it :D   *pattingthehippo*

Offline JJK

  • Registered User
  • Full Member
  • *
  • Posts: 152
  • Karma: +2/-0
Re: Suggest completions only after typed n chars
« Reply #5 on: May 13, 2009, 10:41:57 PM »
As Stefan, I think it would be useful, for the reasons he exposed.
Sometimes it is annoying to get suggestion of completion whereas it would be as simple as to type some letters.
But no hurry neither, except if it is simple to code :)

Offline Arthur

  • Registered User
  • Hero Member
  • *
  • Posts: 653
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • My Blog
Re: Suggest completions only after typed n chars
« Reply #6 on: May 13, 2009, 10:46:57 PM »
Thinking, is it possible to do a quick toggle (on/off) for the word completion to be accessible say from within the right-click menu?

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2215
  • Karma: +37/-3
    • HippoEDIT
Re: Suggest completions only after typed n chars
« Reply #7 on: May 13, 2009, 11:55:04 PM »
Hello Arthur,

I do not think that this setting would be often changed, so I do not want to add it or to context menu or to toolbar.
Maybe if somebody else would request.

But I have implemented Stefan suggestion (it was easy). So maybe because of this woul be no need in such option any more ;)

Best regards,
Alex.

Offline Arthur

  • Registered User
  • Hero Member
  • *
  • Posts: 653
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • My Blog
Re: Suggest completions only after typed n chars
« Reply #8 on: May 14, 2009, 05:08:04 AM »
Does this thread http://forum.hippoedit.com/index.php/topic,314.0.html then become redundant?

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
Re: Suggest completions only after typed n chars
« Reply #9 on: May 14, 2009, 08:34:24 AM »
Does this thread http://forum.hippoedit.com/index.php/topic,314.0.html then become redundant?

No.
The thread you linked to is about
"Suggest completions when they save [  ] chars"

This thread here is about
"Suggest completions only after typed [  ]  chars"

Since we want to keep issues separated in this forum,
there are two separate threads for each feature, to make clear what answer was to what question.
(I know it's not always clear and easy to do that that way, but sometimes i try :D )

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2215
  • Karma: +37/-3
    • HippoEDIT
Re: Suggest completions only after typed n chars
« Reply #10 on: May 14, 2009, 11:35:15 AM »
Hello Stefan,

please check new beta from today. It should contain your request.
Beta history I would update later.

Best regards,
Alex.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
Re: Suggest completions only after typed n chars
« Reply #11 on: May 14, 2009, 12:49:24 PM »
WOW very fine. Now this features works as i had expected it from the beginning, i think.

I have set  "Options > Code Completion > Enable Code Hints"  to:
     "Suggest completions when they save 2 chars"
     "Suggest completions only after typed 6 chars"

Now i get suggestions only i have typed at least 6 chars, and if i would save 2 chars typing at least. Fine!
(well, i will set 'save 2'  to something higher)

Thank you, Alex!

EDIT for update:  see related new feature:
>>Delay for showing Code Hint tooltip added.
Maybe this can help with situation of pressing <enter> at the end of line<<
« Last Edit: June 07, 2009, 10:48:29 PM by Stefan »