Commit graph

108 commits

Author SHA1 Message Date
AnotherTest
2b3e9c28b2 Shell: Take whitespace into account when suggesting tokens
Prior to this, we did not care if there was any whitespace after the
last token in the prompt, and this caused a regression:
```
> lsp <tab>
> lsp ci
```
2020-05-23 01:31:41 +02:00
AnotherTest
0751592a18 LibLine: Correctly track the completion start and end
To achieve this, the API was tweaked a bit to allow for easier tracking
of completions.
This API change is non-disruptive to any application that does not use
anchored styles.
2020-05-21 10:52:11 +02:00
AnotherTest
5358608a94 Shell: Attach links to completed paths
```
ls ./Ter<tab>
```
gets you a link to ./Terminal.ini, right in the prompt.
2020-05-21 01:37:19 +02:00
AnotherTest
7fba21aefc LibLine: Unify completion hooks and adapt its users
LibLine should ultimately not care about what a "token" means in the
context of its user, so force the user to split the buffer itself.
This also allows the users to pick up contextual clues as well, since
they have to lex the line themselves.

This commit pacthes Shell and the JS repl to better handle completions,
so certain wrong behaviours are now corrected as well:
- JS repl can now complete "Object . getOw<tab>"
- Shell can now complete "echo | ca<tab>" and paths inside strings
2020-05-20 13:41:37 +02:00
AnotherTest
3bc3f36cfe LibLine: Handle unicode correctly
This commit also fixes a problem with us throwing out data that was
inserted while a command was running.
2020-05-18 11:31:43 +02:00
AnotherTest
1469d20e63 Shell: Treat builtin names as programs and suggest them 2020-05-17 12:54:31 +02:00
Andreas Kling
656d1e1318 Shell: Print the full name of missing interpreters
We were missing two characters at the end due to a mix-up when skipping
over the first two characters ("#!")
2020-05-17 12:33:28 +02:00
AnotherTest
a398898c12 Shell: Switch to using Core::EventLoop
This commit refactors Shell to a Core::Object and switches its looping
to Core::EventLoop.
2020-05-17 11:58:08 +02:00