librelist archives

« back to archive

RSoC Daily Progress May 21

RSoC Daily Progress May 21

From:
Fela Winkelmolen
Date:
2010-05-21 @ 21:04
I fixed a last few bugs in the undo/redo code which now seems to work well.

Now I want to highlight matching opening and closing brackets (and do..end, 
def..end, etc). Some of this work can also help for a better automatic 
indentation, now it just uses the same indentation level as the last line.

To make thinks work I should:

1. find out the current token
2. find the corresponding token

There is a tokenizer, used for syntax highlighting.

To do 1. I could just get all tokens, then loop them till their sum is the 
current cursor position.

For 2. I can see if the token closes or opens a block or region, and than 
search backward or forward for blocks of the same type with a counter to 
identify the next one.

Could work, right?

It may not be the most efficient way, but the whole text is tokenized at every 
character pressed anyway...

- fela