File ignoring tab settings
-
I am editing an SQL file. My default tab setting is to use 2 spaces. There is no language override tab setting for SQL.
When I open most files, Notepad++ respects my settings. However when I open one specific file, Notepad++ uses 4 spaces to indent. Changing my default tab settings does nothing to affect this file.
It seems to be trying to auto-detect the tab setting in use in the file, and getting it wrong.
Is there a way to disable this feature?
Is there a way to override the tab setting for a specific file?Notepad++ v8.7.5 (64-bit)
Build time : Dec 21 2024 - 05:13:03
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : “D:****\Course Data Query.sql”
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : OFF
Placeholders : OFF
DirectWrite : OFF
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : ON
OS Name : Windows 10 Pro (64-bit)
OS Version : 22H2
OS Build : 19045.5487
Current ANSI codepage : 1252
Plugins :
ColumnTools (1.4.4.1)
ComparePlugin (2.0.2)
JSMinNPP (1.2312)
mimeTools (3.1)
nppAutoDetectIndent (2.3)
NppConverter (4.6)
NppExport (0.4)
XMLTools (3.1.1.13)
zoomdisabler_x64 (1.2) -
@wobatt said in File ignoring tab settings:
There is no language override tab setting for SQL.
Are you certain? Because I see it right here:
So if you want to override with 2 spaces, you would uncheck the Use default value, change the size to
2
instead of4
, and set whether you want it to use the Tab character or Space character(s) when you hit the Tab key.Plugins :
…
nppAutoDetectIndent (2.3)Hmm… I’ve never really used that plugin. But it’s description of itself says if it sees tab characters, it will use tab characters, if it sees N-space indentation, it will use N-space indentation, and if it cannot figure it out, it should use Notepad++ settings when you indent using the tab key.
So that specifically says that it tries to guess the setting used in the file – it’s the plugin, not Notepad++, which is doing that guessing. And I don’t know if that plugin has a way to turn off its guessing on a per-language; check any settings it may give you; and if you don’t find it, you can disable that plugin by renaming
C:\Program Files\Notepad++\Plugins\nppAutoDetectIndent\
folder to something else (suggest adding.off
) and restarting Notepad++(In general, I avoid features or plugins that involve “guessing”, because I’ve never found such “guessing” algorithms to match my use cases, whether it’s N++'s native character-set auto-detect or something like this indentation-detection.)
-
@PeterJones Thanks - I had completely forgotten that I had that plugin installed, and somehow also missed it when posting the question. Disabling the plugin resolved the issue.