1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-06-01 01:34:07 +02:00

Added count so Ex command can be repeated.

This commit is contained in:
rmaddy 2003-04-20 19:17:15 +00:00
parent aad2a65678
commit f85148b766

View File

@ -72,7 +72,8 @@ public abstract class CommandHandler
return flags; return flags;
} }
public void process(final Editor editor, final DataContext context, final ExCommand cmd) throws ExException public void process(final Editor editor, final DataContext context, final ExCommand cmd, final int count) throws
ExException
{ {
if ((flags & RANGE_FORBIDDEN) != 0 && cmd.getRanges().size() != 0) if ((flags & RANGE_FORBIDDEN) != 0 && cmd.getRanges().size() != 0)
{ {
@ -89,16 +90,20 @@ public abstract class CommandHandler
RunnableHelper.runWriteCommand(new Runnable() { RunnableHelper.runWriteCommand(new Runnable() {
public void run() public void run()
{ {
boolean res = false; boolean res = true;
try try
{ {
UndoManager.getInstance().beginCommand(editor); UndoManager.getInstance().beginCommand(editor);
res = execute(editor, context, cmd); for (int i = 0; i < count && res; i++)
{
res = execute(editor, context, cmd);
}
} }
catch (ExException e) catch (ExException e)
{ {
// TODO - handle this // TODO - handle this
VimPlugin.indicateError(); VimPlugin.indicateError();
res = false;
} }
finally finally
{ {
@ -121,7 +126,10 @@ public abstract class CommandHandler
{ {
try try
{ {
execute(editor, context, cmd); for (int i = 0; i < count; i++)
{
execute(editor, context, cmd);
}
} }
catch (ExException e) catch (ExException e)
{ {