1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-01-11 19:42:46 +01:00

Added some help methods

This commit is contained in:
rmaddy 2003-04-20 19:14:49 +00:00
parent ac6251a267
commit be33e488e5

View File

@ -23,6 +23,7 @@ import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.util.TextRange;
import com.maddyhome.idea.vim.ex.range.LineNumberRange;
import com.maddyhome.idea.vim.ex.range.AbstractRange;
import com.maddyhome.idea.vim.helper.EditorHelper;
import java.util.ArrayList;
@ -137,6 +138,21 @@ public class Ranges
return new TextRange(start, Math.min(end, EditorHelper.getFileSize(editor)));
}
public static TextRange getCurrentLineRange(Editor editor, DataContext context)
{
Ranges ranges = new Ranges();
return ranges.getTextRange(editor, context, -1);
}
public static TextRange getFileTextRange(Editor editor, DataContext context)
{
Ranges ranges = new Ranges();
ranges.addRange(AbstractRange.createRange("%", 0, false));
return ranges.getTextRange(editor, context, -1);
}
public String toString()
{
StringBuffer res = new StringBuffer();