We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab05023 commit 92c2420Copy full SHA for 92c2420
diff.cxx
@@ -10,16 +10,16 @@ extern "C" {
10
11
/** diff() Lua function. */
12
static int diff(lua_State *L) {
13
- diff_match_patch<std::string> dmp;
14
- auto diffs = dmp.diff_main(luaL_checkstring(L, 1), luaL_checkstring(L, 2), false);
15
- dmp.diff_cleanupSemantic(diffs);
16
- lua_createtable(L, diffs.size() * 2, 0);
17
- int len = 1;
18
- for (auto &diff : diffs) {
19
- lua_pushnumber(L, diff.operation), lua_rawseti(L, -2, len++);
20
- lua_pushstring(L, diff.text.c_str()), lua_rawseti(L, -2, len++);
21
- }
22
- return 1;
+ diff_match_patch<std::string> dmp;
+ auto diffs = dmp.diff_main(luaL_checkstring(L, 1), luaL_checkstring(L, 2), false);
+ dmp.diff_cleanupSemantic(diffs);
+ lua_createtable(L, diffs.size() * 2, 0);
+ int len = 1;
+ for (auto &diff : diffs) {
+ lua_pushnumber(L, diff.operation), lua_rawseti(L, -2, len++);
+ lua_pushstring(L, diff.text.c_str()), lua_rawseti(L, -2, len++);
+ }
+ return 1;
23
}
24
25
extern "C" {
0 commit comments