Skip to content

fix(query): continue innermost list item with exact indent on enter - #2699

Open
youssefadly237 wants to merge 6 commits into
Myriad-Dreamin:mainfrom
youssefadly237:nest-list
Open

fix(query): continue innermost list item with exact indent on enter#2699
youssefadly237 wants to merge 6 commits into
Myriad-Dreamin:mainfrom
youssefadly237:nest-list

Conversation

@youssefadly237

@youssefadly237 youssefadly237 commented Aug 26, 2026

Copy link
Copy Markdown
  • continue the innermost trailing list/enum item instead of the outermost ancestor when enter is pressed in whitespace after nested lists
  • preserve exact leading whitespace (tabs) of the item line in inserted edits
  • middle node list (WIP I hope)
  • added dedent & empty delete

other problems I found

  • manual listing expand to + instead of keeping the count

    1. something|
    
    // suppose that | is the cursor clicking enter would produce
    1. something
    + |
  • this link is outdated and mentioned in the file (twice)

    //! <https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.md#on-enter>
    

nvim port https://github.com/youssefadly237/dotfiles/blob/typst-enter/dot_config/nvim/lua/custom/typst-on-enter.lua

thanks for maintaining tinymist

AI assisted: opencode2 glm-5.3-flash 0x Alpha Free (when it was available XD)

@youssefadly237
youssefadly237 marked this pull request as ready for review August 27, 2026 00:31
@youssefadly237
youssefadly237 marked this pull request as draft August 27, 2026 01:27
@youssefadly237
youssefadly237 marked this pull request as ready for review August 27, 2026 07:51
youssefadly237 and others added 2 commits August 27, 2026 11:13
- Use the nearest enclosing list/enum item's actual indent as the dedent
  target instead of hardcoded 2 bytes, so 4-space or tab indents dedent to
  the correct parent level. Falls back to stripping two indent characters
  when no parent item exists.
- Make the fallback char-based (strip_indent_units) so multi-byte
  whitespace can never be sliced mid-character.
- Tests: list_dedent_4space, list_dedent_fallback, list_dedent_unicode
  fixtures + unit test for strip_indent_units.
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.

2 participants