-
Notifications
You must be signed in to change notification settings - Fork 620
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
Cycle bullets #907
Cycle bullets #907
Conversation
opening this as draft to see if it's acceptable :) I like using different bullet chars to indicate the indentation level of list elements, it's especially useful with long lists that flow outside the viewport of my editor. |
@@ -73,8 +73,9 @@ let s:markdown_syntax.rxHR = '\(^---*$\|^___*$\|^\*\*\**$\)' | |||
let s:markdown_syntax.rxTableSep = '|' | |||
|
|||
" Lists | |||
let s:markdown_syntax.bullet_types = ['-', '*', '+'] | |||
let s:markdown_syntax.bullet_types = ['*', '-', '+'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this line change is more of a personal preference than anything else...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do prefer , +, - : each time lighter or the contratyr -,+, : for a default it is easyer to remember
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes sense, so let's go with *
, +
, -
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually just tried it and just writing the test cases I find it harder to visually distinguish *
and +
:
* aaaaaa
* bbbbbb
+ cccccc
- dddddd
+ eeeeee
* aaaaaa
* bbbbbb
- cccccc
+ dddddd
- eeeeee
hmm I didn't check this would still work on numbered lists, my bad. will have a look at that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add more tests: what happens when inserting a new line with Go
:
* lvl1
+ lvl2
- lvl3
* lvl4
Add the tests to Vader please: nice to see PR with some tests become to come
If will be accepted when you feel ready: just ping me |
97fb240
to
20a7695
Compare
@tinmarino can you have a look here. I added the latest neovim version to the test setup (it's what I'm using) my manual testing and that new neovim test suite run fine, all the vim suites fail the test you asked for here |
The error is from:
It fails in my vader, not in my personal vim instance. The problem is that |
Not a serious error, if tired, just comment the test out. |
autoload/vimwiki/lst.vim
Outdated
@@ -1338,7 +1343,7 @@ function! vimwiki#lst#change_marker(from_line, to_line, new_mrkr, mode) abort | |||
else | |||
"if the old is ### and the new is * use *** | |||
if cur_item.type == 1 && | |||
\ index(vimwiki#vars#get_syntaxlocal('multiple_bullet_chars'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you justify that ? I guess it is because the variable is declare in syntaxlocal so you fixed a bug.
It would be more coherent to have it in syntaxlocal as recurring_bullet
so to change the varaible declaration in vars.
What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started this patch on master, there multiple_bullet_chars
was retrieved via syntaxlocal. when rebasing on dev I noticed it was coming from wikilocal everywhere else, but you're right... it get's called through both. Should I just leave it? And we can follow this up with another PR (I can open an issue to track that)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is with my patch...
$ rg multiple_bullet_chars autoload/vimwiki/lst.vim
1106: \ index(vimwiki#vars#get_wikilocal('multiple_bullet_chars'),
1127: \ index(vimwiki#vars#get_wikilocal('multiple_bullet_chars'),
1333: if index(vimwiki#vars#get_wikilocal('multiple_bullet_chars'), s:first_char(new_mrkr)) > -1
1346: \ index(vimwiki#vars#get_wikilocal('multiple_bullet_chars'),
1404: \ index(vimwiki#vars#get_wikilocal('multiple_bullet_chars'),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the line was just missed here: ac4d0a1?
Te resume:
Anyhow, very nice contribution. It will be accepted in any case, I just try to minimize my integration additions. |
When the syntax local config `cycle_bullets` is set (currently only markdown has it by default) the indent functions will cycle through the characters defined in `bullet_types` based on the level of indentation. Signed-off-by: Robert Günzler <r@gnzler.io>
Well 1. changes I requested for have been, made; 2. the PR has its own tests and 3. The optional feature do not break the former behavior. |
@tinmarino thanks for the help on this :) really glad to have found this |
I don't know if this is the right place for this, but I believe this change introduces an error when changing the indentation of checklists. There is now an error when I try to indent my checklist: Key not present in Dictionary: cycle_bullets. |
@ndaman Same here; I get E716: Key not present in Dictionary: cb !=? '' |
Is this feature behind a toggle? I would like to deactivate it |
I came here looking to ask exactly the same. I really hate this new cycle behaviour. Meanwhile i found it can be disabled by editing |
When the syntax local config `cycle_bullets` is set (currently only markdown has it by default) the indent functions will cycle through the characters defined in `bullet_types` based on the level of indentation. Signed-off-by: Robert Günzler <r@gnzler.io>
When the syntax local config `cycle_bullets` is set (currently only markdown has it by default) the indent functions will cycle through the characters defined in `bullet_types` based on the level of indentation. Signed-off-by: Robert Günzler <r@gnzler.io>
When the syntax local cnfig
cycle_bullets
is set (currently onlymarkdown has it by default) the indent functions will cycle through the
characters defined in
bullet_types
based on the level of indentation.Signed-off-by: Robert Günzler r@gnzler.io
Steps for submitting a pull request:
dev
branch!doc/vimwiki.txt
if applicable,including the Changelog and Contributors sections.