-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathzsh.patch
135 lines (119 loc) · 4.32 KB
/
zsh.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
diff -ru a/Config/defs.mk.in
--- a/Config/defs.mk.in 2014-12-13 18:55:54.000000000 -0500
+++ b/Config/defs.mk.in 2015-07-15 22:06:56.455125410 -0400
@@ -41,7 +41,7 @@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
-MODDIR = $(libdir)/$(tzsh)/$(VERSION)
+MODDIR = $(ATHAME_TESTDIR)$(libdir)/$(tzsh)/$(VERSION)
infodir = @infodir@
mandir = @mandir@
datarootdir = @datarootdir@
@@ -67,7 +67,7 @@
DLLDFLAGS = @DLLDFLAGS@
LIBLDFLAGS = @LIBLDFLAGS@
EXELDFLAGS = @EXELDFLAGS@
-LIBS = @LIBS@
+LIBS = @LIBS@ -lutil
DL_EXT = @DL_EXT@
DLLD = @DLLD@
EXPOPT = @EXPOPT@
diff -ru a/Src/Makefile.in b/Src/Makefile.in
--- a/Src/Makefile.in 2014-12-13 18:55:54.000000000 -0500
+++ b/Src/Makefile.in 2015-07-15 22:06:56.455125410 -0400
@@ -142,8 +142,15 @@
uninstall: uninstall.bin uninstall.modules
.PHONY: install uninstall
-install.bin: install.bin-here
-uninstall.bin: uninstall.bin-here
+install.vimbed:
+ if [ -d $(DESTDIR)$(libdir)/athame_zsh ]; then rm -r $(DESTDIR)$(libdir)/athame_zsh; fi
+ mkdir -p $(DESTDIR)/$(libdir)
+ cp -r $(dir_top)/$(subdir)/Zle/vimbed/plugin $(DESTDIR)/$(libdir)/athame_zsh
+uninstall.vimbed:
+ rm -r $(DESTDIR)$(libdir)/athame_zsh
+
+install.bin: install.bin-here install.vimbed
+uninstall.bin: uninstall.bin-here uninstall.vimbed
.PHONY: install.bin uninstall.bin
# install binary, creating install directory if necessary
diff -ru a/Src/Makemod.in.in b/Src/Makemod.in.in
--- a/Src/Makemod.in.in 2014-12-13 18:55:54.000000000 -0500
+++ b/Src/Makemod.in.in 2015-07-15 21:52:18.235086024 -0400
@@ -42,13 +42,14 @@
sdir_src = $(sdir_top)/Src
dir_src = $(dir_top)/Src
+athame = -DVIMBED_LOCATION='"$(ATHAME_TESTDIR)$(libdir)/athame_zsh"' -DATHAME_VIM_BIN='"${ATHAME_VIM_BIN}"' -DATHAME_USE_JOBS_DEFAULT='${ATHAME_USE_JOBS_DEFAULT}'
# ========== COMPILATION RULES ==========
DNCFLAGS =
-COMPILE = $(CC) -c -I. -I$(dir_top)/Src -I$(sdir_top)/Src -I$(sdir_top)/Src/Zle -I$(sdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(D@L@CFLAGS)
-DLCOMPILE = $(CC) -c -I. -I$(dir_top)/Src -I$(sdir_top)/Src -I$(sdir_top)/Src/Zle -I$(sdir) $(CPPFLAGS) $(DEFS) -DMODULE $(CFLAGS) $(DLCFLAGS)
+COMPILE = $(CC) -c -I. -I$(dir_top)/Src -I$(sdir_top)/Src -I$(sdir_top)/Src/Zle -I$(sdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(D@L@CFLAGS) $(athame)
+DLCOMPILE = $(CC) -c -I. -I$(dir_top)/Src -I$(sdir_top)/Src -I$(sdir_top)/Src/Zle -I$(sdir) $(CPPFLAGS) $(DEFS) -DMODULE $(CFLAGS) $(DLCFLAGS) $(athame)
LINK = $(CC) $(LDFLAGS) $(EXELDFLAGS) $(EXTRA_LDFLAGS) -o $@
DLLINK = $(DLLD) $(LDFLAGS) $(LIBLDFLAGS) $(DLLDFLAGS) -o $@
diff -ru a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
--- a/Src/Zle/zle_main.c 2015-05-22 18:16:13.000000000 -0400
+++ b/Src/Zle/zle_main.c 2015-07-15 21:09:04.778303048 -0400
@@ -28,6 +28,7 @@
*/
#include "zle.mdh"
+#include "athame.h"
#include "zle_main.pro"
#ifdef HAVE_POLL_H
@@ -1097,6 +1098,8 @@
void
zlecore(void)
{
+ athame_init(SHTTY, NULL);
+
Keymap km;
#if !defined(HAVE_POLL) && defined(HAVE_SELECT)
struct timeval tv;
@@ -1186,6 +1189,7 @@
}
popheap();
+ athame_cleanup(0);
}
/* Read a line. It is returned metafied.
diff -ru a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
--- a/Src/Zle/zle_keymap.c 2015-05-22 18:16:13.000000000 -0400
+++ b/Src/Zle/zle_keymap.c 2015-08-23 00:04:00.000000000 -0400
@@ -28,6 +28,7 @@
*/
#include "zle.mdh"
+#include "athame.h"
/*
* Keymap structures:
@@ -1673,7 +1674,20 @@
static int
getkeybuf(int w)
{
- int c = getbyte((long)w, NULL, 1);
+ int c;
+ if (athame_enabled())
+ {
+#ifdef MULTIBYTE_SUPPORT
+ lastchar_wide_valid = 0;
+#endif
+ c = lastchar = STOUC(athame_loop(SHTTY));
+ if(c == STOUC(EOF)) {
+ return EOF;
+ }
+ }
+ else {
+ c = getbyte((long)w, NULL, 1);
+ }
if(c < 0)
return EOF;
diff -ru a/Src/Zle/zle.mdd b/Src/Zle/zle.mdd
--- a/Src/Zle/zle.mdd 2014-12-13 18:55:54.000000000 -0500
+++ b/Src/Zle/zle.mdd 2015-07-15 21:12:11.711644764 -0400
@@ -8,7 +8,7 @@
objects="zle_bindings.o zle_hist.o zle_keymap.o zle_main.o \
zle_misc.o zle_move.o zle_params.o zle_refresh.o \
zle_thingy.o zle_tricky.o zle_utils.o zle_vi.o zle_word.o \
-textobjects.o"
+textobjects.o athame.o"
headers="zle.h zle_things.h"