2 次代碼提交 59b23db584 ... fa767babf8

作者 SHA1 備註 提交日期
  Lucy McClane fa767babf8 no third party themes mention 2 年之前
  Lucy McClane 003ead8fc3 empty prev token check 2 年之前
共有 3 個文件被更改,包括 8 次插入4 次删除
  1. 2 2
      README.md
  2. 1 1
      configure.ac
  3. 5 1
      libhighlight/tokenizer.c

+ 2 - 2
README.md

@@ -111,8 +111,8 @@ filetype *.md
   <kbd>-</kbd>    | Zoom text out
   <kbd>=</kbd>    | Reset zoom
   <kbd>0</kbd>    | Default theme
-  <kbd>1</kbd>    | github-light theme
-  <kbd>2</kbd>    | github-dark theme
+  <kbd>1</kbd>    | Light theme
+  <kbd>2</kbd>    | Dark theme
 
 ## Using Mouse
 

+ 1 - 1
configure.ac

@@ -15,7 +15,7 @@
 # This file is a part of litemdview project
 # https://notabug.org/g0tsu/litemdview
 
-AC_INIT(litemdview, 0.0.30)
+AC_INIT(litemdview, 0.0.31)
 AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
 
 AC_PROG_CC

+ 5 - 1
libhighlight/tokenizer.c

@@ -29,7 +29,9 @@ static hl_node * hl_token_find_prev(hl_node *node) {
 }
 
 static void hl_token_check_function(hl_node *node) {
-  if (hl_token_find_prev(node)->type == HL_NODE_TYPE)
+  hl_node *prev = hl_token_find_prev(node);
+
+  if (prev && node->type == HL_NODE_TYPE)
     node->type = HL_NODE_FUNCTION;
   else if (node->type == 0)
     node->type = HL_NODE_FUNCTION_CALL;
@@ -116,6 +118,8 @@ void hl_next_word(char *word, int len, hl_node *node, hl_ctx *ctx) {
   node->text = strdup(word);
   node->text_len = len;
 
+  puts(word);
+
   if (len == 1) {
     hl_token_single(word[0], node, ctx);
     return;