You may start with the following:
smselact_jijs_''
pos=. {. smgetsel_jijs_''
txt8=. 8&u: txt=. smread_jijs_''
ln=. 0 >. +/ LF = pos {. txt
NB. some changes to txt8 eg, name completion
smwrite_jijs_ txt8
smscroll_jijs_ ln
smsetselect_jijs_ (pos+0,0),1
smfocus_jijs_''

Basically, smselact will select the active window in jwd,
smgetsl get the byte offset of cursor
smread get the buffer context
ln is the line number of the cursor line
after modifying the buffer and write the new content to the window
smcroll to scroll to the original cursor line
smsetselect to position the cursor
smfocus to make that window the active window again.

Пнд, 16 Авг 2010, Andrew Nikitin писал(а):
> 
> 
> I am trying to implement name completion for jwd. The one where
> you type incomplete name, then hit tab and it completes it with
> next good name from current directory. Except, instead filename
> from directory I want a name from locale.
>  
> I have figured out that 'tab' key is out of the question, but, say, F4
> would work equally well for me.
>  
> So far I've got:
>  
> leftword=:3 : 0
> if. ''-:y do. y=.<,'0' end.
> >{:;: utf8 (ucp e__y){~(-(-i.)80) +{: _1".e_select__y
> )
>  
> liststarting=:3 : 0
> y (({...@e. > )"_ 0 # ]) ;(3 : '<nl__y ''''')"> (,copath) coname ''
> )
>  
> pickrest=:3 : 0
> try.
> (#y)}. ,> (((0{::]) # (1 {:: ]) { [) wdselect) liststarting y
> catch.
> end.
> )
>  
> Then if I go to Edit|Configure and enter the following code for
> F4 key (make it "quiet"):
>  
> pickrest leftword ''
>  
> then if I type wd and hit F4 it will show me all available names that start 
> with wd.
>  
> Now I need to put the rest of the selected word at the current cursor 
> position.
> How do I do that?


-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to