Original Post
i am creating an awesome AI for my game, and i want to have one program where you would design the enemy.
part of this is writing the the actual brains in a scripting language, so i want the program to allow you to do this ... so i need a text editor.
my problems:
1) lets say i have a buffer 5K big, and the users cursor is in the 3487th position of the buffer, and they hit the letter "L", well, this should add the letter "L" to the 3487th position, and push everything after it back one space in the buffer ... whats the fastest way to do this?
2) user hits backspace, this should remove the character where the cursor is at, and pull everything after it forward one space in the buffer ... whats the fastest way to do this?
3) is having a buffer the best way to do this? any other better method?