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

Newlines #23

Open
YodaEmbedding opened this issue Oct 10, 2021 · 1 comment
Open

Newlines #23

YodaEmbedding opened this issue Oct 10, 2021 · 1 comment

Comments

@YodaEmbedding
Copy link

YodaEmbedding commented Oct 10, 2021

Instead of outputting newlines like:

a:   {⏎    "apple": "noun",⏎    "of": "preposition",⏎    "my": "adjective",⏎    "eye": "noun",⏎}⏎

it might be nice to see something like:

a:   {
         "apple": "noun",
         "of": "preposition",
         "my": "adjective",
         "eye": "noun",
     }

If there are too many lines, truncate:

a:   {
         "apple": "noun",
         "of": "preposition",
   ...

This would be a config option, g:peekup_new_lines = "split".

(On a similar note, it might be a good idea to truncate long lines anyways.)

@gennaro-tedesco
Copy link
Owner

gennaro-tedesco commented Oct 10, 2021

Hello, thank you for your suggestion! I remember considering it initially but discarding it later on because of spacing in the floating window: with new lines it becomes very hard to peek a glance at the various registers. This said, as you mentioned, we can make it an option that users can select.

These days I will be unable to make the changes, however you might yourself propose a merge request by just changing this function; in particular, replace this character with a new line. What I suspect we must be careful to test is that these newlines characters do not break the parsing whilst copy and pasting (after selecting from registers), so let us make sure the behaviour is still what we expect.

Regarding truncation of long lines this may be much more cumbersome because the way the content is being pasted from the floating window is by highlight + selection, therefore if the text itself is truncated the truncation will be copied (not the original text); of course one could work around it, but it will require a much bigger change in the codebase (not sure it is worth the pain).

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

No branches or pull requests

2 participants