fabiopelosin / Ikeda

11 stars 1 forks source link

Syntax highlighting TextView #7

Open alloy opened 11 years ago

alloy commented 11 years ago

Some OSS code:

alloy commented 11 years ago
fabiopelosin commented 11 years ago

As, in my quick research, I was not satisfied with the available open source components available I explored the possibility to create a new pod. I think that many people are interested in it so some improvements from the community might trickle.

Reading here and there I see that the consensus is to use NSLayoutManager which is designed for temporary string attributes and has localized updates to be fast. I didn't have the chance to play with it further but I guess that once we have a coloring engine it should be pretty easy to build.

Another important feature, that the text view should have, is line numbers. Luckily NSTextView supports vertical rulers and it shouldn't be hard to make one. This feature is important because the errors report the line of the error.


As a note I've considered also the idea of making table/outline view for displaying the podfile, editing, and the from there serialize it back again. However, I consider this approach to be complex, error prone, and not that useful.

Anyway, some day, I would like to have some sort of control that allows to add a pod to the podfile inserting the text of the dependency where the cursors is in the text view. This control once clicked should present a window where you can specify the name of the pod (with a live filter on the available ones) and any external option with a nice GUI. This doesn't appears difficult to do, however I'm not sure about the UI of the control.