return hp;
}
-UndoLine::UndoLine(UndoHash *hash)
+UndoLine::UndoLine(UndoHash *hash, char *tp)
{
- this->txt = 0; this->len = 0;
+ this->txt = tp; this->len = 0;
this->hash = hash;
hash->occurs[va] = hash->occurs[vb] = 1;
}
void UndoVersion::scan_lines(UndoHashTable *hash, char *sp, char *ep)
{
- append(new UndoLine(hash->bof));
for( int line=1; sp<ep; ++line ) {
char *txt = sp;
while( sp<ep && *sp++ != '\n' );
++ln->hash->occurs[ver];
append(ln);
}
- append(new UndoLine(hash->eof));
}
UndoVersion alines(va), blines(vb);
char *asp = data, *aep = asp + data_size-1;
char *bsp = prev, *bep = bsp + prev_size-1;
+ alines.append(new UndoLine(hash.bof, asp));
+ blines.append(new UndoLine(hash.bof, bsp));
alines.scan_lines(&hash, asp, aep);
blines.scan_lines(&hash, bsp, bep);
-// trim suffix
int asz = alines.size(), bsz = blines.size();
+// trim matching suffix
while( asz > 0 && bsz > 0 && alines[asz-1]->eq(blines[bsz-1]) ) {
- --asz; --bsz;
+ aep = alines[--asz]->txt; alines.remove_object();
+ bep = blines[--bsz]->txt; blines.remove_object();
}
+// include for matching last item
+ alines.append(new UndoLine(hash.eof, aep));
+ blines.append(new UndoLine(hash.eof, bep));
+ hash.eof->line[va] = asz++;
+ hash.eof->line[vb] = bsz++;
int ai = 0, bi = 0;
while( ai < asz || bi < bsz ) {
break;
default:
- if( !ctrl_down() ) {
+ if( show_query && !ctrl_down() ) {
int query_len = strlen(query);
if( query_len < (int)sizeof(query)-1 &&
top_level->get_keypress() > 30 &&
if( query_len > 0 ) query[--query_len] = 0;
new_selection = query_list();
}
- if( show_query ) {
- if( query_len > 0 )
- show_tooltip(query);
- else
- hide_tooltip();
- }
+ if( query_len > 0 )
+ show_tooltip(query);
+ else
+ hide_tooltip();
redraw = 1;
result = 1;
}
if( alias->get_w() > w1 ) w1 = drag->get_w();
x += w1 + margin;
- add_tool(justify_title = new BC_Title(x, y, _("Justify:")));
+ add_tool(justify_title = new BC_Title(x+50, y, _("Justify:")));
add_tool(left = new TitleLeft(client, this, x, y + 20));
w1 = left->get_w();
add_tool(center = new TitleCenter(client, this, x, y + 50));
}
TitleAlias::TitleAlias(TitleMain *client, TitleWindow *window, int x, int y)
- : BC_CheckBox(x, y, client->config.style & FONT_ALIAS, _("Alias"))
+ : BC_CheckBox(x, y, client->config.style & FONT_ALIAS, _("Smooth"))
{
this->client = client;
this->window = window;