On Fri, Mar 18, 2011 at 09:15:18PM +1100, Ben Schmidt wrote: > A thought occurred to me a couple of days ago: would it be appropriate > to actually use CSI as the byte-stream representation? Or something like > it. It is a byte-stream representation, right? And it's extensible, > right, so it is less likely to need a big overhaul in future? Does it > allow for 'private use' stuff? Because Vim needs a way to represent a > bunch of other events as keystrokes (mouse clicks, scroll wheel, its > magic script-local meta-character thing, representing the CSI escape > character itself, etc.). Also, is it easy to skip over CSI sequences if > necessary with simple logic?
Sure. CSI is intended for just this. A CSI sequence is matched by a regexp CSI [\x20-\x2f]? [\x30-\x3f]* [\x40-\x7e] Rougly "possibly-one punctuation character, then a bunch of numbers, ; or ;, then finally a signle letter." The "private use" area in CSI is the character range \x70-\x7e. One of these, CSI u (\x75) is already in use by xterm and libtermkey to encode modified Unicode characters. To my knowledge, the remaining are free. Plus, vim could even use this encoding internally if it wanted. -- Paul "LeoNerd" Evans [email protected] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/
signature.asc
Description: Digital signature
