-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
It would be nice to be able to customize the Matlab editor with M-code scripting. Let's try to do this.
Tentative design:
- Ability to register M-code functions as callbacks in the editor customization
- And bind them to keyboard shortcuts
- And as a bonus, bind them to new toolstrip buttons
The callbacks should be of the form callback(me), where me is a reference to an object that represents the Matlab Editor state and provides methods for manipulating it. Let's call that a Me object.
Me should support:
- Getting:
- The current editor tab that the cursor/focus is on
- The name/path of the file in that editor tab
- The text contents of the editor window (call that the "text buffer")
- The cursor position within the text buffer
- The cursor position within the window (i.e. row and column numbers)
- The current selection (as both row/col range and text buffer character range)
- The scrollbar position of the editor window
- Overall editor structure
- A list of split panes and the editor tabs in each
- Setting:
- Inserting, deleting, and otherwise modifying the text in the text buffer
- Cursor position
- Selection
- Scroll bar state
- Which editor tab has focus
- Opening and closing editor tabs
- Moving editor tabs between split panes, and around within the order of tabs in a split
It would be a big bonus if Me also exposed a parse tree and class/function model or other representation of the semantic structure of the M-code as it is in the text buffer.
I suppose it should know about Live Editor stuff, too.
Reactions are currently unavailable