You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

43m 56s logged

Devlog #3

Welcome to the horrors of C++

I’ve officially split the file manager into a dual-panel desktop layout featuring a fixed “Places” sidebar and an overflowing “Content” directory using FTXUI’s DOM elements (elements.hpp). The trickiest part was getting large directories to scroll smoothly instead of truncating off-screen, which I solved using frame and vscroll_indicator viewports.

Of course, C++ warmly welcomed me to modular architecture by throwing a brutal std::length_error core dump after spending a solid 15 minutes refactoring my main.cpp into multiple modular files. I spent a considerable amount of time fighting what I thought was bad memory management, only to realise I had used an unsafe raw pointer cast on a boolean flag inside my tab container, forcing the layout engine to read random garbage bytes. At least that’s what I thought it was; in reality, it was that my change_directory function calls update_directory, which does display_names.clear() and rebuilds the vector. However, ftxui’s Menu component holds a raw pointer to the origin vector, but the vectors’ internal buffer got reallocated when it grows beyond capacity. With the issue identified and fixed, it now works again! Sort of…… now the directory contents don’t sync properly due to my fixes, including proper resyncing to avoid a SIGARBT.

With the code cleanly refactored into separate files and building, I’m aiming to tackle a dynamic file path bar and a basic context menu next.

0

Comments 0

No comments yet. Be the first!