I type strangely out of habbit, and...

I type strangely out of habbit, and...

3
NewbieNewbie
3

    Oct 18, 2005#1

    Here's the deal, auto-indent doesn't work for me bacause of the way I type: I, by habbit, close everything before typing the meat. e.g.:

    Most people do this, where a | is used for the cursor:

    Code: Select all

    1)
    if ( |
    
    2)
    if ( whatever ) {
      yep; |
    
    3 )
    if ( whatever ) {
      yep;
    } |
    
    But I do this:
    
    1)
    if () {} |
    
    2)
    if ( whatever | ) {}
    
    3) 
    if ( whatever ) {
      yep; |
      }  // Notice the position here.
    
    Here's the problem (any language): with auto-indent on, the ending brackets are not un-indented. With auto-indent off, auto-indent is off, and I might as well be using notepad. Also, the way I code is (for me) both 1) extremely fast, and 2) a decade long habit. Please don't tell me to learn to type differently :). I like the rest of UltraEdit, but this one little thing makes it difficult to use for me.

    Is there a work-around I can use? If not, I'm going to try my luck at requesting it as a feature; it's a fairly simple thing, the program just checks whether or not to unindent every time you type a closing delimeter, and could be changed to check when you start a new line as well. All of the other editors I use handle this correctly (Eclipse, Visual C++, etc.), but I like using UltraEdit as a non-specific editor (it's not part of an IDE, is what I mean). Please help if you know a work around!

    6,687587
    Grand MasterGrand Master
    6,687587

      Oct 18, 2005#2

      Look at ReIndent Selection.

      Maybe this gives you some ideas how to configure the indent feature so it works for you. I will not look further into your problem until you have coded your examples as preformated text.

      Search also for other topics in the forum about indent.
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        Oct 19, 2005#3

        As a warning, this is going to be hard to read because of how it has to be typed (to show the order of the typed stuff).

        The problem is that I press enter *after* I have created a closing delimiter, because I close everything that I open *first,* by habbit.

        6,687587
        Grand MasterGrand Master
        6,687587

          Oct 19, 2005#4

          I see now what's the problem with your method.

          Do you now any editor which supports auto-indent with your method?

          Normally the unindent is done immediately after entering the closing } which is a good method, because from a programmers view it can be easily realized.

          Your method would need, that the indent/unindent procedure must be executed at every RETURN. And the procedure must be much complicated, because it must be searched down for the correct unindent string (other languages has more then one single character for unindent), then validate if it is really the unindent string, which belongs to the current indent string, then validate, if the position is correct or not and last execute the space removing or not. And this describes only the normal behaviour for your method and there some more exceptions. I think, this will be too difficult for a GENERAL text editor.

          But nevertheless, you can ask IDM, if the would support your method.

          But what about a little modification of your method.

          Code: Select all

          1)
             if () {|             // press RETURN here
          
          2)
             if () {|
             }|                   // press UP ARROW here and move cursor left instead of moving cursor right
          
          3)
             if ( whatever |) {   // press END and RETURN now
             }
          
          4) 
             if ( whatever ) {
               yep;|
             }
          Best regards from an UC/UE/UES for Windows user from Austria

          3
          NewbieNewbie
          3

            Oct 21, 2005#5

            Most other *specialized* editors do it, and a most of the other general editors do it as well with a bit of configuring (like emacs).

            No, there no getting around the way I type though. I started doing it this way too long ago; the reson why is actually related to writing "oldschool" html pages, where things can get complicated and you *have* to close tags right when you start them or you lose where the end should be. That, and I always closed opening ('s in lisp too, because ('s are basically the only punctuation in lisp, and can quickly get 6 or 7 levels deep.

            Oh well, I'll ask them and see what happens.