Lazy line caching for Notepad (#1042)

* easier 'now', start adding text editor

* Adding scrolling to notepad

* Better scrolling

* Better scrolling, off-by-1 bugs

* MVP fit and finish

* Add tiny font and use in Notepad

* Font tweaking, tiny font cursor

* Fix warning

* Format changed files

* WIP No file limit

* WIP - adding CircularBuffer type

* WIP Caching

* add  unit test for circular_buffer

* WIP still have a bug when moving cache forward

* Finish lazy line caching

---------

Co-authored-by: kallanreed <kallanreed@outlook.com>
This commit is contained in:
Kyle Reed
2023-05-22 13:08:59 -07:00
committed by GitHub
parent 802a4e243b
commit 98f3bf151f
10 changed files with 741 additions and 175 deletions

View File

@@ -311,6 +311,10 @@ class File {
return value_;
}
const T& operator*() const& {
return value_;
}
Error error() const {
return error_;
}
@@ -339,6 +343,9 @@ class File {
File(){};
~File();
File(File&&) = default;
File& operator=(File&&) = default;
/* Prevent copies */
File(const File&) = delete;
File& operator=(const File&) = delete;
@@ -352,8 +359,8 @@ class File {
Result<Size> write(const void* const data, const Size bytes_to_write);
Result<Offset> seek(const uint64_t Offset);
Timestamp created_date();
Size size();
// Timestamp created_date() const;
Size size() const;
template <size_t N>
Result<Size> write(const std::array<uint8_t, N>& data) {