Menu

#2446 SciTE manually started calltips issue with 'nested' calltips

Bug
open-accepted
nobody
5
2024-07-10
2024-06-30
No

SciTE calltips which are manually started don't work as well as the ones which are automatically started. This is because in IDM_SHOWCALLTIP's handler it doesnt initialize braceCount to 1 unlike in CharAdded.

This leads two a problem with 'nested' calltips.

For example with C calltips enabled:

  • Start SciTE
  • Open a .c file which has one line saying: fprintf(
  • Place the caret after the (
  • Press Ctrl+Shift+Space to show the calltip
  • Type: sprintf(
  • The sprintf calltip should now be visible
  • Type: )
  • It should now reshow the fprintf calltip but only does that if the calltip was started by CharAdded and not if its started by IDM_SHOWCALLTIP. This is because the value of braceCount is 1 lower than it should be.

If you in step 2 instead open an empty .c file and type fprintf( yourself then it will work even if you do Esc followed by Ctrl+Shift+Space after that because doing so will mean braceCount happens to be 1 instead of 0 when IDM_SHOWCALLTIP starts the calltip.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2024-07-09
    • labels: SciTE --> SciTE, calltip
    • status: open --> open-accepted
     
    • Martijn Laan

      Martijn Laan - 2024-07-10

      FYI, in the meantime I think I've noticed a similar situation in SciTEBase::CharAddedinside the else if (wEditor.AutoCActive()) bit: here it does braceCount++ before calling StartCallTip();. This causes a problem if earlier some calltip was canceled which leaves braceCount at some number which has become meaningless. Not sure what the fix would be, I think it's incrementing instead of setting to 1 to handle the case when the user is manually switching between autocomplete and calltips while entering a long function call?

       

Log in to post a comment.

MongoDB Logo MongoDB