0

Often the indent I see visually differs from what happens if I copy-paste the text to anywhere else. In such cases, backspacing the indentation in N++ deletes more than one whitespace. I'm unsure how exactly to MRE, but hopefully this behavior is known - how to disable it? (If it's not known, feel free to close.)

Windows 11 (CR LF), UTF-8, Notepad++ v8.5.4 (64-bit).

3
  • Pure guess - it's changing 4 spaces to a tab.
    – Tetsujin
    Commented Oct 6, 2023 at 12:08
  • 2
    @Tetsujin more precise, its changing 1 tab to 1 space. In the settings, you can set it so that instead of a tab, 4 spaces are placed, that should fix it. Keep in mind that HTML does not support spaces as more than one spaces and will instead merge them as 1 space. Use &nbps; instead.
    – LPChip
    Commented Oct 6, 2023 at 12:13
  • @LPChip Yes, thanks. I've not tested enough yet but I'll accept as answer (with my screenshot if you prefer). Commented Oct 6, 2023 at 12:26

1 Answer 1

1

You have tabs, and when you copy the text, even though they appear as 4 spaces, and notepad will make it appear that they are spaces, they are tabs.

So when you paste the text, they get pasted as tabs. For Notepad++ that aligns every 4 spaces, but another app may not understand tabs at all or have different identations.

In order to keep it cross compatible, you can set a setting in Notepad++ to replace tabs with spaces, such the identation is kept as seen in Notepad++.

image

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .