When an animation is stopped the cards should be moved to their final
position anyway. Otherwise they might end up getting stuck in the
middle of the animation.
This changes the game so that more than one hand can be played. Once
one player has 100 or more points the game ends. A score card is shown
between each hand.
Fixes#7374.
Employ the same technique as SpaceAnalyzer to avoid doing full path
resolution in the kernel over an over. Starting each path resolution
from the base of the directory iterator (using its fd) is significantly
faster and reduces test-js runtime by ~3%.
So far we only have two states: Live and Dead. In the future, we can
add additional states to support incremental sweeping and/or multi-
stage cell destruction.
This implements the XSI-compliant version of strerror_r() - as opposed
to the GNU-specific variant.
The function explicitly saves errno so as to not accidentally change it
with one of the calls to other functions.
When a Selector features a :not() pseudoclass we now check whether the
current element matches with the given selector in the :not and act
accordingly.
Strings can be encoded in either UTF16-BE or UTF8. In either case,
there are a few initial bytes which specify the encoding that must
be checked and also removed from the final string.
IndirectValueRef is so simple that it can be stored directly in the
Value class instead of being heap allocated.
As the comment in Value says, however, in theory the max bits needed to
store is 48 (16 for the generation index and 32(?) for the object
index), but 32 should be good enough for now. We can increase it to u64
later if necessary.
This commit also splits up StreamObject into PlainTextStreamObject and
EncodedStreamObject, which is essentially just a stream object which
does not own its bytes vs one which does.
Unless DECOM mode is enabled, the cursor positions are measured from the
top left corner of the screen. We counted from the top margin, causing
line inserts in `vim` to go out-of-bounds and crash the terminal.
This commit fixes 3 correctness issues with the ANSI escape sequence
handling logic:
1. Default parameters were not handled correctly: the specification says
that 0-valued CSI escape sequence parameters should take their
default values.
2. We did not call `scroll_{up, down}` when encountering RI/IND commands
that reached the scroll margins. This caused nano to only scroll the
first line.
The Alternate Screen Buffer is used by full-screen terminal applications
(like `vim` and `nano`). Its data is stored separately from the normal
buffer, therefore after applications using it exit, everything looks
like it was before, the bottom of their interfaces isn't visible. An
interesting feature is that it does not support scrollback, so it
consumes less memory by not having to allocate lines for history.
Because of the need to save and restore state between the switches, some
correctness issues relating to it were also fixed in this commit.
This patch adds 13 new detectable file formats, which are as follows in
alphabetical order:
.blend, .isz, ext* filesystem, Lua bytecode, Matroska container, NES
ROM, .pdf, qcow image, .rtf, WebAssembly bytecode, Windows 3.1X/95
compressed archive and raw zlib stream
Some are a tad esoteric, but the more file types we detect, the more
useful this utility becomes! :^)
This mode allow us to escape any data that was not directly typed by the
user. `vim` currently uses this. If we implement it in the shell, we
could prevent newlines from being injected into the shell by pasting
text or dragging files into it (see #7276).
Instead of using a low-level, proprietary API inside LibGfx, let's use
Core::AnonymousBuffer which already abstracts anon_fd and offers a
higher-level API too.
We had two functions for doing mostly the same thing. Combine both
of them into String::find() and use that everywhere.
Also add some tests to cover basic behavior.
This commit introduces support for 3 new escape sequences:
1. Stop blinking cursor mode
2. `DECTCEM` mode (enable/disable cursor)
3. `DECSCUSR` (set cursor style)
`TerminalWidget` now supports the following cursor types: block,
underline and vertical bar. Each of these can blink or be steady.
`VirtualConsole` ignores these (just as we were doing before).
Pull out the Label updating code into its own function.
Ideally, we should probably transform this code to use its own widget
rather than doing this all in-line.
I.e., having a `FontSettingWidget` that that ties the FontPicker, Label
and Button into its own little widget, so that we can stay extendible in
the main widget and reduce duplication some more!
Previously, the font was applied to the Labels but the name wasn't
updated on initial startup.
This meant that the Label's content was only correct in the default
state but not if the user changed the defaults.
When building userland with UBSAN enabled (#7434), we were getting
spammed to death by unaligned access errors.
Fix these by adding 2 bytes of padding to the FontFileHeader struct,
and adjusting all our font files to match the new format. :^)
Right clicking on back or forward will now show a context menu with
URLs to navigate to. Also added an optional argument for the number of
steps in go_back() and go_forward().
This replaces the types of m_int_value and m_frac_value with
Checked<u64> which makes it possible to check if the value overflowed
when entering a digit. If that happens, the digit will just be ignored.
This fixes#1263.
This changes the keydown_event handler to use codepoints instead of key
codes for comparison if possible. This is so the functionality still
works as intended with keyboard layouts where e.g. typing '+' actually
results in KeyCode::Key_ExclamationPoint rather than KeyCode::Key_Plus.
This also removes the unnecessary call to atoi().
When loading debug info, we encounter the same filename over and over
(since files usually have many lines!) and we were wasting a ton of
time re-checking if the filename was part of the Toolchain or libgcc,
along with some other checks.
This patch makes prepare_lines() significantly faster by memoizing
the result of these checks per filename.
This makes "bt 12" ~25% faster (from 850ms to 650ms on my machine.) :^)
While playing with conditionally disabling -O2 optimization when
building the Userland subdirectory, I discovered that we can no longer
link errors without -O2. This happens as LibM.so doesn't link to
anything else, resulting in no stack protector implementation. It
appears that optimization somehow avoids this problem?
To fix this inject LibC/ssp.cpp as we do with in dynamic loader.
Previously each malloc size class would keep around a limited number of
unused blocks which were marked with MADV_SET_VOLATILE which could then
be reinitialized when additional blocks were needed.
This changes malloc() so that it also keeps around a number of blocks
without marking them with MADV_SET_VOLATILE. I termed these "hot"
blocks whereas blocks which were marked as MADV_SET_VOLATILE are called
"cold" blocks because they're more expensive to reinitialize.
In the worst case this could increase memory usage per process by
1MB when a program requests a bunch of memory and frees all of it.
Also, in order to make more efficient use of these unused blocks
they're now shared between size classes.
The new one is way more naive and not as fancy as the old one, but it
doesn't crash when trying to draw circles.
This algorithm just sweeps the angles required by the call, makes sure
each segment is at most 1 (pixel) long and just uses the standard
parameterization to find the coordinates of each point on the ellipse.
Move the from handshake() to the constructor (and move the constructor
out-of-line while we're at it.)
This prepares getting rid of the handshake() mechanism since this is
the only remaining user.