From 5462bcb23f6d4e4faf0444457c7743cf9f5ac8c1 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 13 Jun 2017 21:20:49 -0400 Subject: [PATCH] expand the current line highlight box to full width of gutter --- TODO.md | 29 ++++++++++++++++++++++++++--- lib/win.c | 7 ++++++- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/TODO.md b/TODO.md index b1d8993..35dd50b 100644 --- a/TODO.md +++ b/TODO.md @@ -4,13 +4,12 @@ Up Next: * highlight classes of identifiers * ^A shortcut should set implicit mark - -* move by words is inconsistent. Example: - var infoId = 'readerinfo'+reader.id; * Add a way to CD using a builtin (buffers will track original dir) * shortcut to jump to previous edit * add command line flags to toggle options (Tabs, Indent, etc..) * implement X resources config file +* move by words is inconsistent. Example: + var infoId = 'readerinfo'+reader.id; The Future: @@ -55,6 +54,30 @@ Maybe think about addressing these later: * File browser * Acme-like window manager +# Regular Expressions + +Operators: + + c Literal character + ^ Start of string + $ End of string + . Any char + [ ] Any character in the set + [^ ] Any character not in the reange + ( ) Grouping/matching + + ? Zero or one + * Zero or more + + One or more + + {n,m} From n to m matches + | Alternative + # Syntax Highlighting Label, Conditional, Repeat, Character, Number, PreProc, Float, Operator, Structure + +Keyword GROUP [WORD...] +Match GROUP REGEX +Region GROUP start=REGEX skip=REGEX end=REGEX + diff --git a/lib/win.c b/lib/win.c index 977139d..f17c589 100644 --- a/lib/win.c +++ b/lib/win.c @@ -371,7 +371,12 @@ static void onwheeldn(WinRegion id, bool pressed, size_t row, size_t col) { static void draw_line_num(bool current, size_t x, size_t y, size_t gcols, size_t num) { if (ShowLineNumbers) { - int color = (current ? CLR_CurrentLine : CLR_GutterText); + int color = CLR_GutterText; + if (current) { + color = CLR_CurrentLine; + size_t fheight = x11_font_height(Font); + x11_draw_rect((color >> 8), x-3, y-fheight, gutter_size(), fheight); + } UGlyph glyphs[gcols]; for (int i = gcols-1; i >= 0; i--) { glyphs[i].attr = color; -- 2.49.0