3 ms·
>> text editors built on the web stack cannot rely on the OS text caret Can you explain in simple terms why this is the case? Why on earth not?
by biggiesmalls 10y ago
>> text editors built on the web stack cannot rely on the OS text caret
Can you explain in simple terms why this is the case? Why on earth not?
- Sharlin 10y agoBecause you can't just ask the OS to "please paint text caret here thankyou", and browsers do not expose a powerful enough native text editing control. So you end up reimplementing one in JS/HTML/CSS, including the caret.
- heinrich5991 10y agoThe WinAPI function SetCaretPos seems to do that: https://msdn.microsoft.com/en-us/library/windows/desktop/ms648405(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/ms6...
- prafuitu 10y agoWell, because, in order to satisfy the most finicky of its users (myself included), VS Code offers no less than 6 styles for its cursor ('block', 'block-outline', 'line', 'line-thin', 'underline' and 'underline-thin') and 5 animations ('blink', 'smooth', 'phase', 'expand' and 'solid'). Also, in a future release the themes will be allowed to change the color of the cursor to any of the 16,581,375 colors in the RGB spectrum. Does that answer your question? :)