SthephanShinkufag / bytebeat-composer

Bytebeat player with a collection of many formulas from around the internet.
https://dollchan.net/bytebeat/
MIT License
90 stars 28 forks source link

typing tabs is inconsistent with other characters #32

Closed SArpnt closed 2 years ago

SArpnt commented 2 years ago

default codemirror settings aren't great for this kind of use, especially when code golfing is common

SArpnt commented 2 years ago

not quite the same issue but i found that it still adds tabs at the start when selecting a region of text instead of replacing the selected text like other things typed

SthephanShinkufag commented 2 years ago

You expected that if you select multiple lines then Tab must increase the indentation of the code block, and if you select some code in one line then Tab must replace the selection with the tab.

But

https://codemirror.net/6/docs/ref/#commands.insertTab Insert a tab character at the cursor or, if something is selected, use indentMore to indent the entire selection.

There are no words about selecting multiple lines. That is, indentation works on any selection, even for one character. Also, some IDE like Atom have the same behavior. Even if one character selected, then Tab will increase the indentation of the whole string.

SArpnt commented 2 years ago

i never said anything about multiple lines, and i don't think what ides do matter. generally bytebeats aren't large enough that people need to be able to quickly indent. if they were, then it would still make more sense to just have an autoformatter built into the website. i feel like for bytebeats tab should be typed like other characters.