Code indents according to body of #ifdef but ignores other directives?

Given the following code, if I press ENTER at the end of #endif the carat will be indented according to the #ifdef body:

#ifdef _MSC_VER
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif| <- carat before indent

After ENTER:

#ifdef _MSC_VER
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
| <- carat after ENTER

This indentation occurs still several lines later:

#ifdef _MSC_VER
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif

#include <iostream>
#include <string>

#include "precursor.h"
#include "event.h"

#include "handler.h"
| <- carat still indents here

I don't want my carat to be indenting like this. It should follow the indentation of previous line worse case.

0

Please sign in to leave a comment.