Author Topic: When entering python function, parens are provided, type ( and duplicate  (Read 357 times)

rowbearto

  • Senior Community Member
  • Posts: 1395
  • Hero Points: 108
When I start writing a new python function, when I type "def<space>", SE inserts parentheses, so I then see "def ()" and the cursor is placed before the open paren. I then type the name of the function and then when I type open paren, it creates a 2nd open paren "def funcname(()" and the cursor is placed between the 2 open paren. It is not helpful.

Is this a bug? If not a bug, is there a way that I can configure so that in this case if I type an open paren, it doesn't insert one and puts the cursor after the existing open paren?

I noticed a similar thing when editing an SE macro (.e file). After typing "#import<space>" 2 double quotes are inserted and cursor is placed between the double quotes. I instinctively type a double quote even though it is not needed and it puts me past the 2nd double quote. Would be nice that didn't happen if I type a " character between 2 empty "" after an #import.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1284
  • Hero Points: 128
Re: When entering python function, parens are provided, type ( and duplicate
« Reply #1 on: October 02, 2018, 03:10:39 pm »
It's more of a limitation than a bug, but can definitely see the inconveniences.   The smart auto-paren code typically handles the trailing paren, but not the leading one.  Will need to make some adjustments to handle that for this particular syntax expansion.

I'll take a look at the Slick-C #import, that one can probably be improved too.

rowbearto

  • Senior Community Member
  • Posts: 1395
  • Hero Points: 108
Re: When entering python function, parens are provided, type ( and duplicate
« Reply #2 on: October 02, 2018, 03:13:17 pm »
Thanks Lee!