C/C++エディタ if文行末 { 記号の後にTABを入力するとコードが崩れる - by tara temp

Status : 

 


1
0
Sign in
to vote
ID 771561 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 11/18/2012 6:49:22 PM
Access Restriction Public

Description

例えば、以下のコードのif文の{の後にコメントを入力しようと、TABを入力すると
新たに}が入力され、既に入力していたコードがブロック外に消えてしまします。
インテリセンスを無効にしてもコードは消えませんが、似たような症状になります。

・TAB入力前の様子
    if (len >= 10) {   <-TABを入力すると、新たに}が挿入され、コードが崩れる。
        len = 10;
    }

・TAB入力後の様子
    if (len >= 10) {   
    }    <-新たな } が自動挿入され、入力していたコードが崩れる。
        
        len = 10;
    }
Sign in to post a comment.
Posted by Oleg [MSFT] on 1/18/2013 at 6:01 PM
Hello,

Thank you for taking the time to report this issue. Pressing Tab immediately after '{' invokes the '{' code snippet. The '{' code snippet is one of the Code Snippets provided by Visual C++. The rest of the snippets can be viewed by opening the Code Snippets Manager in the Tools menu, and selecting C++ in the dropdown. Each code snippet is stored in a different file on disk; the location of the file is shown in the Code Snippets Manager window.

Please do not hesitate to write back if you have any additional questions.

Thank you,

Oleg Kharitonov
Visual C++
Posted by Microsoft on 11/30/2012 at 1:41 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 11/29/2012 at 10:58 AM
この度はフィードバックをお送りいただき、誠にありがとうございます。 現在、お送りいただきました報告内容に基づき問題を確認中ですので、しばらくお待ちください。 よろしくお願いいたします。

[Problem Description]:
For example, when I pressed TAB to enter a comment after { of if sentence for the code below, a new } was entered and the already entered code disappeared out of the block. Though the code did not disappear even if the IntelliSense was disabled, a similar symptom occurred. ・Situation before entering TAB: When if (len >= 10) { <-TAB was entered, a new } was inserted and the code corrupted. len = 10; } ・Situation after entering TAB: When if (len >= 10) { } <- was entered, a new } was automatically inserted and already entered code corrupted. len = 10; }

[Repro Steps]:
1. Enter the following code in C editor.
if (len >= 10) {
len = 10;
}
2. Move a cursor to after { of if sentence and enter the TAB key.
3. As shown below, a new } is inserted automatically and the code entered in 1 is corrupted.
if (len >= 10) {
}
len = 10;
}
[Actual Results]:
When the TAB key is entered at the end of if sentence, a new } is inserted in the next row and a comment cannot be entered.

[Expected Results]:
At the end of if sentence, a blank space is inserted due to the TAB key entry.
When the TAB key is entered at the end of if sentence, a new } is inserted in the next row and a comment cannot be entered.
At the end of if sentence, a blank space is inserted due to the TAB key entry.
Posted by Microsoft on 11/18/2012 at 7:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)