about summary refs log tree commit diff stats
path: root/src/kilo.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-22 18:47:56 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-22 18:47:56 -0800
commite77f3eb9f9cfbd79f56c666545e96d00cb752695 (patch)
tree9b1f794cfce50007cccea53229bf69e8d926749e /src/kilo.c
parent11d370493a7d5e0c799411225f23e636e5270ed5 (diff)
downloadteliva-e77f3eb9f9cfbd79f56c666545e96d00cb752695.tar.gz
.
Diffstat (limited to 'src/kilo.c')
-rw-r--r--src/kilo.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/kilo.c b/src/kilo.c
index 6da85dd..f43cfdb 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -160,9 +160,9 @@ char *Lua_HL_keywords[] = {
 struct editorSyntax HLDB[] = {
     {
         Lua_HL_keywords,
-        "--",  // line comment
-        "--[[",  // multiline comment start
-        "--]]"  // multline comment stop
+        "--",  /* line comment */
+        "--[[",  /* multiline comment start */
+        "--]]"  /* multline comment stop */
     }
 };
 
@@ -190,7 +190,6 @@ static int editorRowHasOpenComment(erow *row, char *mce) {
 /* Set every byte of row->hl (that corresponds to every character in the line)
  * to the right syntax highlight type (HL_* defines). */
 static void editorUpdateSyntax(erow *row) {
-//?     mvprintw(row->idx, 0, "i:%d|", row->idx);
     row->hl = realloc(row->hl,row->rsize);
     memset(row->hl,HL_NORMAL,row->rsize);
 
@@ -216,17 +215,14 @@ static void editorUpdateSyntax(erow *row) {
 
     /* If the previous line has an open comment, this line starts
      * with an open comment state. */
-    if (row->idx > 0 && editorRowHasOpenComment(&E.row[row->idx-1], mce)) {
-//?         addstr("continue multiline comment|");
+    if (row->idx > 0 && editorRowHasOpenComment(&E.row[row->idx-1], mce))
         in_comment = 1;
-    }
 
     while(*p) {
         /* Handle multi line comments. */
         if (in_comment) {
             row->hl[i] = HL_MLCOMMENT;
             if (starts_with(p, mce)) {
-//?                 addstr("mce|");
                 memset(&row->hl[i],HL_MLCOMMENT, strlen(mce));
                 p += strlen(mce); i += strlen(mce);
                 in_comment = 0;
@@ -238,7 +234,6 @@ static void editorUpdateSyntax(erow *row) {
                 continue;
             }
         } else if (starts_with(p, mcs)) {
-//?             addstr("mcs|");
             memset(&row->hl[i],HL_MLCOMMENT, strlen(mcs));
             p += strlen(mcs); i += strlen(mcs);
             in_comment = 1;
@@ -686,16 +681,16 @@ static void editorFindMenu(void) {
     draw_menu_item("Esc", "cancel");
     draw_menu_item("Enter", "submit");
     draw_menu_item("^u", "clear");
-    // draw_menu_item("←/↑", "previous");
+    /* draw_menu_item("←/↑", "previous"); */
     attroff(A_REVERSE);
     mvaddstr(LINES-1, menu_column, " ←/↑ ");
-    menu_column += 5;  // strlen isn't sufficient
+    menu_column += 5;  /* strlen isn't sufficient */
     attron(A_REVERSE);
     draw_string_on_menu("previous");
-    // draw_menu_item("↓/→", "next");
+    /* draw_menu_item("↓/→", "next"); */
     attroff(A_REVERSE);
     mvaddstr(LINES-1, menu_column, " ↓/→ ");
-    menu_column += 5;  // strlen isn't sufficient
+    menu_column += 5;  /* strlen isn't sufficient */
     attron(A_REVERSE);
     draw_string_on_menu("next");
     attrset(A_NORMAL);