Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does nppsnippets respect TABed cursor position #59

Open
BW2001 opened this issue Jun 7, 2023 · 4 comments
Open

Does nppsnippets respect TABed cursor position #59

BW2001 opened this issue Jun 7, 2023 · 4 comments

Comments

@BW2001
Copy link

BW2001 commented Jun 7, 2023

Hello

I have a lot of TABed code and find that the plugin doesn’t respect the initial cursor TABed (or multiple space indent) position for the inserted snippet code -see below. Is there anything I can do to fix this anomaly.

Before cursor

<empty line>
Nameobject(folderName);
BeginFolderN(kSYMBOLDEFS); {kSYMBOLDEFS = 16;}
<empty line>

After cursor

<empty line>
EndFolder;

Some example code

                SetSelect(objH);
                <-cursor
  end;

If I add snippet at cursor position above, I get the following

                SetSelect(objH);
                
Nameobject(folderName);
BeginFolderN(kSYMBOLDEFS); {kSYMBOLDEFS = 16;}
<-cursor                 
                  EndFolder;
  end;
@ffes
Copy link
Owner

ffes commented Jun 9, 2023

Since v1.6.0 snippets should be inserted with the indention, but as mentioned in the release notes, I have only been able to test it for a few languages.

From your report I am not able to spot what language you are using. Could you please tell me, so I can take a closer look.

@BW2001
Copy link
Author

BW2001 commented Jun 12, 2023 via email

@ffes
Copy link
Owner

ffes commented Jun 13, 2023

There are various issues with UDL and plugins (including my Snippets plugin). AFAIK for a plugin it is impossible to properly detect a UDL. Therefore things like adding the right language to a libraries, and apparently indenting (haven't tested it myself yet) don't work. See #43 as well.

@timint
Copy link

timint commented Nov 17, 2023

+1

Looking back at the whitespace before insert position, and prepending it to each and every following linebreak should solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants