Skip to content

Commit

Permalink
Merge branch 'private-release/v1.2.2-231' into public-release/v1.2.2-231
Browse files Browse the repository at this point in the history
Signed-off-by: Uladzislau <leksilonchikk@gmail.com>
  • Loading branch information
KUGDev committed Aug 21, 2024
2 parents d87f6d7 + 41d1793 commit e0d4ae2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file.
* Bugfix: java.lang.RuntimeException: Cannot invoke (class=, method=onCacheUpdated, topic=cacheUpdated) ([2fedc7f5](https://github.com/zowe/zowe-explorer-intellij/commit/2fedc7f5))
* Bugfix: "Allocate like" action causes exception when refresh on mask is started ([d13a1c72](https://github.com/zowe/zowe-explorer-intellij/commit/d13a1c72))

## [1.2.0-231] (2024-04-15)
## [1.2.0-231] (2024-04-16)

### Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import eu.ibagroup.formainframe.explorer.FilesWorkingSet
import eu.ibagroup.formainframe.explorer.ui.ExplorerTreeNode
import eu.ibagroup.formainframe.explorer.ui.ExplorerUnitTreeNodeBase
import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
import eu.ibagroup.formainframe.explorer.ui.NodeData
import eu.ibagroup.formainframe.explorer.ui.cleanCacheIfPossible
import eu.ibagroup.formainframe.explorer.ui.getExplorerView
import eu.ibagroup.formainframe.vfs.MFVirtualFile
Expand Down
10 changes: 8 additions & 2 deletions src/main/kotlin/eu/ibagroup/formainframe/utils/encodingUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.intellij.ide.IdeBundle
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.application.runReadAction
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.project.DumbAwareAction
Expand Down Expand Up @@ -138,7 +139,12 @@ fun inspectSafeEncodingChange(virtualFile: VirtualFile, charset: Charset): Encod
* Change file encoding action that invokes the change encoding dialog.
* @return true if changed or false otherwise.
*/
fun changeFileEncodingAction(project: Project?, virtualFile: VirtualFile, attributes: RemoteUssAttributes, charset: Charset): Boolean {
fun changeFileEncodingAction(
project: Project?,
virtualFile: VirtualFile,
attributes: RemoteUssAttributes,
charset: Charset
): Boolean {
val encodingInspection = inspectSafeEncodingChange(virtualFile, charset)
val safeToReload = encodingInspection.safeToReload
val safeToConvert = encodingInspection.safeToConvert
Expand Down Expand Up @@ -234,7 +240,7 @@ fun showSaveAnywayDialog(charset: Charset): Boolean {
val result = Messages.showDialog(
XmlStringUtil.wrapInHtml(
IdeBundle.message("encoding.unsupported.characters.message", charset.displayName()) +
"<br><br>Content may change after saving."
"<br><br>Content may change after saving."
),
IdeBundle.message("incompatible.encoding.dialog.title", charset.displayName()),
arrayOf("Save Anyway", CommonBundle.getCancelButtonText()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
package eu.ibagroup.formainframe.utils

import com.intellij.openapi.Disposable
import com.intellij.openapi.application.*
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.application.runInEdt
import com.intellij.openapi.application.runWriteAction
import com.intellij.openapi.components.ComponentManager
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.diagnostic.logger
Expand Down Expand Up @@ -181,13 +184,13 @@ fun runInEdtAndWait(runnable: () -> Unit) {
ApplicationManager.getApplication().invokeAndWait(runnable)
}

inline fun runWriteActionInEdt(crossinline block: () -> Unit) {
fun runWriteActionInEdt(block: () -> Unit) {
runInEdt {
runWriteAction(block)
}
}

inline fun runWriteActionInEdtAndWait(crossinline block: () -> Unit) {
fun runWriteActionInEdtAndWait(block: () -> Unit) {
runInEdtAndWait {
runWriteAction(block)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ class EditorTestSpec : WithApplicationShouldSpec({

assertSoftly { isSynced shouldBe false }
}
should("not perform auto file sync when file is syncing now") {
currentBytes = byteArrayOf(116, 101, 120, 116, 33)
should("not perform auto file sync when file is syncing now") {
currentBytes = byteArrayOf(116, 101, 120, 116, 33)

every { isFileSyncingNow(any()) } returns true
every { isFileSyncingNow(any()) } returns true

fileEditorFocusListener.focusLost(editorMock, focusEventMock)
fileEditorFocusListener.focusLost(editorMock, focusEventMock)

assertSoftly { isSynced shouldBe false }
}
assertSoftly { isSynced shouldBe false }
}

unmockkAll()
}
Expand Down

0 comments on commit e0d4ae2

Please sign in to comment.