0x7c13 / Notepads

A modern, lightweight text editor with a minimalist design.
https://www.NotepadsApp.com
MIT License
8.55k stars 469 forks source link

[Bug] #1246

Open recvmsgs opened 1 year ago

recvmsgs commented 1 year ago

BUG: Bad indentation (not only) after pasting

When pasting text indented by spaces, it's displayed properly (verbatim) in Visual Studio Code regardless of settings, same in MS Notepad. In Notepads, only the first line is indented properly, the rest has indentation reduced to indentation-expected/2.

This happens whether in my Notepads settings I set indent to 2 or 4 spaces.

After closing the file in Notepads and reopening it in Notepads everything is magically displayed correctly... ...until I do some editing where Auto-Indent feature that I can't disable makes me again indent by spaces manually just to fix bad fixes by Notepads.

I've also noticed unindenting by Shift-Tab then changes (breaks) indentation throughout the document and indenting back with Tab, then unindenting, makes it switch semi-randomly between 1,2 and 4 spaces.

To me it all seems to be related to Notepads' implementation of Auto-Indent feature. I really hope in some next version I can turn it off.

To Reproduce Paste this text and observe, if needed compare with behavior within MS Notepad or VS Code:

        - task: AzureCLI@2
          continueOnError: true
          displayName: "Reset-Cancel-Jobs"
          inputs:
            failOnStderr: false
            azureSubscription: $(AzSc)
            scriptType: bash
            scriptLocation: inlineScript
            inlineScript: |
              sudo apt -y install sysvbanner >/dev/null 2>&1
              # set -vx
              banner LOGIN
              echo "$(System.AccessToken)" | az devops login

Expected behavior Indentation as displayed above in this Report / To Reproduce.

Screenshots (At the end of Report)

Desktop (please complete the following information):

Additional context (Notepads on the left side of screenshot, MS Notepad with same file on the right)

notepads-bug