In 0.9.9 pressing enter in a block with a list will not create another list line but will create a new block

Hello, I just upgraded from 0.8.16 to 0.9.9 and noticed at least one thing that was different in the previous version I had, namely the behavior when doing lists inside a block.
Example:

New List

  • Item 1 (Enter gets now a new Block)
    New Block

, instead of:

New List

  • Item 1 (Enter)
  • Item 2 (Enter)
  • Item 2.1 (Enter)
  • Item 2.2 (keeps indentation);

I use this kind of Block Lists extensively (and also those with checkboxes that aren’t TODOs, like <* [ ] Text>);

I am wondering if this has become a toggle somewhere in cnifig, if it’s intentional or if it’s a bug.

Please help me out, if possible, to get back the behavior where pressing enter in a list, or even a sub-list in a list, will not create a new block but maintain the indentation for the new sub-list item.

Right click on the block and toggle the number list feature

This just creates a new, numbered block, not a list inside the block.
To re-create the steps that used to work in 0.8.16:

  • create a new block;
  • Shift Enter for a Soft Break;
  • place an asterisk and write some text;
  • Press Enter again ← in 0.8 this used to “catch” the pattern and just create a new line with an asterisk as the first character while in 0.9.9 it just creates a new block;

I can only Shift Enter after each line in the block but that gets me at the begining of the line and doesn’t keep the indentation;

image

I am trying to achieve something like the image above. If I was at the end of the “list 2.2” line and would press enter, in 0.8 that would have created another indented “list 2.3” line, not a completely new block, like 0.9.9 does.

To me this looks like a bug to be frank;

in config.edn do you have DWIM for lists set to true?

 ;; Configure the Enter key behavior for
 ;; context-aware editing with DWIM (Do What I Mean).
 ;; context-aware Enter key behavior implies that pressing Enter will
 ;; have different outcomes based on the context.
 ;; For instance, pressing Enter within a list generates a new list item,
 ;; whereas pressing Enter in a block reference opens the referenced block.
 :dwim/settings
 {:admonition&src?  true        ;; Default value: true
  :markup?          false       ;; Default value: false
  :block-ref?       true        ;; Default value: true
  :page-ref?        true        ;; Default value: true
  :properties?      true        ;; Default value: true
  :list?            false}      ;; Default value: false

if not set it to true

--  :list?            false}      ;; Default value: false
++  :list?            true}       ;; Default value: false

Hmm, I had everything in this section commented out in the .edn file :-/

 ;; dwim (do what I mean) for Enter key when editing.
 ;; Context-awareness of Enter key makes editing more easily
 ; :dwim/settings {
 ;   :admonition&src?  true
 ;   :markup?          false
 ;   :block-ref?       true
 ;   :page-ref?        true
 ;   :properties?      true
 ;   :list?            true
 ; }

I un-commented the section out and now Logseq behaves as expected. Thank you for taking time to answer this, it’s a saver for me.

PS: is it possible that the dwim section got commented out after the upgrade? I will have a look on the backup to see if it was un-commented before but, as long as it worked before, i expect it was not commented :-/

No, the default value changed. Before the new numbered list features the default value for the list was true. After the release, the default was switched to false.

Since it was commented out in your config you were using the default which is now false and you have to overwrite it.

I recommend updating your config.edn template:

I don’t find any documentation on updating the config.edn template nor do I find a “templates” folder in logseq so I have to ask what does this mean? I hope it’s not overwriting my config.edn in the grapgh folder as that has modifications I made in some sections to suit my workflow.

there is no automated way to do it. The template is the one I linked you. You can overwrite your exiting one and update the changed values according to your needs. You can also just keep using your existing one there is no issue either way. The updated template has more documentation and might have some new options that were added after you created your graph. In the future most of these will be configurable via the settings UI.

ok, thanks. I will do a diff between the two to see what custom stuff I made over time.

1 Like

One more question as long as we are at this:
Is there any way to have a behavior of the bullets within a block to be indented and out-dented via the same mechanism as bullets themselves (Tab and Shift-Tab)? That would mean context awareness for In-Block Tab and Shift-Tab.

This functionality would be very useful for blocks where I have some project-based lists with sub-lists. So, if I have the following list:

- List 1
 * Item 1
  * Sub-Item 1.1
  * Sub-Item 1.2
   * Sub-Item 1.2.1
 * Item 2

, When I press the “Context-Aware” Enter and it creates a new list item on the same indentation level as the one before, I would like, instead of moving the cursor and adding a space (to create the Markdown indentation for a sub-list) or deleting a space (to out-dent), to just use the usual Tab and Shift-Tab (so these should also be Context-Aware).

If it’s not possible, where would I be able to make a feature request for this and how would that process go?

Currently not possible. Requires changes to the parser. Submit a feature request in the feature request section:

Based on votes or developer interest, it will be added or not. Also, logseq is an open-source project. Everyone is welcome to contribute, so someone might want to take the time to implement it.

ok, did, hopefully it’s explained ok:

I wish I was able to code and try to implement it myself… but I am not so yeah, if there is any interest in this hopefully it won’t be too much of a hassle to implement quickly by someone. Context-Aware everything should be pretty high on the priority list for improved functionality i guess.

1 Like