From: Bob P. <bo...@ci...> - 2003-01-10 14:43:02
|
When the completer is called, is there any way to tell where the cursor is in the buffer? If the word being completed is unique in the buffer, it can be determined within the completer, but if the keyword is *not* unique in the buffer, is there any way to tell? - Bobman |
From: Bernhard B. <ma...@ba...> - 2003-01-15 20:47:25
|
> When the completer is called, is there any way to tell where the cursor > is in the buffer? cursor: not yet, but it should be simple to implement it. But I'm not sur= e if=20 this works, since the completer is called by native code, which in turn m= ust=20 call native code to query the cursor-position, so wie have: java -> c -> java -> c I will try this in the next release. > If the word being completed is unique in the buffer, > it can be determined within the completer, but if the keyword is *not* > unique in the buffer, is there any way to tell? Could you please clarify what you mean with that? Thank you, Bernhard |
From: Bob P. <bo...@ci...> - 2003-01-20 22:31:53
|
> > >>If the word being completed is unique in the buffer, >>it can be determined within the completer, but if the keyword is *not* >>unique in the buffer, is there any way to tell? >> >> > >Could you please clarify what you mean with that? > > (Sorry for taking so long.) Example: myprompt> mycommand -l all<tab> -f all If the user hits a <tab> where inicated (after the first occurance of 'all'), all you get in the completer function is the keyword 'all' and no indication if the cursor was after the first or second occurance. - Bobman > > |
From: Bernhard B. <ma...@ba...> - 2003-01-21 19:23:49
|
> >>If the word being completed is unique in the buffer, > >>it can be determined within the completer, but if the keyword is *not= * > >>unique in the buffer, is there any way to tell? > > > >Could you please clarify what you mean with that? > > (Sorry for taking so long.) > > Example: > myprompt> mycommand -l all<tab> -f all > > If the user hits a <tab> where inicated (after the first occurance of > 'all'), all you get in the completer function is the keyword 'all' and > no indication if the cursor was after the first or second occurance. > Currently, you have no chance. As soon as you can determine the=20 cursor-position (I'll try to implement this in the next release) you can = find=20 out by requesting the whole line-buffer. There is no readline-function=20 available for this directly. Bernhard |
From: Bob P. <bo...@ci...> - 2003-01-21 19:54:14
|
> Currently, you have no chance. As soon as you can determine the > cursor-position (I'll try to implement this in the next release) you can find > out by requesting the whole line-buffer. There is no readline-function > available for this directly. > We use another line-editing library here called Tecla (http://www.astro.caltech.edu/~mcs/tecla/). It appears to be more fully-featured than GnuReadline. Also, the word-completion callback passes a pointer to the line and the current cursor position (it is the responsibility of the recipient to work backwards to find the beginning of the word). Any chance you could add support for this library to JavaReadline? - Bobman |
From: Bernhard B. <ma...@ba...> - 2003-01-22 20:47:54
|
> We use another line-editing library here called Tecla > (http://www.astro.caltech.edu/~mcs/tecla/). It appears to be more > fully-featured than GnuReadline. Also, the word-completion callback > passes a pointer to the line and the current cursor position (it is the > responsibility of the recipient to work backwards to find the beginning > of the word). > > Any chance you could add support for this library to JavaReadline? I heard of Tecla before, but I don't have the time to implement that. If=20 somebody does it, I will add it to the distribution. Bernhard |