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

[BUG] CMD+Shift+Up/Down and Tab broken for moving/indenting lists and sublists in certain pages #532

Open
chrisrytting opened this issue Jul 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@chrisrytting
Copy link

Describe the bug
In certain large files, with long, complicated, highly nested lists/outlines, (1) CMD+Shift+Up/Down fails to move list/sublist up/down, respectively, and instead highlights text through top/bottom of page, and (2) Tab and Shift+Tab don't indent a list and its children, but rather only the bullet that I'm on. See screen recording for examples.

After seeing other issues, I hypothesized that this was due to inconsistent indentation in my file, empty lines, and so on, so with python, I looked for such cases (empty lines and lines that weren't 0 mod 4, since this is my tab size). I found a case of 25 spaces, and I corrected it to 24, and I found several cases of empty lines in lists (they looked like - after some number of indents, ending a list), and I deleted these lines. This fixed the problem for me.

To Reproduce
However, I can't actually reproduce this behavior by creating smaller lists that have the properties I had to fix in the above lists (empty lines and inconsistent indentation), so it feels like the plugin is successfully accounting for these things except in lists that are very long or complicated.

Expected behavior
I'd expect these hot keys to account for inconsistent indentation by rounding to the nearest indentation suggested by the number of spaces(e.g., consider 1 space 0 spaces, consider 3 spaces 4 spaces) and to be fine with empty lines. Indeed, they don't break the hotkeys when I manufacture small lists with the same properties.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: macOS Sonoma 14.5
  • Obsidian Version: 1.6.7
  • Plugin Version: 4.8.1

Additional context
Add any other context about the problem here.

Outliner.bug.mp4
@chrisrytting chrisrytting added the bug Something isn't working label Jul 28, 2024
@wuju
Copy link

wuju commented Aug 11, 2024

For me, it seems to happen if somehow the indentation was mixed (spaces, and tabs).

I'm not sure how it happened in the first place, and I suspect it was from copy/paste, I experience the same with the following observations.

I found the following workaround to resolve it:

  • Copy the text to another text editor e.g. Sublime, and fix the indentation to either all spaces or all tabs
  • Paste the text back into Obsidian

I found that the issue can be reproduced with the text below.

Note that all of the lists below look ok in Obsidian, but for the "mixed" lists, the sublist indentation, and the item moving features seem to break.

All spaces
- Level 1
    - Level 2.1
        - Item 2.1.1
        - Item 2.1.2
        - Item 2.1.3
    - Level 2.2
        - Item 2.2.1
        - Item 2.2.2
        - Item 2.2.3

All tabs
- Level 1
	- Level 2.1
		- Item 2.1.1
		- Item 2.1.2
		- Item 2.1.3
	- Level 2.2
		- Item 2.2.1
		- Item 2.2.2
		- Item 2.2.3


Mixed - all spaces with one tab line
- Level 1
	- Level 2.1
        - Item 2.1.1
        - Item 2.1.2
        - Item 2.1.3
    - Level 2.2
        - Item 2.2.1
        - Item 2.2.2
        - Item 2.2.3

Mixed - all tabs with one spaces line
- Level 1
	- Level 2.1
		- Item 2.1.1
		- Item 2.1.2
		- Item 2.1.3
    - Level 2.2
		- Item 2.2.1
		- Item 2.2.2
		- Item 2.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants