-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
Qt Creator 13.0.1
-
None
Unlike Emacs's Alt-Q, QtC's Ctrl-E R does not always take C++ context into account. If you are already in a multi-line comment, it will usually do the right thing and extend the comment with lines prefixed by // and indented correctly, but sometimes, it produces garbage. Most recent example (| indicates cursor position when hitting Ctrl-E R):
#ifndef Q_OS_ANDROID // pthread_cancel may not unwind the cancelled thread's stack, so if a thread cancels itself| Q_CONSTINIT static QBasicMutex terminateMutex; #endif
becomes
#ifndef Q_OS_ANDROID // pthread_cancel may not unwind the cancelled thread's stack, so if a thread cancels itself Q_CONSTINIT static QBasicMutex terminateMutex; #endif
and if I try to prevent it by adding blank lines as delimiters:
#ifndef Q_OS_ANDROID // pthread_cancel may not unwind the cancelled thread's stack, so if a thread cancels itself| Q_CONSTINIT static QBasicMutex terminateMutex; #endif
then that becomes
#ifndef Q_OS_ANDROID // pthread_cancel may not unwind the cancelled thread's stack, so if a thread cancels itself Q_CONSTINIT static QBasicMutex terminateMutex; #endif
expected: only the comment is wrapped, turning the one-line into a multi-line comment:
#ifndef Q_OS_ANDROID // pthread_cancel may not unwind the cancelled thread's stack, so if a thread // cancels itself Q_CONSTINIT static QBasicMutex terminateMutex; #endif