On https://github.com/sindresorhus/refined-github/issues/new, there is an "Add a task list" button. There is no autocomplete on Enter and I often use a button again to add a new item but Github adds 2 newlines around the TODO item with checkbox and in 90% of cases, that's not what I want (I tend to have headers for each task list, so I need to add newlines anyway). I would like to have a feature that can be toggled in the settings of the extension, e.g. disable-task-list-newlines that would make the "Add a task list button" simply add a new checkbox item on the next line (1 newline that is). This is the default behaviour of Gitlab if I recall correctly.
I am almost embarrased to ask for this as I cannot imagine I am the only one stuggling with constant loop of pressing the "Add a task list" and removing two extra lines (unless I get tired and copy an empty task list item with a following newline and paste a dozen). I did thoroughly check https://github.com/Mottie/GitHub-userscripts and the issue tracker.
Heh, that's kind of a ridiculous behavior, but reimplementing it is a little tough.
Look at this file: https://github.com/sindresorhus/refined-github/blob/master/source/helpers/smart-block-wrap.ts
That code replicates the current "block" injection that GitHub uses. Implementing this feature would mean copying that so it works when starting a new list but adjusting it so that checkboxes are injected together.
I can think of 2 alternative solutions:
undo entry)smartBlockWrap but drop the extra line _before_ injecting the text via textFieldEdit.insertThank you, I will see if I can prototype a possible solution. Does Refined GH use text-field-edit already?
Yes, it鈥檚 probably used in tandem with smartBlockWrap so you can refer to that code
Natively supported!! https://github.blog/changelog/2020-12-15-markdown-list-syntax-now-autocompleted/
I鈥檓 super glad we don鈥檛 have to deal with this 馃槍
Most helpful comment
I鈥檓 super glad we don鈥檛 have to deal with this 馃槍