case LFUN_NOTES_MUTATE:
case LFUN_ALL_INSETS_TOGGLE:
case LFUN_STATISTICS:
+ case LFUN_BRANCH_ADD_INSERT:
flag.setEnabled(true);
break;
p = getPos(cur, cur.boundary());
}*/
int const scrolled = scroll(cmd.action == LFUN_SCREEN_UP
- ? - height_ : height_);
- if (cmd.action == LFUN_SCREEN_UP && scrolled > - height_)
+ ? -height_ : height_);
if (cmd.action == LFUN_SCREEN_UP && scrolled > -height_)
p = Point(0, 0);
if (cmd.action == LFUN_SCREEN_DOWN && scrolled < height_)
cur.reset(buffer_.inset());
updateMetrics();
buffer_.changed();
- d->text_metrics_[&buffer_.text()].editXY(cur, p.x_, p.y_);
+ d->text_metrics_[&buffer_.text()].editXY(cur, p.x_, p.y_,
+ true, cmd.action == LFUN_SCREEN_UP);
//FIXME: what to do with cur.x_target()?
bool update = in_texted && cur.bv().checkDepm(cur, old);
cur.finishUndo();
break;
}
+ case LFUN_BRANCH_ADD_INSERT: {
+ docstring branch_name = from_utf8(cmd.getArg(0));
+ if (branch_name.empty())
+ if (!Alert::askForText(branch_name, _("Branch name")) ||
+ branch_name.empty())
+ break;
+
+ DispatchResult drtmp;
+ buffer_.dispatch(FuncRequest(LFUN_BRANCH_ADD, branch_name), drtmp);
+ if (drtmp.error()) {
+ Alert::warning(_("Branch already exists"), drtmp.message());
+ break;
+ }
+ BranchList & branch_list = buffer_.params().branchlist();
+ Branch const * branch = branch_list.find(branch_name);
+ string const x11hexname = X11hexname(branch->color());
+ docstring const str = branch_name + ' ' + from_ascii(x11hexname);
+ lyx::dispatch(FuncRequest(LFUN_SET_COLOR, str));
+ lyx::dispatch(FuncRequest(LFUN_BRANCH_INSERT, branch_name));
+ break;
+ }
+
+
default:
return false;
}
update |= checkDepm(cur, d->cursor_);
d->cursor_.macroModeClose();
+ d->cursor_.resetAnchor();
d->cursor_.setCursor(cur);
d->cursor_.boundary(cur.boundary());
if (do_selection)