3 ms·
Spaces always work online in a text box whilst spaces do not. Pressing tab in here doesn't give me an indent but changes focus. But spaces always work
by dalore 7y ago
Spaces always work online in a text box whilst spaces do not.
Pressing tab in here doesn't give me an indent but changes focus.
But spaces always work
- scrollaway 7y agoLeading spaces here don't specifically give you an indent, they give you a formatted code block. I don't really see how this is relevant either way, you're not sharing code with your coworkers in a browser text box on HN. Use whatever you want here.
- dalore 7y agoHere was merely an example. Sometimes I might want to use a web based IDE like edit file on GitHub or GitLab.
- scrollaway 7y agoBoth of those support using the tab key to indent with tabs. In fact you can even configure the GitHub one to use tabs or spaces.
- dTal 7y agoThat's unfortunate but it's only a keybinding problem - you can paste tabs in text boxes just fine (whether the website does something sensible with the character is a separate issue; HN doesn't). Hopefully you're not doing vast amounts of coding in a web browser text box anyway. If it's a more sophisticated web-based IDE, that keybinding can trivially be overridden in javascript.
- zephyrfalcon 7y agoYeah but, in a GUI, pressing Tab is supposed to change focus, not to insert a Tab character.
- dTal 7y agoAnd the arrow keys and the spacebar are supposed to scroll, and backspace is supposed to go back a page, and enter is supposed to submit, and forward slash is supposed to open a search box. We manage, by making our software intelligently adapt to the context. Most of the time, ability to insert a tab character is less important than the ability to change focus. In a dedicated source code editor, however, this is not the case.
- enriquto 7y agoUsing tabs or spaces has nothing at all to do with "pressing tab". You can press the tab key and get spaces, or obtain tabs without pressing the tab key. They are completely orthogonal issues.