Skip to content

Commit

Permalink
#898 | Select ImpEx Statement removes User Rights block
Browse files Browse the repository at this point in the history
  • Loading branch information
mlytvyn authored Jan 2, 2024
1 parent fea947a commit a95e369
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
- Changed Maven plugin id from `maven` to `org.jetbrains.idea.maven` [#879](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/879)
- FlexibleSearch is not injected into Kotlin simple string literals [#882](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/882)
- IntelliLang pattern fix applied multiple times on each project re-opening during the same session [#884](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/884)
- `Select ImpEx Statement` removes User Rights block [#898](https://github.com/epam/sap-commerce-intellij-idea-plugin/pull/898)

## [2023.3.2]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of "SAP Commerce Developers Toolset" plugin for Intellij IDEA.
* Copyright (C) 2019-2023 EPAM Systems <[email protected]> and contributors
* Copyright (C) 2019-2024 EPAM Systems <[email protected]> and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
Expand Down Expand Up @@ -37,20 +37,17 @@ class ImpExTableSelectAction : AbstractImpExTableAction() {
}

override fun performCommand(project: Project, editor: Editor, element: PsiElement) {
if (element is ImpexUserRights) {
element.delete()
return
}

val header = when (element) {
is ImpexHeaderLine -> element
val tableRange = when (element) {
is ImpexUserRights -> element.textRange
is ImpexHeaderLine -> element.tableRange
is ImpexValueLine -> PsiTreeUtil.getPrevSiblingOfType(element, ImpexHeaderLine::class.java)
?.tableRange
?: return

else -> return
}

with(header.tableRange) {
with(tableRange) {
editor.selectionModel.setSelection(startOffset, endOffset)
}
}
Expand Down

0 comments on commit a95e369

Please sign in to comment.