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

fix(promo): promote/demote range + keybinds #1487

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

benlubas
Copy link
Contributor

what it says on the tin. These were broken/removed a while ago. Presumably due to concealer changes but I'm not sure. Someone asked about bringing them back today, so here they are.

The re-indentation code in this module seems to struggle a little though. Not sure what's up with that.

@mtrajano
Copy link
Contributor

Looks to be working fine for me. Tried indenting several nested lists with no problem, what issues did you run into re: the indentation?

@vhyrro
Copy link
Member

vhyrro commented Jun 27, 2024

@mtrajano the issue stems from e.g. paragraphs. It seems that the indentation is cumulative: with the following snippet:

* One
** Two
     content.

Doing a ranged promotion indents the paragraph twice as far:

** One
*** Two
              content.

This isn't the absolute end of the world, but would be nice to have fixed somehow 🤔

edit: wow, github rendering makes the indentation look really bad in the code block. it's less bad in a Norg buffer haha

@benlubas
Copy link
Contributor Author

@mtrajano @vhyrro

Now this behaves itself a little better. There is still one behavior that might be unexpected. If you promote:

* heading
  Normal text

Normal text is correctly indented. But if you promote:

normal text
- list item

Then "normal text" is indented, while "list item" is promoted. However, this case:

- list

new paragraph
- new list

"new paragraph" is not indented.


I think this behavior is fine. It allows visual >/< to still work like normal in norg documents when you don't highlight anything promote-able. And if you only highlight the things you want to promote without extra paragraphs, there's no problem with it.

@mtrajano
Copy link
Contributor

Changes make sense to make, there's just a random print statement there

@vhyrro
Copy link
Member

vhyrro commented Jun 28, 2024

@benlubas the new behaviour is much better than what we had previously, so that sounds good enough for the time being. Running out of time today, but I'll revisit this PR tomorrow :)

Copy link
Member

@vhyrro vhyrro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a single nitpick, other than that no other issues :)

lua/neorg/modules/core/esupports/indent/module.lua Outdated Show resolved Hide resolved
@vhyrro vhyrro merged commit 0255c2d into nvim-neorg:main Jul 5, 2024
5 of 6 checks passed
@benlubas benlubas deleted the push-rustnlyswurm branch July 5, 2024 21:23
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

Successfully merging this pull request may close these issues.

3 participants