Tab vs Space for .rs (Rust)

  • First (and I should have done that a while ago), thank you so much for making Notepad++!

    Then the quick question: I can’ seem to find the Tab setting option in “preferences,language” to allow Rust to use spaces instead of tabs. This is a(nother) pretty useful features but the .rs extension seems to be missing (7.9.1 x64)


  • Can’t confirm.

    Go to Settings > Preferences > Language
    On the right side there is Tab Settings, where you can find “rust” and then uncheck “Use default value” and set your desired tab settings.

  • Hello, @philippe and All,

    Simply :

    • Select the menu option Settings > Preferences... > Language (on your LEFT ) > Tab Settings ( on your RIGHT )

    • With the mouse, move down to language rust

    • Untick the Use Default Value square box

    • Tick the Replace by space box

    • Click to the Close button

    Best Regards,


  • I know it sounds like a stupid question - I’m already using different tab settings for my various languages, it’s just that rust is not in the menu. So that you don’t think I’m too much deranged, here is a screenshot :-)

    Capture d'écran 2021-02-05 19.00.13.png

  • @Philippe said in Tab vs Space for .rs (Rust):

    it’s just that rust is not in the menu.

    But it is:

    If it’s not in your menu, then you either have a really old version of Notepad++ (go to ? menu, select the Debug Info entry, and copy the text and paste it here), or you have upgraded Notepad++ to a relatively-recent version, but some of your configuration files have not been updated, then Notepad++ might not see that Rust exists as an option. What you paste for the Debug Info in your next reply will help inform us which way to take the debug process at this point.

    Notepad++ v7.9   (64-bit)
    Build time : Sep 22 2020 - 03:19:04
    Path : C:\Users\Peter\AppData\Local\Temp\notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : ON
    OS Name : Windows 10 Home (64-bit) 
    OS Version : 2004
    OS Build : 19041.746
    Current ANSI codepage : 1252
    Plugins : mimeTools.dll NppConverter.dll NppExport.dll 

    (or Alt+PrintScreen and paste the image of your dialog here)

  • Per initial post, it’s 7.9.1 x64. I believe you it is in your version (how could I not) but that’s also why I put a screenshot of mine to show you that I’m not (yet) totally dumb and it is not in mine (although I have rust syntax highlighting). I’ll do a full update / re-install then!

    Notepad++ v7.9.1 (64-bit)
    Build time : Nov 2 2020 - 01:07:46
    Path : C:\Program Files\Notepad++\notepad++.exe
    Admin mode : OFF
    Local Conf mode : OFF
    OS Name : Windows 7 Ultimate (64-bit)
    OS Build : 7601.24312
    Current ANSI codepage : 1252
    Plugins : ComparePlugin.dll HexEditor.dll mimeTools.dll NppConverter.dll NppExport.dll NPPJSONViewer.dll

  • @Philippe ,

    Posting the full Debug Info is always better than just the “version number” (it can give other hints, like install location, local-conf-vs-appdata, admin mode, and plugins, all of which can influence things). Thanks for providing that.

    In this instance, I would say that it’s probably one of your %AppData%\Notepad++\*.xml files that’s causing “Rust” to not be shown in the Settings > Preferences > Language : TabSettings options. Those files don’t get reset on new installations, unless you delete the %AppData%\Notepad++\ folder – but if you’ve got a lot of personalized settings, you probably don’t want to do that.

    I ran a quick experiment, and copied langs.xml to x-langs.xml (to save a backup of it), then removed the “rust” section from between “ruby” and “scheme”. When I reloaded, “rust” was no longer in that preferences section. So you might want to follow these steps

    1. Close all Notepad++ windows
    2. Open %AppData%\Notepad++\langs.xml in Notepad++
    3. Add the following between “ruby” and “scheme”
          <Language name="rust" ext="rs" commentLine="//" commentStart="/*" commentEnd="*/">
              <Keywords name="instre1">abstract as async become box break const continue crate do dyn else enum extern false final fn for if impl in let loop macro match mod move mut override priv pub ref return self static struct super trait true try type typeof unsafe unsized use virtual where while yield</Keywords>
              <Keywords name="instre2">bool char f32 f64 i128 i16 i32 i64 i8 isize str u128 u16 u32 u64 u8 usize</Keywords>
              <Keywords name="type1">Self</Keywords>
              <Keywords name="type2" />
              <Keywords name="type3" />
              <Keywords name="type4" />
              <Keywords name="type5" />
    4. Save and exit Notepad++ without doing anything else.
    5. Reload Notepad++.
    6. Check the settings, and see if rust is available.

  • That was definitively it, thank very much! I don’t know what I did which prevented the update to be made especially knowing that rust syntax highlighting was working.

  • Maybe, some sort of the installer bug? What if it didn’t overwrite the old langs.xml?

  • @mere-human said in Tab vs Space for .rs (Rust):

    What if it didn’t overwrite the old langs.xml?

    Isn’t that the idea?
    If user has changed some settings, err on the side of caution and don’t blow it away?

  • The age-old conundrum of how to preserve the advanced users’ custom settings while allowing the installer to stomp an out of date or corrupted settings file for a newbie or during an update. In a case like this, you don’t want the installer indiscriminately stomping the file and corrupting customizations. But then you “loose updates” for a guy like Philippe! Perhaps the installer could detect a modified config and give us the option of A) use new, B) preserve user, or C) attempt a merge. The last would have worked fine for Philippe as the Rust entry was new and would have been inserted between his (possibly customized) lines in the existing file.

  • @snmnarum said in Tab vs Space for .rs (Rust):

    Perhaps the installer could detect a modified config and give us the option of A) use new, B) preserve user, or C) attempt a merge.

    It probably comes down to how much time devs have to accomplish all things. Time is finite, after all, and these devs have to carve off a section of their free time to keep devving on Notepad++ – I’m sure they all have day jobs and families preventing them from 24 / 7 N++ dev!

  • @snmnarum said in Tab vs Space for .rs (Rust):

    Perhaps the installer could detect a modified config and give us the option of A) use new, B) preserve user, or C) attempt a merge.

    You can create a feature request for this. Having at least A) and B) would be nice. However, C) will not be easy to implement.

Log in to reply