Author Topic: Make ENTER enter ENTER, always...  (Read 645 times)

jcelle

  • Community Member
  • Posts: 49
  • Hero Points: 2
Make ENTER enter ENTER, always...
« on: October 16, 2017, 09:57:46 am »
Hello,
I am a little bit confused sometimes by the assistance provided while you type in SlickEdit.
In particular I am used to expect that pressing ENTER should insert an EOL character.
In PHP (and certainly in other similar languages) if I am on a comment line, pressing ENTER inserts some comment characters on the new line to allow me continuing editing my comment (which can be very handy).
I discovered that pressing SHIFT+ENTER was just inserting a new line.

In fact I would like to have exactly the opposite:
- pressing ENTER should just do what it says, insert a new line
- pressing something much complex such as SHIFT+ENTER would trigger a more complex function involving ENTER and in this case allow me to continue in comment mode.

In other words I would like to decide when I want assistance.
In the very same way I would like to always press Ctrl+Tab to get suggestions for auto complete and not have them come in the way as soon as I start typing characters.

Regarding the ENTER case, the thing is I don't really know how I can remap these keys !
- ENTER is bound to 12 entries !!
- Shift+ENTER to 3 entries !!

I was wondering if someone there was sharing my view and/or had some pieces of advice.
Thanks so much in advance.
Jerome


Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2389
  • Hero Points: 328
Re: Make ENTER enter ENTER, always...
« Reply #1 on: October 16, 2017, 04:14:50 pm »
The guiding philosophy is to make it easy to do the right thing the majority of the time and to make features such as auto-complete be assistive and apparent, especially to new users.  If we only did auto-complete on demand, as you suggest using Ctrl+Tab, then a lot of users might never even discover it.  This is especially true with a feature such as extending comments or splitting strings.  If you pay attention to the Feature Notifications on the status line, you can learn about SlickEdit features and also jump to links to tune them to your needs.

For example, extending comments and strings on ENTER is an example of doing the right thing in the easiest possible manner.  If your cursor is within a block comment or a string and you hit enter, you don't want to leave it unterminated or malformed, so we put in the extra effort so you can continue typing the comment.  Why make someone hit Ctrl+Enter to get the right result, and give them the wrong result the majority of the time otherwise?

If you don't like the default, it is easy to configure.  Go to Tools > Options..., type "comment" in the search text.  That's logical, right, you are looking for an option having to do with comments, that's how you would find it.  Decide if you want to change it for all languages or just your programming language, and click on the "Comments" category which will be highlighted.  In that option page, you will see options for Comment Editing, in particular "Split line comments" and "Extend line comments".  Click on Help if you need more explanation about the settings.

As for Auto-compete, if you only want it to be on-demand, you can achieve that pretty easily.  Go to the Auto-Complete options, and uncheck "Enable auto-completion".  In most emulations, Auto-complete is bound to Ctrl+Space (codehelp_complete) and/or Alt+Dot (list-symbols) if you want to bring it up on-demand.  You can use the Key Bindings dialog to change that to Ctrl+Tab, if you prefer a more acrobatic key combination. 

jcelle

  • Community Member
  • Posts: 49
  • Hero Points: 2
Re: Make ENTER enter ENTER, always...
« Reply #2 on: October 18, 2017, 08:38:42 am »
Thanks Dennis, this is exactly what I was looking for !
It changed my day !!

Even though I appreciate all the effort made to assist the developer I must confess that most of the time SE predictions are not the ones I want.
For instance, for the comment, I want to enter my comment, press ENTER and start coding : my comments are usually one line comments; multi line comments are rare and having the possibility to have it continued on the next line would be great, but as it is not my default behavior I am ready to type a different key.

I haven't spotted this Feature Notification on the status line but I'll pay attention to it.

I have a subsidiary question Dennis: I have the same problem with TAB: it tries to compute an indentation and ... most of the time, in my mixed php/html code, it is wrong... I would love having TAB enter TAB (or equivalent spaces that I set somewhere in the configuration during the initial wizard ran on first execution of SE).
I could not find anything in the options dialog box (but it is still hard for me to find my way as there are so many options, which is good because I know there is something for my coding habits somewhere).

Thanks again for you precise answer Dennis.



jcelle

  • Community Member
  • Posts: 49
  • Hero Points: 2
Re: Make ENTER enter ENTER, always...
« Reply #3 on: October 18, 2017, 08:47:34 am »
I think I found my TAB setting : "When TAB reindents the line"...
SE is really good...

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2389
  • Hero Points: 328
Re: Make ENTER enter ENTER, always...
« Reply #4 on: October 18, 2017, 02:48:32 pm »
Glad you found the settings you needed.  The Options Search is really valuable -- you can also do multi-word searches there ("and" logic).  For example "Pascal modified line"

jcelle

  • Community Member
  • Posts: 49
  • Hero Points: 2
Re: Make ENTER enter ENTER, always...
« Reply #5 on: October 22, 2017, 10:50:29 am »
Hi Dennis,
I am trying to follow your advice but it just looks to me that the problem is still there.
Quote
If your cursor is within a block comment or a string and you hit enter, you don't want to leave it unterminated or malformed, so we put in the extra effort so you can continue typing the comment.  Why make someone hit Ctrl+Enter to get the right result, and give them the wrong result the majority of the time otherwise?

You can't continue typing comments forever, how do you deal when you reach the last line of comment and want to switch back to non comment ?



Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2389
  • Hero Points: 328
Re: Make ENTER enter ENTER, always...
« Reply #6 on: October 23, 2017, 02:08:47 pm »
As you pointed out before, there is Shift+Enter.  Most of the time I just move the cursor down out of the comment when I'm done editing it.