SciTE is one of my favourite editors. It have many killer-features,
but I really miss one - Incremental SciTE autocompletion.
Now if you set "autocompleteword.automatic=1" the completion list will
popup automatically but only in case when you have only one completion
variant.
You can hit Ctrl+Enter and all possible choices will popup. I think,
SciTE really misses ability to modify the completion variants list
while typing, incrementally, without hitting ctrl+enter.
I created a patch, that adds this feature to SciTE. Feature can be
turned on by "autocompleteword.incremental=1" property. My solution is
very naive and I want to know, is there any alternative?
Hi Sergey, nice patch, i've missed this like you. but there are some issues with it, - the list should be also triggered on backspace to increase the list again. - the list should also be hidden if there is no word anymore. - the list should be decremented when shown without autocompleteword.automatic=1 (triggered by ctrl+enter)
On 10 дек, 02:32, Frank Wunderlich <frank.wunderl...@gmail.com> wrote:
> Hi Sergey,
> nice patch, i've missed this like you.
> but there are some issues with it,
> - the list should be also triggered on backspace to increase the list again.
> - the list should also be hidden if there is no word anymore.
> - the list should be decremented when shown without
> autocompleteword.automatic=1 (triggered by ctrl+enter)
> if this is patched, maybe neil accept this patch.
The test at the top of StartAutoCompleteWord is strange: its effect is to remove the autocompletion if you backspace to the start of the line. Perhaps it is supposed to remove the autocompletion if you backspace to the starting point. The SCN_AUTOCUPDATED handler will interfere with other uses of autocompletion such as Complete Symbol and Lua scripts. Unless SCN_AUTOCUPDATED is supposed to be fired in more cases then it is poorly named as it fires only when a character is deleted. The relationship between the autocompleteword properties is messy: perhaps this should be mode 2 of autocompleteword.automatic rather than a separate property. This will need documentation patches to be accepted.
On 12 дек, 03:37, "Neil Hodgson" <nyamaton...@gmail.com> wrote:
> The test at the top of StartAutoCompleteWord is strange: its
> effect is to remove the autocompletion if you backspace to the start
> of the line. Perhaps it is supposed to remove the autocompletion if
> you backspace to the starting point.
In original implementation autocompletion window is removed when you
backspace to the postion _before_ starting point. It is ok when you
are in the middle of the line, but it is annoying, when you need to
backspace to previous line to hide autocompletion. Test you mentioned
is aimed to fix this problem. It is unrelated to incremental
autocompletion. Probably, it should be discussed in different
thread.
> The SCN_AUTOCUPDATED handler will interfere with other uses of
> autocompletion such as Complete Symbol and Lua scripts.
> Unless SCN_AUTOCUPDATED is supposed to be fired in more cases then
> it is poorly named as it fires only when a character is deleted.
Is there any test cases for me to test these features with my patch?
Probably, rename is the only thing that is needed.
> The relationship between the autocompleteword properties is messy:
> perhaps this should be mode 2 of autocompleteword.automatic rather
> than a separate property.
> This will need documentation patches to be accepted.
I thought about this feature and I think it can be improved. I propose
these improvements:
1. Automatic Symbol Completion. It'll work the same as the existing
`autocompleteword.automatic=1` but for symbols (maybe
autocomplete.automatic=1 should switch this feature on)
2. Automatic Incremental Symbol Completion(autocomplete.automatic=2 ?)
---and far far future planning---
3. Mixed Automatic Completion and Mixed Incremental Completion(words
and symbols are mixed together)
I already improved my patch to support Automatic Incremental Symbol
Completion. I must know if anyone needs "Automatic Symbol Completion"
or Mixed Completion to proceed. Also I'll be glad to hear advices
about how all these things should be implemented.
> 3. Mixed Automatic Completion and Mixed Incremental Completion(words > and symbols are mixed together)
sciteRu has the ability to show words and symbols from API-Files together in the autocomplete list without an extra property. maybe you can look there for the neccessary code. imho neil rejected the patch, so it's not available in the original scite-version.
> Test you mentioned > is aimed to fix this problem. It is unrelated to incremental > autocompletion. Probably, it should be discussed in different > thread.
OK. If you want the autocompletion to go away, press Escape.
>> The SCN_AUTOCUPDATED handler will interfere with other uses of >> autocompletion such as Complete Symbol and Lua scripts. >> Unless SCN_AUTOCUPDATED is supposed to be fired in more cases then >> it is poorly named as it fires only when a character is deleted. > Is there any test cases for me to test these features with my patch? > Probably, rename is the only thing that is needed.
Using an API file, press Ctrl+I to display API symbols and type some initial letters. Press backspace and the API symbols go away to be replaced with words from the current file.
> I thought about this feature and I think it can be improved. I propose > these improvements: > 1. Automatic Symbol Completion. It'll work the same as the existing > `autocompleteword.automatic=1` but for symbols (maybe > autocomplete.automatic=1 should switch this feature on)
Then you have to define which takes precedence.
> 2. Automatic Incremental Symbol Completion(autocomplete.automatic=2 ?) > ---and far far future planning--- > 3. Mixed Automatic Completion and Mixed Incremental Completion(words > and symbols are mixed together)
For my own use, I don't want the two sources of words mixed by default.
New version can be found here :
http://groups.google.com/group/scite-interest/web/incremental_autocom... It consists of
1. Incremental word autocompletion(autocompleteword.automatic=1 and
autocompleteword.automatic=2)
2. Incremental symbol autocompletion (autocomplete.automatic=1 and
autocomplete.automatic=2)
3. Docs patch
4. gtk makefile patches (I use `make DEBUG=1 TRACE=1` for tracing)
5. 'Annoying extra backspace to cancel autocompletion' fixed
I found interesting behaviour. If I use api file, then Word
Autocompletion feature doesn't work properly. For example, I have
'some some2 some3' in my file. If I press Ctrl+Enter, popup window
will contain only 'some' word, but it should contain also the 'some2'
and 'some3' words. This bug reproduces in cvs version. I'll try to
find related issue.
> New version can be found here : > http://groups.google.com/group/scite-interest/web/incremental_autocom... > It consists of > 1. Incremental word autocompletion(autocompleteword.automatic=1 and > autocompleteword.automatic=2) > 2. Incremental symbol autocompletion (autocomplete.automatic=1 and > autocomplete.automatic=2) > 3. Docs patch
Looks like it still doesn't cope with scripted autocompletion lists.
To test with scripted autocompletion you can add to your startup script something like:
function ShowList() editor:AutoCShow(1, "abc bbb def") end
> 4. gtk makefile patches (I use `make DEBUG=1 TRACE=1` for tracing)
Don't want this.
> 5. 'Annoying extra backspace to cancel autocompletion' fixed
When I deliberately start an autocompletion I don't want it to disappear just because I have undone the typing.
> I found interesting behaviour. If I use api file, then Word > Autocompletion feature doesn't work properly. For example, I have > 'some some2 some3' in my file. If I press Ctrl+Enter, popup window > will contain only 'some' word, but it should contain also the 'some2' > and 'some3' words. This bug reproduces in cvs version. I'll try to > find related issue.
This happens without an API file as well. The set of characters allowed for the list of words comes from the word.characters.<filepattern> setting which doesn't include digits. The documentation says that this is supposed to default to including digits but it doesn't. Probably best to change default to match documentation.
I tried this feature and I didn't find any bugs related to the patch.
Patched SciTE acts the same as the original SciTE. What kind of
problems with scripted autocompletion do you have?
> > 4. gtk makefile patches (I use `make DEBUG=1 TRACE=1` for tracing)
> Don't want this.
Ok.
> > 5. 'Annoying extra backspace to cancel autocompletion' fixed
> When I deliberately start an autocompletion I don't want it to
> disappear just because I have undone the typing.
Ok.
> This happens without an API file as well. The set of characters allowed for
> the list of words comes from the word.characters.<filepattern> setting
> which doesn't include digits. The documentation says that this is supposed
> to default to including digits but it doesn't. Probably best to change
> default to match documentation.
I'll comment in the following bug-tracker's thread.
> I tried this feature and I didn't find any bugs related to the patch. > Patched SciTE acts the same as the original SciTE. What kind of > problems with scripted autocompletion do you have?
There is a bit of global state associated with the 'only one' mode. If you cancel (with Esc) from an 'only one' popup, I think that state persists so when you use backspace on the scripted autocompletion it replaces the autocompletion with a list of similar words, just as if it was invoked for that purpose rather than by the script. Any state changed by entering an 'only one' popup should be cleared when it goes away for any reason or else the code that responds to the backspace needs to work out why the autocompletion was shown.