[Eric] Some Template Suggestions
Larry Shaffer
larrys at dakotacarto.com
Tue Jan 5 11:28:19 GMT 2010
I like the template feature in eric4 (latest 4.4 snapshot on Mac OS X).
Especially like the quick keyboard input. Here are some of my suggestions
for additional predefined variables:
$clipboard$
Replaced with any current clipboard contents.
$cur_select$
Replaced with any current text selection. Would only work when
double-clicking the template, which currently deletes any selection. Useful
for wrapping existing code. Would have to accommodate any additional new
indent level.
$insertion$
Sets insertion point for cursor after template is inserted. Usually defaults
to end of template now, though there appears to be a bug in the current
insertion placement calculation.
$select_start$ and $select_end$
Sets span of selected text in template after template is inserted. Good for
making help text in template ready for overwriting.
$py:/absolute/path/to/file.py$
Replaced with executed Python script results, before template is inserted.
Maybe also $py_project:project-root-relative/path/to/file.py$
$dir_project$
Inserts path to script's current project directory (if any). I believe
$dir_name$ is script's parent directory, not project.
I'll try to hack what I can into TemplateViewer.py and submit any diffs if
successful. Adding clipboard, cur_select and dir_project looks
straightforward.
Editing of template contents within a mini editor would be handy as well.
--
Larry
Mac OS X (10.5.8)
Python 2.6.4
Qt 4.5.2
PyQt 4.5.4
sip 4.8.2
QScintilla 2.4
eric4 4.4-snapshot-20091129 (r3531)
More information about the Eric
mailing list