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

Trailing carriage returns are removed on exit #168

Open
mikeyww opened this issue Aug 3, 2020 · 11 comments
Open

Trailing carriage returns are removed on exit #168

mikeyww opened this issue Aug 3, 2020 · 11 comments
Assignees

Comments

@mikeyww
Copy link

mikeyww commented Aug 3, 2020

Trailing carriage returns are removed from text to paste when Lintalist exits.

@lintalist lintalist self-assigned this Aug 4, 2020
@lintalist
Copy link
Owner

Yes, I know but didn't bother me. I always use the https://lintalist.github.io/#c-plugin [[c=\n|2]] for example.

I'll have a look at how I can keep them in and either set that as default or as optional "keep trailing white space" - might take a little while before I get to it.

@mikeyww
Copy link
Author

mikeyww commented Aug 4, 2020 via email

@lintalist
Copy link
Owner

lintalist commented Aug 14, 2020

I think this may be the solution, only briefly tested, so your mileage may vary.

  1. backup your bundles or your entire lintalist folder so you don't loose anything :)
  2. download ObjectBundles.ahk below and copy it to include\ObjectBundles.ahk replacing the file that is there.
  3. (Re)start lintalist

It should now keep leading and trailing spaces & new lines in bundles even after restarting. If this works for you - I'll try it out for a few days as well - I'll make it optional behavior and include it in the next release.

Edit: new file
ObjectBundles.zip

@mikeyww
Copy link
Author

mikeyww commented Aug 14, 2020 via email

@mikeyww
Copy link
Author

mikeyww commented Aug 14, 2020 via email

@lintalist
Copy link
Owner

My bad, left in debug MsgBox. Updated it above. You will also notice that other snippets are now messed up which I didn't catch with my test bundle. So be sure to close lintalist, copy back your bundles from your backup, and update the ObjectBundles.ahk with the one above. Start lintalist.

Should work better I hope. 🤞
Note that it now only keeps trailing white space (tabs, spaces, newlines) but those at the start of a snippet are still removed by default (too tricky to fix I think)

@mikeyww
Copy link
Author

mikeyww commented Aug 14, 2020

Still messy. The program seems to have added leading and trailing spaces to every item. It is also still showing "\n" in the "Paste" column of the main display.

@lintalist
Copy link
Owner

Are you sure you closed lintalist, copied your backup bundles back, copied the new ahk file and THEN restarted lintalist? The previous version messaged up snippets. It works here as far as I can tell with snippets with no part2 it will no longer show
\n in the second column.

Ah well, failed experiment it seems. Using [[c]] works reliably afaik although more work to add it to snippets of course :(

@mikeyww
Copy link
Author

mikeyww commented Aug 14, 2020

Yep, just tried it again; screenshot of the "\n" is available. When I reversed the procedure, everything is the way it was earlier.

Thanks for trying.

@lintalist
Copy link
Owner

I think that is because there is now an actual new line in those part 2s, so if you edit one and remove any trailing ones it should no long display it for those snippets. Not a solution of course.

@mikeyww
Copy link
Author

mikeyww commented Aug 15, 2020

I didn't put the newlines there. They appeared. The leading and trailing spaces also still remain in the Paste items. These are bugs in the code. When I revert, those problems disappear.

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

2 participants