aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-01-18 16:04:55 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2017-01-18 16:04:55 +0100
commit29c03495e63efb155077d51da4445213e4a82e1f (patch)
treec600caef243eb4cdc0906026f9386c1e7284fc14
parent57fec13e3afe43a4e903c9298bc0be147a01a118 (diff)
downloadhex-29c03495e63efb155077d51da4445213e4a82e1f.tar.gz
hex-29c03495e63efb155077d51da4445213e4a82e1f.tar.xz
hex-29c03495e63efb155077d51da4445213e4a82e1f.zip
Update comments
-rw-r--r--hex.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/hex.c b/hex.c
index be744c1..b147ede 100644
--- a/hex.c
+++ b/hex.c
@@ -398,7 +398,7 @@ app_is_character_in_locale (ucs4_t ch)
// --- Field marking -----------------------------------------------------------
-/// Find the "marks_by_offset" object covering the offset (if any)
+/// Find the "marks_by_offset" span covering the offset (if any)
static ssize_t
app_find_marks (int64_t offset)
{
@@ -439,6 +439,15 @@ app_mark_cmp (const void *first, const void *second)
return 0;
}
+/// Flattens marks into sequential non-overlapping spans suitable for search
+/// by offset, assigning different colors to them in the process:
+/// @code
+/// ________ _______ ___
+/// |________|__|_______| |___|
+/// |_________|
+/// ___ ____ __ _ _____ ___ ___
+/// |___|____|__|_|_____|___|___|
+/// @endcode
static void
app_flatten_marks (void)
{
@@ -612,6 +621,8 @@ app_draw_info (void)
struct mark **iter = marks->marks;
for (int y = 0; y < app_visible_rows (); y++)
{
+ // TODO: we can use the field background
+ // TODO: we can keep going through subsequent fields to fill the column
struct mark *mark;
if (!iter || !(mark = *iter++))
break;
@@ -1517,6 +1528,10 @@ app_process_left_mouse_click (int line, int column)
}
else if (line < app_visible_rows ())
{
+ // TODO: when holding a mouse button over a mark string,
+ // go to a locked mode that highlights that entire mark
+ // (probably by inverting colors)
+
// TODO: employ strict checking here before the autofix
int offset;
if (column >= 10 && column < 50)