diff --git a/config.h b/config.h index edf94c5..0b024a2 100644 --- a/config.h +++ b/config.h @@ -16,11 +16,11 @@ static const int use_alternate_screen = 1; // use as bool (0 or 1) * Values from 1 to 256 representing 256 color/8-bit pallate * see: https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit */ -static const unsigned int EDITOR_BG_COLOR = 235; -static const unsigned int VISUAL_BG_COLOR = 69; -static const unsigned int HL_NUMBER_COLOR = 207; -static const unsigned int HL_STRING_COLOR = 116; -static const unsigned int HL_COMMENT_COLOR = 243; -static const unsigned int HL_KEYWORD1_COLOR = 69; -static const unsigned int HL_KEYWORD2_COLOR = 167; -static const unsigned int HL_DEFAULT_COLOR = 229; +static const int EDITOR_BG_COLOR = 235; +static const int VISUAL_BG_COLOR = 69; +static const int HL_NUMBER_COLOR = 207; +static const int HL_STRING_COLOR = 116; +static const int HL_COMMENT_COLOR = 243; +static const int HL_KEYWORD1_COLOR = 69; +static const int HL_KEYWORD2_COLOR = 167; +static const int HL_DEFAULT_COLOR = 229; diff --git a/hermes.c b/hermes.c index 1c2887a..c47636a 100644 --- a/hermes.c +++ b/hermes.c @@ -353,7 +353,7 @@ void editorUpdateSyntax(erow *row) { editorUpdateSyntax(&E.row[row->idx + 1]); } -unsigned int editorSyntaxToColor(int hl) { +int editorSyntaxToColor(int hl) { switch (hl) { case HL_NUMBER: return HL_NUMBER_COLOR; case HL_STRING: return HL_STRING_COLOR; @@ -938,8 +938,8 @@ void editorEndOfWord() { } void editorCopyRange(int sx, int sy, int ex, int ey) { - int swap; if (ey < sy || (sy == ey && ex < sx)) { + int swap; swap = sy; sy = ey; ey = swap; swap = sx; sx = ex; ex = swap; }