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 132695 - Right margin settings is ignored after IDE restart
Summary: Right margin settings is ignored after IDE restart
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: CSL (API & infrastructure) (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords:
: 115787 123215 129096 138321 (view as bug list)
Depends on: 90403
Blocks:
  Show dependency tree
 
Reported: 2008-04-13 09:20 UTC by Petr Jiricka
Modified: 2009-02-19 20:45 UTC (History)
1 user (show)

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 Petr Jiricka 2008-04-13 09:20:38 UTC
Reproduces in NB 6.1 RC1

1. Create a (Java) project
2. Create a new JavaScript file
3. In Tools -> Options -> Editor -> Indentation, change Right Margin to 100.
4. Restart the IDE

=> Margin is set to displayed at column 80 in the JavaScript file. This seems to be a common behavior of all GSF-based
languages (including PHP, Ruby, ...), for Java files this works correctly.
Comment 1 Torbjorn Norbye 2008-04-14 17:15:19 UTC
There's something weird going on here.  After changing the right margin to 30, and closing and reopening the Java
editor, it indeed shows the text limit line at 30. But when I changed my Java formatting options to wrap lines for long
parameter lists, and I press ctrl-shift-f twice to reformat, it reformatted not only the buffer but moved the text limit
line back to 80! And the option still says 30! I changed it to 40 and now it has no effect - reopening the file doesn't
help.

I looked at the Options editor code (options.editor/org/netbeans/modules/options/indentation/IndentationModel.java), and
it looks like the right margin is set by calling the
  setTextLimitWidth()
method on the editor options object for each mimetype.

There's some hardcoded logic there for Java and JSP -- is that why this works better for the Java file? 

Do I have to implement a setTextLimitWidth method on my editor options class for this to work properly?  I don't see one
in java.editor/java.source or xml.text.



Comment 2 Vitezslav Stejskal 2008-04-21 11:25:50 UTC
IMO this is some sort of inconsistency caused by the fact that all GSF languages share one instance GsfOptions and the
fact that each time you start the IDE this instance can be created for different mime-type (language). Therefore
settings stored in one IDE session may seem to be reverted after restart simply because the GsfOptions instance
currently used was created for different mime type than in the previous IDE session. Once we get rid of BaseOptions this
problem will be solved too.
Comment 3 erwann 2008-05-09 14:43:00 UTC
same problem here with ruby files in 6.1 final version, the right margin line disappear at 130 in the preview panel but
the line remains in the editor.

Product Version: NetBeans IDE 6.1 (Build 200804211638)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; fr_FR (nb)
Userdir: C:\Documents and Settings\erwann\.netbeans\6.1
Comment 4 Karthikeyan Rajeswaran 2008-05-27 02:44:27 UTC
*** Issue 115787 has been marked as a duplicate of this issue. ***
Comment 5 Karthikeyan Rajeswaran 2008-05-27 02:45:05 UTC
*** Issue 123215 has been marked as a duplicate of this issue. ***
Comment 6 Karthikeyan Rajeswaran 2008-05-27 02:45:53 UTC
*** Issue 129096 has been marked as a duplicate of this issue. ***
Comment 7 Vitezslav Stejskal 2008-06-24 19:29:13 UTC
This seems to be working fine after fixing issue #90403. Please reopen if you still have problems with it.
Comment 8 Torbjorn Norbye 2008-06-26 17:15:11 UTC
*** Issue 138321 has been marked as a duplicate of this issue. ***
Comment 9 Martin Krauskopf 2009-02-02 14:32:06 UTC
'ruby/gsf -> editor/csl' mass-move to be able to deleted gsf/ruby. Having to
change the version and platform of all closed moved issues to the same due to
Issuezilla deficiencies - choosing version == 6.5 and TM = 7.0.