Skip to content

Commit

Permalink
Rename to _preserveWithStandout and remove debug includes
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Rys committed Sep 29, 2024
1 parent d7bdf79 commit e6b606d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void Panel_draw(Panel* this, bool force_redraw, bool focus, bool highlightSelect
}
if (item.highlightAttr) {
attrset(item.highlightAttr);
RichString_setAttr_preserveBold(&item, item.highlightAttr);
RichString_setAttr_preserveWithStandout(&item, item.highlightAttr);
this->selectedLen = itemLen;
}
mvhline(y + line, x, ' ', this->w);
Expand Down
10 changes: 3 additions & 7 deletions RichString.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ in the source distribution for its full text.
#include "config.h" // IWYU pragma: keep

#include "RichString.h"
#include "ProvideCurses.h"
#include "CRT.h"

#include <assert.h>
#include <ctype.h>
Expand All @@ -19,7 +17,6 @@ in the source distribution for its full text.

#include "Macros.h"
#include "XUtils.h"
#include <stdio.h> // For printf


#define charBytes(n) (sizeof(CharType) * (n))
Expand Down Expand Up @@ -222,7 +219,7 @@ void printRichStringComparison(cchar_t* before, cchar_t* after, int length, int
}
}

void RichString_setAttrn_preserveBold(RichString* this, int attrs, int start, int finish) {
void RichString_setAttrn_preserveWithStandout(RichString* this, int attrs, int start, int finish) {
// Extract the foreground and background colors from the passed attrs
int passed_color_pair_number = PAIR_NUMBER(attrs);
short passed_fg_color = -1, passed_bg_color = -1;
Expand Down Expand Up @@ -280,9 +277,8 @@ void printAttrs(int attrs) {
}


void RichString_setAttr_preserveBold(RichString* this, int attrs) {
// printRichString(this);
RichString_setAttrn_preserveBold(this, attrs, 0, this->chlen - 1);
void RichString_setAttr_preserveWithStandout(RichString* this, int attrs) {
RichString_setAttrn_preserveWithStandout(this, attrs, 0, this->chlen - 1);
}

int RichString_findChar(const RichString* this, char c, int start) {
Expand Down
4 changes: 2 additions & 2 deletions RichString.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ void RichString_rewind(RichString* this, int count);

void RichString_setAttrn(RichString* this, int attrs, int start, int charcount);

void RichString_setAttrn_preserveBold(RichString* this, int attrs, int start, int finish);
void RichString_setAttrn_preserveWithStandout(RichString* this, int attrs, int start, int finish);

int RichString_findChar(const RichString* this, char c, int start);

void RichString_setAttr(RichString* this, int attrs);

void RichString_setAttr_preserveBold(RichString* this, int attrs);
void RichString_setAttr_preserveWithStandout(RichString* this, int attrs);

void RichString_appendChr(RichString* this, int attrs, char c, int count);

Expand Down

0 comments on commit e6b606d

Please sign in to comment.