Limiting tab search in scrollback

Posted by Worstje on Wed 04 Oct 2006 01:07 PM — 5 posts, 18,711 views.

Netherlands #0
I have a huge scrollback so I can easily copy-paste long fights if I happen to end up in them. However, with the TAB function this causes problems. For example, I do:

say How are you, Xs<tab>

instead of Xa<tab>, which should be autocompleted into Xanthor, MUSH freezes for over one minute because it searches the ENTIRE scrollback... which exists out of 200,000 lines for me. While it hasn't gotten me killed so far, it's highly annoying.

Can a function be added that allows you to limit autocomplete searching to ..for example, the last 100 lines in scrollback?
USA #1
Yeah this is a huge problem for me too. I have my buffer quite large, and sometimes when I go to type something and hit tab I end up typing a wrong letter and I have to wait literally 15 minutes.
#2
As well as a 'lines' limiter, I suggest an and/or feature to limit by time elapsed in a search.
Australia Forum Administrator #3
15 minutes sounds a bit long.

I have added a new option to version 3.81 which lets you specify the number of lines to search, defaulting to 200.

I don't know about a time limit, I think a line limit will be adequate.
USA #4
If one were willing to take a slight memory hit, it would be possible to index the auto-completion words using a lexical trie. This would make word look-up extremely fast; it would be proportional to the length of the word (in letters) as opposed to searching backwards through the buffer. That would also probably require more coding on Nick's part, though. :-)

(That being said, I would be happy to provide Nick with a C++ class I wrote that fully implements a character-based lexical trie; the work would then be to add all words displayed into that trie and then query it for words. It already takes care of things like asking for a list of words that start with a certain prefix, or even a list of words that match a (simple) regular expression.)

The reason I don't like a line limit is that sometimes these 'big fights' (or whatever) can happen and take up lots of space, thus removing whatever I had just before in my list of potential auto-completions. It seems to sort of defeat the purpose of auto-complete to limit it to relatively few lines. I suppose if the buffer were 10,000 lines long and you limited yourself to 1,000 lines or so things would be different, but I still think it would be much better to use an index. If you're storing thousands of lines anyhow, the overhead to having a word index won't be too big. (You can store the entire Oxford English Dictionary in a few megabytes of memory, if I remember correctly.)