Hi Erik,

> What is the best way to programmatically add characters to the current line?
> The function 'insChar' can replace the character under the cursor, but I'd

'insChar' only replaces a single char (or the same char "count" times).

More general are 'cutX', 'cutN' and 'paste'. They are the main internal editing
workhorses, based on 'change'. 'change' takes care of everything, like
maintaning undo/redo stacks, markup and rerfeshing the display.

However, they do not what you intend, if I understand correctly:

> like
> to simulate pressing 'i' to enter insert mode, typing e.g. "#{", pressing
> esc,
> etc, from code in 'viprc'.

i.e. simulate user key strokes. This would need a kind of interpreter, a
separate machinery which does not exist currently.

It could be hacked, perhaps by temporarily redefining (i.e. 'let'ting) 'getch'
and 'getch2' (or simply 'key'?).

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to