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

Feature request : list editing #265

Closed
PierreMarchand20 opened this issue Jan 18, 2021 · 6 comments
Closed

Feature request : list editing #265

PierreMarchand20 opened this issue Jan 18, 2021 · 6 comments

Comments

@PierreMarchand20
Copy link

Thank you for your extension, it is a must when working with Sphinx on VSCode. I just started using Sphinx, and having played a little bit more with markdown, I miss some features from https://github.com/yzhang-gh/vscode-markdown, in particular: https://github.com/yzhang-gh/vscode-markdown#list-editing

For example: writing a element of a list, then hitting "enter" creates a new element in the list. Hitting twice does not. Hitting "tab" creates a new level in the list, etc.

I do not how difficult it is, but it would be very useful for lists, numbered lists and also list-tables.

@lextm
Copy link
Member

lextm commented Jan 18, 2021

That feature doesn't require complex things like LSP, but simple regular expressions,

https://github.com/yzhang-gh/vscode-markdown/blob/master/src/listEditing.ts

So generally speaking, it should be easy to port the relevant code over.

@lextm lextm added enhancement up for grab Pull requests are welcome. labels Jan 18, 2021
lextm added a commit that referenced this issue Feb 6, 2021
@lextm lextm removed the up for grab Pull requests are welcome. label Feb 6, 2021
@lextm
Copy link
Member

lextm commented Feb 6, 2021

You can test the initial work in release 143.0.0 now. You can create new issues if any bug is found.

@lextm lextm closed this as completed Feb 6, 2021
@PierreMarchand20
Copy link
Author

Thanks! it looks good so far, I will keep you updated.

@justineheritage
Copy link

justineheritage commented Feb 17, 2021

Great feature for unordered lists, but not working well for me for list-tables or ordered lists. With list-tables I'd expect the auto-bullet to do this:

* - some text
  -

But it does this:

* - some text
*

It'd also be nice to be able to leave blank list items in list-tables, or to give the option to allow blank list items entirely. Or an option to disable the list editor entirely would work too - I use list-tables extensively so if it doesn't work for those I'd prefer to just not use it at all and continue to manually edit my lists. As far as I can figure out there's no way to disable or configure the list editor right now but correct me if I'm wrong (relatively new to VSCode).

For ordered lists, it's just not incrementing the number, which is hopefully a more straightforward problem.

1. step 1
1. step 2

@PierreMarchand20
Copy link
Author

PierreMarchand20 commented Feb 17, 2021 via email

@justineheritage
Copy link

justineheritage commented Feb 17, 2021

@PierreMarchand20 I did mean ordered, thank you :) And I didn't see about opening a new issue but I'll do that now.

I definitely prefer the #. markup since it's lower maintenance, but it doesn't always work especially when you include other directives like code-block inside of a list item - the next bullet restarts from 1 when built. So for complex lists I'm typically hard-coding the numbers. Maybe I'm marking it up incorrectly or maybe a Sphinx bug.

Edit: opened #277. Also re-tested ordered lists with code-blocks/multi-paragraph items and either I got better at rst or Sphinx fixed the autonumbering issue, so disregard that piece - I'll use #. from now on.

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