Note that there are some explanatory texts on larger screens.

plurals
  1. USKarl Ove Hufthammer
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. COThere are still some things that doesn’t work, e.g. completing `"rock 'n`. Most of these can be fixed by removing `"$cur"` from the `_find_words` call. Then everything works for strings that starts with a double quote or nothing, except when ‘completing’ an already complete word starting with a double quote (since the last double quote incorrectly gets quotes?). And there are still some problems with completing words beginning with a single quote (only the last part of the word seems to be recognised when the completion suggestion is inserted). But all in all, this solution works OK. Thanks!
      singulars
    2. CORegarding my comment above. It looks like the situation is slightly worse than I thought. Auto-completion inside a word containing apostrophes (e.g., trying to autocomplete ‘rock 'n ro’, either written using escaped spaces and apostrophe, or single or double quotes) doesn’t work. The reason is that the `search` variable is not in its correct expanded form. Some extra substitutions seems possible, but I haven’t been able to get this to work correctly for all the three different ways of escaping.
      singulars
    3. COThanks. This solution works for the original examples, but if I add ‘rock 'n roll’ to words.dat, it fails. My real-life use of the autocompletion actually involves words with apostrophes, and that’s the reason I originally used `eval`. It’s easy enough (though not very elegant) to fix, by adding an extra ‘search and replace’ to the `for loop, and then add another for loop for strings beginning with '. The only remaining problem, as far as I can see, is that the autocompletion does not advance one cursor position if you have written an entire word, including any closing quotes.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload