integral-dw / org-superstar-mode

Make org-mode stars a little more super
GNU General Public License v3.0
500 stars 21 forks source link

org-superstar ignores the first level in bullet lists #10

Closed ogdenwebb closed 4 years ago

ogdenwebb commented 4 years ago

I'm not sure it's by design or not, but I have this issue with org-superstar.

For example, if we have something like this.

- A.
  - B.
  - B.
- A.
  - C.
  - C.

In the example above only B and C-notes will display with a new symbol from org-superstar-item-bullet-alist.

screenshot-1585762928

integral-dw commented 4 years ago

Hi, thanks for submitting! First I got to ask however: Could it be that your first bullet begins a new line? In that case I think I know what the problem is. I assumed that because an asterisk with no leading space is treated as a headline, items using + or - must also have a preceding space. I will have to look up what the specifications say to that.

integral-dw commented 4 years ago

Seems perfectly legal, so I opened a quick branch with a patch. Did you post a reply and deleted it? GitHub just showed my some weird artifact of an empty comment box for a moment. All tests run smoothly, so I would merge it into the main branch, but if you want to give the branch a quick eval and see if it fixes your problem, even better!

ogdenwebb commented 4 years ago

Could it be that your first bullet begins a new line?

Uh, I'm not sure what did you mean here. I messed screenshot the above so I give you a new one.

Here is the code.

Here is my bullet list without heading.

- No space before
 - Minus with space.
+ Plus no spaces.
 + Plus with space.

* Heading
- It's the first minus item.
  - It's a minus item.
  - It's a minus item.
- The first minus item again.
  + It's a plus item.
  + It's a plus item.
  + It's a plus item.
- And first again.
  * It's a asterisk
  * It's a plus item.
  * It's a plus item.
** Second heading
+ It's a plus.
+ It's a plus.
  - Minus.
  - Minus.

And here is how it looks in my Emacs.

screenshot-1585774887

I assumed that because an asterisk with no leading space is treated as a headline

Yes, with leading space it is working as expected. Does a bullet list require an extra space?

integral-dw commented 4 years ago

Could it be that your first bullet begins a new line?

Uh, I'm not sure what did you mean here.

What I meant was whether the bullet is the first character of a new line (no leading space), and I guess that was the case.

Does a bullet list require an extra space?

As it turns out, it depends on the character. * must have a leading space (otherwise it's a headline) the other two don't have to. I didn't realize that myself until you brought this up :sweat_smile:

ogdenwebb commented 4 years ago

Did you post a reply and deleted it?

Yes, I did, because I accidentally send an empty code block. :)

if you want to give the branch a quick eval and see if it fixes your problem, even better!

At first sight, now it works fine. Thanks you.

CDitzel commented 4 years ago

for me it still does not work oO

Screenshot from 2020-04-12 20-33-44

integral-dw commented 4 years ago

Asterisks must have a leading space to be considered list items in Org. Superstar highlights lines beginning with asterisks and no space (correctly) as heading lines.

CDitzel commented 4 years ago

I dont understand what you are saying. I want the purple lines to be subheadings, also, I dont get to insert a space character in front of them

integral-dw commented 4 years ago

I want the purple lines to be subheadings

Then, I don't understand your screenshot, I'm afraid. Since your screenshot shows no list, I am not sure what problem you are experiencencing. Please provide a small working example of the problem. The following should work:

* heading
** subheading
 * item 1
    + item 1.1
    + item 1.2
 * item 2

This example produces the following result (for my personal config in this case) example

Could you provide the snippet and a screenshot of what is not working for you?

CDitzel commented 4 years ago

I did try your snippet above

sc

integral-dw commented 4 years ago

Looks good! What example did not work for you, exactly?

CDitzel commented 4 years ago

how? there are weird points in front of the subheading oO

lmintmate commented 4 years ago

how? there are weird points in front of the subheading oO

This is the default value of the variable org-superstar-leading-bullet (https://github.com/integral-dw/org-superstar-mode/blob/master/org-superstar.el#L165). I wasn't confused by it, but then I follow the development rather closely (and saw this issue too, but I also had absolutely no idea what you were talking about). As can be seen from the description of the variable, if you enable org-hide-leading-stars, it will presumably look as you expect it to. Or you can use org-superstar-configure-like-org-bullets to configure more stuff as you'd expect from org-bullets. @integral-dw PLease let me know if I answered correctly or should have posted something else. Also if he was confused, maybe other people will get confused too, so maybe something should be done to avoid that confusion (maybe make clearer that this will happen if org-hide-leading-stars is nil?) P.S. integral-dw, sorry if you feel like I butted in here, but as I said earlier I was utterly confused by this, and thus the moment I understood what he was talking about had to answer in order to solve this confusion for both him and me and you.

integral-dw commented 4 years ago

@lmintmate Absolutely nailed it, I just got what @CDitzel meant myself.

I think I'll just add it to the FAQ in the next commit, that should clear all confusion. Something like "Q: What are those weird points in front ot the heading bullets?"