Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Tab vs Space for .rs (Rust)

    General Discussion
    7
    13
    377
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Philippe
      Philippe last edited by Philippe

      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)

      Thanks

      1 Reply Last reply Reply Quote 0
      • Daniel Fuchs
        Daniel Fuchs last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • guy038
          guy038 last edited by

          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,

          guy038

          Philippe 1 Reply Last reply Reply Quote 2
          • Philippe
            Philippe @guy038 last edited by

            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

            PeterJones 1 Reply Last reply Reply Quote 0
            • PeterJones
              PeterJones @Philippe last edited by PeterJones

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

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

              But it is:
              11b90685-1f8b-401f-a7aa-34b8f78bfc02-image.png

              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)

              1 Reply Last reply Reply Quote 2
              • Philippe
                Philippe last edited by Philippe

                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

                PeterJones 1 Reply Last reply Reply Quote 0
                • PeterJones
                  PeterJones @Philippe last edited by

                  @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" />
                        </Language>
                    
                  4. Save and exit Notepad++ without doing anything else.
                  5. Reload Notepad++.
                  6. Check the settings, and see if rust is available.
                  1 Reply Last reply Reply Quote 5
                  • Philippe
                    Philippe last edited by Philippe

                    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.

                    1 Reply Last reply Reply Quote 0
                    • mere-human
                      mere-human last edited by

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

                      Alan Kilborn 1 Reply Last reply Reply Quote 0
                      • Alan Kilborn
                        Alan Kilborn @mere-human last edited by

                        @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?

                        1 Reply Last reply Reply Quote 0
                        • snmnarum
                          snmnarum last edited by

                          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.

                          Alan Kilborn mere-human 2 Replies Last reply Reply Quote 0
                          • Alan Kilborn
                            Alan Kilborn @snmnarum last edited by

                            @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!

                            1 Reply Last reply Reply Quote 2
                            • mere-human
                              mere-human @snmnarum last edited by

                              @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.

                              1 Reply Last reply Reply Quote 2
                              • First post
                                Last post
                              Copyright © 2014 NodeBB Forums | Contributors