From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

Text Markers (WIP)

I plan to extend the editor with text markers. It seems there are really two sorts of markers I wish to add:

  • Spans
  • Bookmarks

Spans are simply selections but form a basis for more exciting tools to be created. Bookmarks are line markers. We will focus on spans for now.

  • Span markers will probably look like selections but coloured differently.
  • They have no text themselves but can highlight text of any length.
  • Editing text within a span edits all matching, marked text
  • Spans can be cycled through (with tab?)
  • There will be a python interface for adding/removing/selecting spans

Quorn-text-marker-mockup1.png


This enables the possibility of:

  • Find All - mark all occurrences allowing them to be edited as one
  • Templates - (as in the mock-up above)
  • Diff Utils

In most cases spans should be temporary:

  • Tab cycles between them
  • Direct click within or arrow keys allow editing
  • All other events dismiss them as a group

Some cases may require spans to be saved with the file. For example, it may be desirable to highlight bits of text and send the .blend to someone else. Diff utils should also be saved so the changes can be looked at later if desired.

From another view, it may simply be useful to highlight headings in text, or colour code a (tran)script for rehersal.

Groups

For more permanent spans it may be helpful to allow markers to be grouped. We don't want our find results getting muddled up with our templates. The group should then provide the colour and the markers themselves just provide the positions.

Groups can then be removed quickly once we're done with them.

Removal

If many tools are going to use markers they need to be easy to dismiss. Perhaps each hit of ESC removes the last added group, or if the cursor is in a marker that group first.