Age | Commit message (Collapse) | Author |
|
This corrects the spelling of 'matching' from 'macthing'.
|
|
Previously, we were generating the display update one character at a
time, and writing them one at a time to stderr, which is not buffered,
doing so caused one syscall per character printed which is s l o w (TM)
This commit makes LibLine write the update contents into a buffer, and
flush it after all the update is generated :^)
|
|
Otherwise, something like shift+tab->tab->tab will mess up the page
contents (assuming that the max lengths in the pages are different).
|
|
This implements StringUtils::find_any_of() and uses it in
String::find_any_of() and StringView::find_any_of(). All uses of
find_{first,last}_of have been replaced with find_any_of(), find() or
find_last(). find_{first,last}_of have subsequently been removed.
|
|
|
|
4d5cdcc89394259019828f123039104d6f4039e2 partially reverted the changes
from d8c5eeceabbeaedc29823f12cc8a9cfac6f84686, but it reverted too much
and reintroduced the bug.
This commit finally fixes the actual bug.
The author hasn't been in his best committing state today.
|
|
This is a partial revert of d8c5eeceabbeaedc29823f12cc8a9cfac6f84686
as it contained unrelated code that was committed accidentally,
which broke history on LibLine.
|
|
Otherwise we would lose the CSI parameters and intermediates if the
whole sequence was split between two reads.
Fixes #7835.
|
|
We're already keeping it alive via `m_notifier`.
This makes the event loop quitting logic simpler by making less
deferred calls and removes a race condition where the notifier would be
deleted before the second deferred_invoke() would be invoked, leading
to a nullptr dereference.
Fixes #7822.
|
|
When the search editor calls on really_quit_event_loop to cancel the
search, the command loaded in m_buffer would actually execute because
really_quit_event_loop sends a new line character and then afterwards
clears the buffer.
By using end_search prior to exiting the event loop, this patch will
appropriately clear the buffer, not execute any commands, and
preserve the original loaded buffer after returning from a canceled
search.
|
|
This replaces ctype.h with CharacterType.h everywhere I could find
issues with narrowing conversions. While using it will probably make
sense almost everywhere in the future, the most critical places should
have been addressed.
|
|
They were sorta unneeded. :^)
|
|
This setting can be controlled by setting the
PROGRAMS_ALLOWED_TO_MODIFY_DEFAULT_TERMIOS _local_ shell variable to a
list containing such programs.
|
|
This mode makes the editor insert all the "pasted" text into the buffer
without interpreting it in any way.
|
|
Previously <AK/Function.h> also included <AK/OwnPtr.h>. That's about to
change though. This patch fixes a few build problems that will occur
when that change happens.
|
|
This method always returns false so there's no reason for calling it.
|
|
Previously, all sorts of weird stuff would happen when the editor was at
the last line of the terminal (or when the printed line would be at the
last line), this commit makes the editor scroll the terminal up before
trying to write to a row that doesn't actually exist (yet).
This fixes ^R search making a mess when initiated at the last line
(especially with multiline prompts).
|
|
...and make it an enum class so people don't omit "OpenMode".
|
|
This patch adds a new flag called history_dirty to Line::Editor that is
set when history is added to but written. Applications can leverage
this flag to write history only when it changes. This patch adds an
example usage of this functionality to Shell, which will now only save
the history when it is dirty.
|
|
|
|
|
|
I have no idea how this _ever_ worked, and I also have no idea why past
me didn't use FileStream to begin with.
Fixes the issue where lots of junk data would be written to the temp
file, causing the external editor to crash.
|
|
We had some inconsistencies before:
- Sometimes "The", sometimes "the"
- Sometimes trailing ".", sometimes no trailing "."
I picked the most common one (lowecase "the", trailing ".") and applied
it to all copyright headers.
By using the exact same string everywhere we can ensure nothing gets
missed during a global search (and replace), and that these
inconsistencies are not spread any further (as copyright headers are
commonly copied to new files).
|
|
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
|
|
Fixes #6472.
|
|
|
|
There are cases where the line editor could miss the WINCH signal
(e.g. in the shell, while another program is in the foreground),
This patch makes it so that LibLine notices the change in terminal size
in such cases.
|
|
This keybind opens the current buffer in an editor (determined by
EDITOR from the env, or the default_text_editor key in the config file,
and set to /bin/TextEditor by default), and later reads the file back
into the buffer.
Pretty handy :^)
|
|
At the cost of using more read() syscalls, process the DSR response
character-by-character.
This avoids blocking forever waiting for an 'R' that will never come :P
|
|
This can come in handy when telneting in.
|
|
Instead, mask them as `\xbb` so that e.g. DEL becomes `\x7f`.
Fixes #5752.
|
|
Good-bye LogStream. Long live AK::Format!
|
|
Otherwise `reposition_cursor()` will move the cursor one character too
far to the right, and since we don't redraw the entire buffer when
the character is inserted at the end, the mistake won't be immediately
fixed by a complete redraw.
Fixes #5722
|
|
Otherwise this would set m_chars_touched_in_the_middle to zero, which is
exactly the wrong thing to do.
|
|
Fixes #5465.
|
|
|
|
This broke after the lazy update change :P
|
|
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
|
|
Previously, we'd always put it right after the prompt.
|
|
|
|
These were forgotten in the last LibLine commit, any changes to m_buffer
not going through insert() and remove_at_index() should also be updating
these.
Fixes #5440.
|
|
This patchset allows the editor to avoid redrawing the entire line when
the changes cause no unrecoverable style updates, and are at the end of
the line (this applies to most normal typing situations).
Cases that this does not resolve:
- When the cursor is not at the end of the buffer
- When a display refresh changes the styles on the already-drawn parts
of the line
- When the prompt has not yet been drawn, or has somehow changed
Fixes #5296.
|
|
...as the search editor prompt has to always stay after the main prompt preview.
|
|
Fixes #5233.
|
|
ctype's `iscntrl` truncates its input, making some codepoints appear as
control characters. Avoid this by checking whether the character is in
ascii to begin with.
|
|
|
|
It would be tempting to uncomment these statements, but that won't work
with the new changes.
This was done with the following commands:
find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/#define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/#define/ { toggle = 1 }' {} \;
find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/ #define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/ #define/ { toggle = 1 }' {} \;
|
|
A C++ source file containing just
#include <LibFoo/Bar.h>
should always compile cleanly.
This patch adds missing header inclusions that could have caused weird error
messages if they were used in a different context. Also, this confused QtCreator.
|