-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VIM-1062 #333
VIM-1062 #333
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR! Could you please check some comments?
override val argFlags = flags(RangeFlag.RANGE_OPTIONAL, ArgumentFlag.ARGUMENT_OPTIONAL, Access.READ_ONLY) | ||
override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean { | ||
val arg = cmd.argument.trim() | ||
if (arg.isNotEmpty() && arg.matches(Regex("^\\d+$"))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use toIntOrNull
instead of regex check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
final FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(project); | ||
final EditorWindow window = fileEditorManager.getCurrentWindow(); | ||
VirtualFile[] editors = fileEditorManager.getOpenFiles(); | ||
if (number == 99) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 99 is a special number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was by mistake. i removed it.
if (number >= 0 && number < editors.length) { | ||
fileEditorManager.closeFile(editors[number], window); | ||
} | ||
if (number < 0 || number >= editors.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if is empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was by mistake. i removed it.
That's great, thank you for your work! |
https://youtrack.jetbrains.com/issue/VIM-1062
added:
:bn select the next editor tab, circling from the last to the first
:bp select the previous editor tab, circling from the first to the last
:bd or bdX