#164 NB line number on/off doesn't work after disable jVi

NetBeans (62)

After installing jVi in NetBeans 7.1.1, the usual right-click-in-the-gutter mechanism for turning line numbering on and off in NetBeans editor windows no longer works. The menu item switches between checked and un-checked states, but line numbers in the gutter are unaffected. Line numbers can only be turned on or off by the jVi command :set [no]nu. Disabling the jVi plugin does not restore the NetBeans behavior.


  • Ernie Rael

    Ernie Rael - 2012-03-06

    Overriding the NB control is by design. Use the vi commands.

    However "Disabling the jVi plugin does not restore the NetBeans behavior." is certainly a bug. Changing Summary

  • Ernie Rael

    Ernie Rael - 2012-03-06
    • summary: jVi overrides NB line number on/off control --> NB line number on/off doesn't work after disable jVi
  • Ernie Rael

    Ernie Rael - 2012-03-06
    • priority: 5 --> 6
  • Ernie Rael

    Ernie Rael - 2013-08-27

    In NetBeans, there are several ways to save editor preferences and some are hierarchically related. Regarding this bug, there are MimePreferences and GlobalPreferences. For line numbers, the editor window code checks MimePreferences first and if not set, then checks GlobalPreferences. The NB "line numbers" option sets a GlobalPreferernce. The jVi codes sets the MimePreference. As indicated, MimePreference overrides GlobalPreference.

    Here is a specific example of the problem. Assume the NB option for line numbers is off. If you are editing a java file with jVi and you do set nu, then all java files have line numbers displayed. Other file types, for example html, do not have line numbers. If you change the NB line number option, java files are not affected and other file types, for example html files, are affected.

    I have not found a programatic way to delete a MimePreference option once it has a vale. If I could, then when jVi is disabled, I could delete all the related MimePreferences that jVi has settings for and that would fix this problem.

    You can manually delete the MimePreferences; note that this should only be done while NetBeans is not running.

    If you want to see all the files that have line number MimePreference set you can do

    cd <userdir>/config/Editors
    grep -l line-number-visible */Preferences/*

    and you might see something like


    This indicates that the x-java mimetype has the option set by jVi. You can edit the file and remove the 3 lines to get rid of the MimePreference

    <entry javaType="java.lang.Boolean" name="line-number-visible" xml:space="preserve">
  • Ernie Rael

    Ernie Rael - 2013-08-27
    • status: open --> pending-wont-fix
  • Ernie Rael

    Ernie Rael - 2013-08-27

    jVi could start using the GlobalPreference for this option, just like the NB option does. Then clean installs would behave ok. Comments?

    If this was done, the MimePreferences would still have to be manually fixed; but once this was done, the problem would no longer occur.

  • Ernie Rael

    Ernie Rael - 2013-08-28
    • status: pending-wont-fix --> open-fixed
  • Ernie Rael

    Ernie Rael - 2013-08-28

    The MimePreferences can be deleted programatically (I wasn't thinking...).

    Fixed in Mercurial, available next release.

    Only the mimeTypes that have been edited by jVi are cleaned up. This matters for an existing install.

  • Ernie Rael

    Ernie Rael - 2014-12-19
    • Status: open-fixed --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks