LoginSignup
3
3

More than 5 years have passed since last update.

tig(gitのテキストツール)のUTF-8での記号がずれる件

Posted at

tigを導入したのだけど、
よりキレイな表示を、と思って
set line-graphics = utf-8
にしたけど、ずれる。
なぜずれるかって、iterm2の方でDouble-Width Charactersをチェック入れて有効に
しているから。これは外せない。vimやemacsで絵文字・記号を扱うことがあるので。
じゃあ、どうするか。
tigのソースコードを変更して、コンパイルしてインストールする

cd tig-2.1
vi src/graph-v2.c

        if (graph_symbol_cross_over(symbol))
+               //return "─│";
                return "-┼";
        if (graph_symbol_vertical_bar(symbol))
                return " │";
        if (graph_symbol_turn_left(symbol))
+               //return "─╯";
                return "-╯";
        if (graph_symbol_multi_branch(symbol))
+               //return "─┴";
                return "-┴";
        if (graph_symbol_horizontal_bar(symbol))
+               //return "──";
                return "---";
        if (graph_symbol_forks(symbol))
                return " ├";
        if (graph_symbol_turn_down_cross_over(symbol))
+               //return "─╭";
                return "-╭";
        if (graph_symbol_turn_down(symbol))
                return " ╭";
        if (graph_symbol_merge(symbol))
+               //return "─╮";
                return "-╮";
        if (graph_symbol_multi_merge(symbol))
+               //return "─┬";
                return "-┬";
./configure
make
make install
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3