Age | Commit message (Collapse) | Author |
|
|
|
|
|
And make the existing cltr-h handler easier to see.
|
|
Also move the existing backspace lambda out of the loop.
The do_delete() extraction fixes a minor bug where
InputState::ExpectTerminator wasn't entered if delete was pressed at the
very end of a line. Now that this is fixed, there's no more
"LibLine: Unhandled final: 7e (~)" when hitting delete at the end of the
line.
|
|
|
|
|
|
This allows was_resized() to be called while the editor is not active
(i.e. get_line() is not in frame).
|
|
|
|
This commit also updates Shell, which uses actual_rendered_length.
|
|
Get rid of the weird old signature:
- int StringType::to_int(bool& ok) const
And replace it with sensible new signature:
- Optional<int> StringType::to_int() const
|
|
Fixes #2525
|
|
The names x and y caused confusion because of their typical use as
horiz/vert.
|
|
This commit makes LibLine handle interrupts (as reported via
interrupted() and resized()) again.
There is a little catch with the shell:
```
$ ls |
pipe> <C-c> (prompt stays here until a key is pressed)
```
|
|
|
|
.. and make travis run it.
I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.
It also checks the presence of a (single) blank line above and below the
"#pragma once" line.
I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.
I also ran clang-format on the files I modified.
|
|
|
|
This commit changes LibLine's internal structure to work in an event
loop, and as a result, also switches it to being a Core::Object.
|
|
sequences
We just look at $TERM and refuse to emit any escape sequences if it
doesn't start with "xterm".
This could be made much better, at detecting, and at not caling
getline().
|
|
And move canonicalized_path() to a static method on LexicalPath.
This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
|
|
|
|
This fixes a bunch of FIXME's in LibLine.
Also handles the case where read() would read zero bytes in vt_dsr() and
effectively block forever by erroring out.
Fixes #2370
|
|
|
|
|
|
This commit adds back suggestion pagination, and makes it 10x better.
Also adds a "< page m of n >" indicator at the bottom if there are more
suggestions than would fit in a page.
It properly handles cycling forwards and backwards :^)
|
|
`CompletionSuggestion(text, ForSearch)` creates a suggestion whose only
purpose is to be compared against.
This constructor skips initialising the views.
|
|
|
|
|
|
|
|
|
|
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.
|
|
This commit also adds the concept of "anchored" styles, which are
applied to a specific part of the line, and are tracked to always stay
applied to that specific part.
Inserting text in the middle of an anchored style extends it, and
removing the styled substring causes the style to be removed as well.
|
|
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
|
|
This allows all the unicode processing to be internal to the line
editor.
|
|
Previously, we would concatenate all the commands together:
```
> sleep 5
echo well
echo hello
echo friends
> echo wellecho helloecho friends
```
Also renames some variables to be more descriptive.
|
|
This commit also fixes a problem with us throwing out data that was
inserted while a command was running.
|
|
Closes https://github.com/SerenityOS/serenity/issues/2080
|
|
We do not want to clog up signal handlers by putting possibly complex
logic inside them, so allow the editor to handle that.
|
|
This patch fixes an issue where the line editor would put no spacing
between suggestions (only when there are two suggestions).
To reproduce, try on a build with no ports (starting with `pro`):
```
> pro<tab>
profilepro
```
|
|
We can now cycle pages of suggestions when there are more suggestions
than we can fit on one screen.
This does not inculude a visual indicator that more pages exist,
however.
|
|
This also patches Userland/js.
|
|
|
|
This commit fixes the following misbehaviour:
```
> <- search prompt moves here
>
> ^R^L <- actual prompt stays here
```
|
|
This fixes the issue where the editor would only scroll up one command
and then 'search' for it
|
|
This patchset fixes incorrect handling of escaped tokens (`a\ b`) in
Shell autocompletion and LibLine.
The users of LibLine can now choose between two token splitting modes,
either taking into account escapes, or ignoring them.
|
|
|
|
Unbreaks the build.
|
|
This patch fixes the issue where some data would be buffered while the
editor is not editing, and vt_dsr would read them, resulting in the
cursor to jump to (1,1)
|
|
This patch makes initialize() transparent to the users, but exposes it
publicly, as the users might need a copy of the default termios (i.e.
Shell)
|
|
It does not make much sense to receive an interrupt and process it
*much later*.
Also patches Userland/js to only create exceptions while some code is
actually running.
|
|
|