[IPython-dev] New hooks suggestion: line buf, cursor pos

Ville M. Vainio vivainio@gmail....
Wed Dec 3 12:44:05 CST 2008


To enhance autocompleter operation, I thought I should add a few hooks:

'get_line_idx' => int

return the position of "cursor" on current line. Alternative names:
get_caret_pos, get_line_buf_idx.

'get_current_line_buffer' => string

return the current line.

This is for the benefit of custom completers in gui's (and emacs).
Currently, these are directly provided by readline, and you can
monkeypatch your way around this requirement, but that's obviously not
something to like...

See test/test_completer.py for monkeypatching alternative.

-- 
Ville M. Vainio
http://tinyurl.com/vainio


More information about the IPython-dev mailing list