[Plugin update] An alternative auto completion for notepad++



  • Hi @DaveyD , thank you for the feedback.

    1. can you reproduce it everytime? I don’t have this issue on my end
    2. Ah, yes I’m aware of that issue #86; I’ve developped my own UI framework for this plugin and I’ve made the rookie mistake of ignoring dpi awareness ^^". That being said, the auto completion is entirely owner drawn so I will be able to make the font size an option in a later release

    Concerning your final question : yes, for now, this is tied to 3P. However, I plan to create a separate plugin with only this autocompletion feature once it is mature and stable enough inside 3P.

    Bye



  • @jcaillon - Thanks!

    1. I started testing again this morning - at first it wasn’t triggering at all! I restarted npp, still wasn’t triggering.
      It finally started triggering and this time it worked as expected and replaced the original text! (I will try to test this more to see why it wasn’t triggering and I’ll post back)
    2. Ok, optimistic news… I hope you can get to it sooner than later… :)
    3. Ok, that would be great because I don’t even know what Progress programming is… :)

    Thanks!
    David



  • @jcaillon - After a bunch of testing, I think I found the the problem of the triggering!

    Steps to reproduce:

    1. Open fresh npp
    2. Place cursor on a line that doesn’t have text
    3. Start typing - auto-complete does not trigger
    4. Now place cursor on a line with text
    5. Start typing - Autocomplete triggers as expected.

    I haven’t the slightest idea why this would be, but that was the results of my testing - I leave the rest up to you :)

    However, after testing some more, I realized another thing, If I open a new file and then go back to the original file, the autocomplete triggers as expected even on a line that has no text.

    Just to clarify: Once it triggers once, it continues to work correctly throughout the session in any place in the file. So, this is only a one time ‘setup’ per session (until you can figure out the cause and fix it… :) )

    Thanks,
    David



  • @DaveyD

    Thank you for taking the time to analyse this!

    I actually think that you are describing a expected behavior, let me explain :

    First thing to know is that there is an option that automatically hides the autocompletion if the text you type results in no matches in the list. This is enabled by default. (Plus, if there is absolutely nothing to suggest, e.i. you have no language selected and the text is empty, the list won’t automatically show up)

    1. Open fresh npp -> ok
    2. Place cursor on a line that doesn’t have text -> at this point, you are probably on a new file, not associated with a particular language and the text is empty -> hence the list is empty
    3. Start typing - auto-complete does not trigger -> since the list is empty, nothing happens when you type text (because of the option mentionned earlier) -> however you should be able to press CTRL+SPACE to show the empty list
    4. Now place cursor on a line with text -> I guess you changed file or added text -> now the list isn’t empty
    5. Start typing - Autocomplete triggers as expected. -> since the list isn’t empty, it shows the autocompletion

    Tell me if this makes sense :)



  • @jcaillon - Thanks for the response
    That default behavior is perfect!
    However, I don’t think I explained myself well enough:
    2. No, I was in a file with over 1500 lines of text, I had just placed my cursor on an empty line.
    And the file is associated with a UDL (by the way, when the autocomplete does trigger, it shows function params as well - nice!)
    3. I just tried again, list was empty (even though I was in large file) and ctrl+space opened a HUGE list of words (I guess all the words in the file)
    4. No, I just moved it up to the previous line that already had text

    Actually, now I received different behavior. There are a bunch of steps:

    1. Open fresh npp
    2. Place cursor on blank line - no autocomplete
    3. Place cursor on line with text - no autocomplete
    4. Place cursor on line right after text - autocomplete triggers!
    5. Press enter, now no autocomplete anywhere
    6. Open new file in npp and return to previous file - autocomplete everywhere and anywhere!

    I created a small screen recording to show you my testing, please download from here:
    Screencast on autocomplete issues

    I hope all this info is clear
    Thanks,
    David



  • This post is deleted!


  • @DaveyD
    Im so sorry, I see your problem in the video but I still can’t reproduce it!
    Do you have other plugins installed? Is your file special in any way? I’m clueless at this point ^^"

    If that’s not too much too ask, and if you use a portable version of npp, would you mind sending me a copy of your npp installation directory with a sample file of your language?



  • @jcaillon - after reading that you couldn’t reproduce it, I realized that it must be something on my end…
    I started debugging - I must have spent 2 hours debugging!
    This is my testing outcome:
    [Excuse me for writing all these steps… it’s just that after debugging for so long… I just have to write what I did! :) ]

    • Created a new portable npp and installed your plugin - everything worked.
    • Installed all my plugins, everything worked!??
    • Removed all plugins from my original install - it worked!
    • Began putting all back few by few… I found that it was the python plugin!
      • but that’s odd, because in my new portable npp, I also had python plugin installed and it worked!?
    • I went back to my new portable install, removed all plugins except python. It worked!??
      • If so, it must be something with my Python plugin in my installed version.
      • I checked it and it was up to date.
      • Maybe it’s one of my python scripts? (read on…)
    • I copied all my Python scripts from my install into my new portable npp - it still worked!!
    • I started going through the config folder file by file…

    Anyway, to make a long story short… the bug is due to a setting on Python script!
    When Python script is set to start startup scripts ATSTARTUP (instead of LAZY), we get this funny behavior.

    Steps to Reproduce: (You don’t have to follow these steps exactly, just have python plugin installed and set that setting to ATSTARTUP. I am just writing it this way to show that it is a pure conflict - not tied to anything on my machine.)

    1. Fresh install of npp
    2. Fresh install of Python plugin
    3. Go to Plugins>Python Script>Configuration, and set Initialisation to ATSTARTUP
    4. Close npp, reopen, the bug appears.
    5. The minute you change file and come back, it begins to work.

    However, I did realize that it doesnt behave this way with all files! I tried a python script, it worked fine. I tried a regular txt file, it worked fine. I has to do something with the text in my file.
    For testing purposes, I was able to reproduce this issue with a file of just a few lines.

    In order to help you find the problem, I am sending you the sample document. I am actually sending you 2 of the same docs with a slightly different name so you can see that immediately after moving to a new file, it begins to work even though the files are identical!
    If it’s more convenient for you, I also packaged the entire portable npp folder. If you go with this, everything will be setup already (files included, and they will open immediately because of the sesssion file).
    Set of 2 files for testing
    Npp portable - all included

    By the way, I tested this exact method on 2 different machines and got the same results.

    I hope this helps!
    David

    P.S. I also hope you plan to fix the tiny UI… :)



  • EDIT: (4/5/2017, 11:59 PM)
    The for the portable npp package was incorrect. Here is the updated link:
    Npp portable - all included

    Sorry about that,
    David



  • @DaveyD, thank you very much the time you spent on this issue!

    I’m glad we found the source, I am assuming that the python plugin modifies some scintilla options on startup; I’ll investigate ASAP. In the meantime, an easy workaround is to switch documents on startup :p

    I should be able to fix the DPI awareness for the next release; at least for the auto completion form (I have more complex issues in the main window).



  • @jcaillon, Ok, thanks!
    The workaround is definitely ok for me… :)
    Regarding the dpi issue, that sounds great for me! Thanks
    After you release that I will hopefully be able use it and to provide much better feedback on the actual plugin.

    Thanks and Good luck
    David



  • @jcaillon Great work! How did you disable the default auto completion feature?


Log in to reply