Note that Jakt only allows StringView creation from string literals, so
none of the invariants in the class are broken by this (if used only
from within Jakt).
This allows the user to transform the contents of the optional (if any
exists), without manually unwrapping and then rewrapping it.
This is needed by the Jakt runtime.
This is used in Jakt, and providing that value from Jakt's side is more
trouble than doing this.
Considering this class is bound to go away, a little
backwards-compatible API change is just fine.
This deduplicates argument handling logic from Help and man and makes it
more modular for future use cases. The argument handling works as
before: two arguments specify section and page (in this order), one
argument specifies either a page (the first section that it's found in
is used) or a path to a manpage markdown file.
- Calculate the full name on demand
- Make section and name protected
- Reorder some members logically
- Change the name getter to be fallible, as some implementors need to
allocate
The previous moved-from state was the null string. This violates both
our invariant that String is never null, and also the C++ contract that
the moved-from state must be valid but unspecified. The empty short
string state is of course valid, so it satisfies both invariants. It
also allows us to remove any extra checks for the null state.
The reason this change is made is primarily because swap() requires
moved-from objects to be reassignable (C++ allows this). Because the
move assignment of String would not check the null state, it crashed
trying to increment the data reference count (nullptr signals a
non-short string). This meant that e.g. quick_sort'ing String would
crash immediately.
s p a c e s h i p o p e r a t o r
Comparing UTF-8 can be done by simple byte lexicographic comparison per
definition, so we just piggy-back on StringView's high-performance
comparator.
This is a first step in deduplicating code within and across Help and
man.
Because LibManual also doesn't contain any DeprecatedString, some
adjustments to Help's string handling is included, just to interoperate
with LibManual better. Further work in this area mostly requires String
APIs in LibGUI.
On Serenity, SQLServer is started by SystemServer. But on Lagom, it is
manually started by e.g. Ladybird when the application is started, and
killed when the application exits. This means every Ladybird process
starts its own SQLServer, which defeats the purpose of SQLServer acting
as the single process interacting with the database files.
This patch will allow SQLClient to start up a single SQLServer instance,
first checking if one already exists. If it does exist, SQLClient will
simply connect to SQLServer's socket. If it does not exist, SQLClient
will launch SQLServer much like SystemServer would (with a local socket
file, etc.).
The child SQLServer process is double-forked; the grandchild process
becomes the SQLServer process, which the middle child process simply
exits to "detach" the grandchild process from the SQLClient process.
Currently, we create a new SQL::Database object for each database we are
requested to open. When multiple clients connect to the same database,
the same underlying database file is opened and cached each time. This
results in updates from one client not being propagated to others.
To prevent this, when a database is requested to be open, check if it is
already open. We can then re-use that SQL::Database object for the new
connection.
LibFuzzer documentation [1] states that all return values except for 0
and -1 are currently reserved for future use. -1 is a special return
value that causes LibFuzzer to not add a testing input to the testing
corpus, regardless of the code coverage that it causes.
[1] https://llvm.org/docs/LibFuzzer.html
This used to be the other way around. If we just inserted input with
document.write, this would always be true and not allow document.write
to immediately parse its input (given that there's no pending parsing
blocking script)
Instead of having two separate context menus and popping up either the
"file" or "directory" one depending on the selected node, we now have a
single context menu and update it (before popping it up) to show the
context-appropriate actions.
This is achieved by simply updating the visibility of the actions.
This takes care of one TODO! :^)
This patch adds a visibility state to GUI::Action. All actions default
to being visible. When invisible, they do not show up in toolbars on
menus (and importantly, they don't occupy any space).
This can be used to hide/show context-sensitive actions dynamically
without rebuilding menus and toolbars.
Thanks to Tim Slater for assuming that action visibility was a thing,
which gave me a reason to implement it! :^)
When you select a text area in "bottom-up" way (e.g. from line 10
to line 5), then type the shortcut, the text editor will not
comment those text for you.
Normalize the text range can easily fix this minor bug.
This confused quite a number of people in the past, and it is still
slightly annoying to always switch the directory when testing both the
OS and the fuzzer build. Instead, let's just switch to the correct
directory automatically.
The indexes are into the _node_, not in the fragment, so when a node is
split into multiple fragments, simply taking the length of the fragment
is incorrect. This patch corrects this mistake.
This action was originally added so that Magnifier's window would
always be on top by default, but it's a redundant menu item and wasn't
actually setting itself at start-up. Instead, rely on the same menu
item provided to all Modeless windows by default for a more consistent
UX, and set the option after show() so it takes effect.