too many spaces with C/C++ language template

Home Forums Multi-Edit Support too many spaces with C/C++ language template

This topic contains 7 replies, has 2 voices, and was last updated by  Gorlash 2 weeks, 1 day ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #23498

    Gorlash
    Participant

    I have V11.04.00; I’ve been using it at home with no problems. The problem that I’m describing here, does not occur at home.

    So I installed MEW at my new job, then copied the config files MeConfig.db and Windows.db to the ME config directory. All of the colors, configurations, etc, all look fine.

    However, I have an odd thing happening (with C/C++ files);
    If I hit Enter at end of a line that ends in close-parenthesis, the cursor indents to column 21. If I do this on any other line, it properly indents to either column 1 or column 5 (I have indents set to 4, per company coding standards).

    I looked through the C template settings, and none of the constants (under ‘Template Sets’) has 21 embedded spaces, that I can find. However, I don’t actually know what operation is triggered when I hit Enter after a paren.

    Does anyone have any idea what is wrong here, and how to fix it?

    #23500

    Clay Martin
    Keymaster

    Hi,
    I have tried to reproduce this with no luck. Lets check on some of your settings. To make this easy open a c/c++ file in the editor. Go to Tools-Customize-Extensions, C CPP H HPP should be selected and press Edit. In the upper left is an option for Indent Style, what do you have selected? Do you have Auto Template expansion selected? What template (upper right) set is selected? Same question about what Language is selected.

    I guess another question would be what is the extension of the file you are editing when you see this behavior.

    Indention is caused by either a template or the indent routine for the language. You might try turning off auto template expansion and see if the behavior changes.

    Thanks,
    Clay

    #23501

    Gorlash
    Participant

    Hi Clay;
    Yes, I’ve never seen this behavior before, it is *really* odd!! And I’ve been using MEW for so many years that I can’t even recall when I started…

    Okay, I’m working with both .c and .cpp files, both show same behavior.
    In ‘Edit Filename Extension Setup’ dialog:
    Indent style = Smart
    Auto-template expansion is selected
    Tab Settings mode are:
    Tab Spacing=4
    Expand to spaces is selected
    both Language and Template are C
    Turning off ‘Auto-template expansion’ did not affect this issue.

    I will post a separate reply to discuss a test file that I created.

    #23502

    Gorlash
    Participant

    // test file
    #include <stdio.h>

    int main(void)
    {
    int idx ;
    if (idx < 5) {
    printf(“idx=%d\n”, idx);
    }
    return 0;
    }

    Okay, on this file, I make the following observations:
    on the ‘if’ line:
    If I put cursor just after the close-paren, (or ON the open brace) hit Enter, it indents to column 21.
    If I put cursor just *after* the open brace, hit Enter, it indents properly (indents 4 from if statement).

    On the printf line:
    If I put the cursor just after the close-paren (on the semicolon), hit enter, it indents to column 21.
    If I put the cursor just after the semicolon, it indents properly.
    If I put the cursor at beginning of idx, hit Enter, it indents to column 21.

    This is *sooo* bizarre !!!

    #23504

    Clay Martin
    Keymaster

    Hi,
    At this point I can only recomend a reinstsall.
    Sorry,
    Clay

    #23508

    Clay Martin
    Keymaster

    Hi,
    Had another thought. Instead of coping the config files you could try using Tools-Customize-Import/Export

    Thanks,
    Clay

    #23510

    Gorlash
    Participant

    Ahhh… interesting …. I’ll try that…

    #23511

    Gorlash
    Participant

    Well, importing Export.mcx from my home machine didn’t work; I *may* not have known quite how to use it??

    But anyway, I then tried copying my current MeConfig.db and Windows.db from home, over-wrote the files on work machine (with the editor closed), then restarted, and now it seems to work fine… sigh… So I’m okay now. I wonder what I did wrong the first time??

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.