Skip to content

Instantly share code, notes, and snippets.

@emasaka
Created January 25, 2010 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emasaka/285569 to your computer and use it in GitHub Desktop.
Save emasaka/285569 to your computer and use it in GitHub Desktop.
#cc_zen1 = 0x00000000; // 全角文字を1文字として数える
#cc_zen2 = 0x00000001; // 全角文字を2文字として数える
#cc_han1 = 0x00000000; // 半角文字を1文字として数える
#cc_zensp1 = 0x00000000; // 全角空白を1文字として数える
#cc_zensp2 = 0x00000100; // 全角空白を2文字として数える
#cc_zensp0 = 0x00000200; // 全角空白を数えない
#cc_hansp1 = 0x00000000; // 半角空白を1文字として数える
#cc_hansp0 = 0x00002000; // 半角空白を数えない
#cc_tab1 = 0x00000000; // タブを1文字として数える
#cc_tab0 = 0x00020000; // タブを数えない
#cc_lf1 = 0x00000000; // 改行を1文字として数える
#cc_lf2 = 0x00100000; // 改行を2文字として数える
#cc_lf0 = 0x00200000; // 改行を数えない
#cc_selected = 0x80000000; // 範囲選択の部分を計算
#count_op = #cc_zen1 | #cc_han1 | #cc_zensp1 | #cc_tab1 | #cc_lf0;
$message = " 文字";
if (selecting) {
#count_op = #count_op | #cc_selected;
$message = $message + "\n(選択範囲)";
}
message str(charcount(#count_op)) + $message;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment