Just bail when encountering some unexpected character. This makes it
much more tolerable to type a stylesheet into TextEditor with live
HTML preview enabled.
This is definitely not 100% correct but I tried implementing the basic
algorithms described in CSS 2.2. It's good enough to render the penguin
on @linusg's homepage at the right size. :^)
Replaced elements are now laid out by the current formatting context.
Since the logic is almost identical in BFC and IFC, it's implemented
by static helpers in FormattingContext.
The focus_dependent_delete_action that sits in the file manager's
toolbar would always remain enabled, even if nothing was selected,
activating it if nothing was selected would then crash the application.
The action is now correctly enabled/disabled, but due to the way
selection works in TreeViews, something is always selected, what really
matters is if the TreeView has something selected, and it has focus.
As it currently stands, there is no way to know when the TreeView's
is_focused status changes. In order for this to work I added a callback
to the Widget class which fires when a widget receives or looses focus.
In that callback, the focus_dependent_delete_action's enabled value is
recalculated.
HackStudio no longer has dedicated project files, so let's get rid of
the *.hsp file concept. It'll eventually produce some files again,
but they won't be the same kind of "project" files.
Instead of having .hsp files that determine which files are members
of a project, a project is now an entire directory tree instead.
This feels a lot less cumbersome to work with, and removes a fair
amount of busywork that would otherwise be expected from the user.
This patch refactors large parts of HackStudio to implement the new
way of thinking. I've probably missed some details here and there,
but generally I think it's pretty OK.
This is a convenience API when you just want the rest of the string
starting at some index. We already had substring_view() in the same
flavor, so this is a complement to that.
With this patch you can use right-click to mark a square on the board.
You can add modifier keys to the click to change to alternate color
(with CTRL) or secondary color (with Shift). If you right-click and
drag from one square to another you will create an arrow. The
markings go away as soon as you left-click on the board or the board
state changes.
Note: The arrows sometimes look weird, and horizontal ones get cut
off. They also don't account for alpha. This is not a bug in
Chess code, rather, likely in the fill_path() function that's
used to draw the arrows. If anyone might know what's up with
that I urge you to take a look. :)
This patch allows the user to load games using PGN files. The parsing
is not complete and has a bunch of work left to be done, but it's
okay for our use case here. It can load all of the games our PGN
exporter can save. As the Chess program impoves so can the PGN parser.
This patch allows the user to go back and forward in move history
to replay moves from the game. This is view-only however, and as soon
as a move is made the board returns to it's current state. This will
work well for replaying games loaded in with PGN files, once that's
implemented.
You can now copy the board state as Forsyth-Edwards Notation. You can
then paste this into other chess programs/games, or into ours when
it gets implemented.
From the Web IDL spec: https://heycam.github.io/webidl/#idl-undefined
[...]
undefined constant values in IDL are represented with the `undefined`
token.
[...]
Note: This value was previously spelled `void`, and more limited in how
it was allowed to be used.
This pre-commit config is quite simple: all it does for now is running
the already existing Meta/lint-ci.sh script to ensure no changes that
won't pass the CI linting step are committed.
Consequently pass_filenames is set to false, as these scripts will
determine which files to check themselves - should this ever become a
performance bottleneck, we can update them to accept an optional list of
filenames.
It should be noted that using pre-commit for Serenity development is by
no means a requirement, but doing so may decrease the number of CI
builds failing due to forgotten license headers etc. - especially if
you're pushing to `master` directly, rather than going through pull
requests *hint hint*.
For info how to install & use pre-commit, see https://pre-commit.com/.
Fixes#2365.
The bug is that if you try to cp DIR_A to DIR_B where DIR_A and DIR_B
have the same parent directory and DIR_A's name is a prefix of DIR_B
(e.g. foo -> foo2, bar -> barbar), it thinks that it's a subdirectory
(since it checks if DIR_A's realpath is a prefix of DIR_B's realpath).
The easiest solution is to put a path delimiter at the end before the
comparison, since you can't have a / in the middle of a directory name.
For example if DIR_A is /home/anon/foo and DIR_B is /home/anon/foo2,
then DIR_A's realpath is a prefix of DIR_B's realpath even though DIR_B
is not inside DIR_A.