This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 196567 - Text editor fails to honor indentation rules in certain cases.
Summary: Text editor fails to honor indentation rules in certain cases.
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-11 06:02 UTC by sylar
Modified: 2011-03-16 09:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sylar 2011-03-11 06:02:46 UTC
After the source file that I'm currently editing reaches a certain size, a size that I have not determined yet, the editor fails to honor the indentation rules
for the rest of the file. I have created a youtube video demonstrating what I'm talking about, link: http://www.youtube.com/watch?v=XWuvQZG9ZZQ .

I am able to reproduce this %100 on 6.9, 6.9.1, and 7.0b2
Comment 1 Alexander Simon 2011-03-11 09:16:19 UTC
Please, provide code example as text.
Comment 2 sylar 2011-03-11 09:31:05 UTC
/* list.h - Simple doubly linked list implementation.
 * Copyright (c) 2011, Keith Plant. All rights reserved.
 *
 * This file is part of devnull.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *      1. Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *
 *      2. Redistributions in binary form must reproduce the above copyright
 *      notice, this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 *
 *      3. Neither the name of the author nor the names of its contributors may
 *      be used to endorse or promote products derived from this software
 *      without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
 
 #if !defined(LIST_H)
 #define LIST_H
 
#include <stddef.h>
#include "prefetch.h"

/**
 * struct list_head - linked list entry structure
 * @next: the next entry in the list
 * @prev: the previous entry in the list
 */
struct list_head {
	struct list_head *prev, *next;
};

static inline void list_head_init(struct list_head *head)
{
	head->next = head;
	head->prev = head;
}

#endif /* !defined(LIST_H) */
Comment 3 sylar 2011-03-13 19:40:18 UTC
I'm not sure if this information makes any difference or not but I can reproduce this bug on 64-bit windows and 64-bit linux.
Comment 4 Alexander Simon 2011-03-13 20:00:16 UTC
Please, provide text that you typed and position where you type d text and describe what is wrong.
Comment 5 sylar 2011-03-13 20:59:59 UTC
The only thing special about the text that I was inputting was that they were functions with multi-line arguments.

The first function I entered was before the existing list_head_init and was something similar to:
void a(int arg1,
       int arg2)
{
}

The editor properly aligned the arguments but, when I enter a very similar function after the list_head_init function, the multi-line arguments are not
automatically aligned.
Comment 6 sylar 2011-03-14 01:29:36 UTC
Or even the very same function for that matter.
Comment 7 sylar 2011-03-14 23:57:29 UTC
Were you able to replicate this?
Comment 8 Alexander Simon 2011-03-15 05:24:22 UTC
bug confirmed.
Comment 9 Alexander Simon 2011-03-15 05:33:39 UTC
Simplified example:
----------8<-------------
struct list_head {
    struct list_head *prev, *next;
};

int foo(int a, int b) {
}

int boo(int a, int b) {
}
----------8<-------------
Inserting new line before second argument of boo is wrong indented.
Comment 10 Alexander Simon 2011-03-15 09:38:31 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/bbe89b428596
Comment 11 Quality Engineering 2011-03-16 09:43:29 UTC
Integrated into 'main-golden', will be available in build *201103160400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/bbe89b428596
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #196567 Text editor fails to honor indentation rules in certain cases.