Skip to content

Instantly share code, notes, and snippets.

--- a/src/ansi.c
+++ b/src/ansi.c
@@ -1506,8 +1506,24 @@
{
if (curr->w_stringp >= curr->w_string + MAXSTR - 1)
curr->w_state = LIT;
+# ifdef UTF8
+ else if (c < 0x80)
+ *(curr->w_stringp)++ = c;
+ else if (c < 0x800)
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -728,6 +728,10 @@
LPutChar(&curr->w_layer, &omc, ox, oy);
LGotoPos(&curr->w_layer, curr->w_x, curr->w_y);
}
+ if (curr->w_mbcs)
+ {
+ curr->w_rend.mbcs = curr->w_mbcs = 0;
+ }
@rcmdnk
rcmdnk / private.xml
Last active January 20, 2017 08:32
private.xml for Karabiner
<?xml version="1.0"?>
<root>
<replacementdef>
<replacementname>VIM_EMU_IGNORE_APPS</replacementname>
<replacementvalue>TERMINAL, VI, CATHODE, PASSWORD, FIREFOX, EMACS, LOGMEIN, GOOGLE_CHROME</replacementvalue>
</replacementdef>
<!-- key mappings with vim_emu -->
<list>
<item>
<name>MySetting with vim_emu</name>
@rcmdnk
rcmdnk / screen-utf8-osc.diff
Last active February 17, 2017 22:34
patch for screen 4.5.0
diff --git a/src/ansi.c b/src/ansi.c
index d88e153..fc42a0a 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -1493,8 +1493,24 @@ int c;
{
if (curr->w_stringp >= curr->w_string + MAXSTR - 1)
curr->w_state = LIT;
+# ifdef UTF8
+ else if (c < 0x80)
#!/usr/bin/env bash
. sentaku -n
SENTAKU_FILE_CONTNT_LINE=10
_sf_file_content () {
if [ $_s_file_content -eq 0 ];then
return
fi
#!/usr/bin/env bash
. sentaku -n
_sf_s () {
output="$(_sf_nth $((_s_current_n))) value: ${_s_inputs[$_s_current_n]}
===============
"
if [ -f ${_s_inputs[$_s_current_n]} ];then
output="$output$(head -n $(($_s_lines-3)) ${_s_inputs[$_s_current_n]})"
@rcmdnk
rcmdnk / abc
Last active April 22, 2016 08:30
abc
mygist
diff --git a/src/ansi.c b/src/ansi.c
index fa53775..4a21f84 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -725,6 +725,10 @@ register int len;
LPutChar(&curr->w_layer, &omc, ox, oy);
LGotoPos(&curr->w_layer, curr->w_x, curr->w_y);
}
+ if (curr->w_mbcs)
+ {
@rcmdnk
rcmdnk / jk_vim.ahk
Last active September 22, 2015 02:22
jk to enter the normal mode at ahk
j & k:: ; Go to Normal mode (for vim) with IME off even at converting.
if (VIM_IME_GET(A)) {
Send,{Esc}
Sleep 1
VIM_IME_SET()
}
VimSetMode("Vim_Normal")
Return