Skip to content

Commit 2676660

Browse files
committed
Merge branch 'private-release/v1.2.3-223' into public-release/v1.2.3-223
2 parents 4341cac + e4be69f commit 2676660

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ All notable changes to the Zowe IntelliJ Plugin will be documented in this file.
1818
* Bugfix: Fixed copy-paste folder to another folder with name conflicts ([13d7d773](https://github.com/zowe/zowe-explorer-intellij/commit/13d7d773))
1919
* Bugfix: Validation changes for LRECL field ([14e384a4](https://github.com/zowe/zowe-explorer-intellij/commit/14e384a4))
2020
* Bugfix: Fixed issue when job was not visible in JesExplorerView when Job Filter is created by JOBID ([5bb17263](https://github.com/zowe/zowe-explorer-intellij/commit/5bb17263))
21+
* Bugfix: Fixed sync during indexing ([436c34a2](https://github.com/zowe/zowe-explorer-intellij/commit/436c34a2))
2122

2223
## [1.2.2-223] (2024-08-21)
2324

src/main/kotlin/eu/ibagroup/formainframe/dataops/content/synchronizer/SyncAction.kt

+9
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ class SyncAction : DumbAwareAction() {
9696
}
9797
val editor = getEditor(e) ?: return
9898

99+
val isDumbMode = ActionUtil.isDumbMode(e.project)
100+
if (!isDumbMode && file.isWritable) {
101+
editor.document.setReadOnly(false)
102+
editor.isViewer = false
103+
} else {
104+
e.presentation.isEnabledAndVisible = false
105+
return
106+
}
107+
99108
val contentSynchronizer = service<DataOpsManager>().getContentSynchronizer(file)
100109
val syncProvider = DocumentedSyncProvider(file)
101110
val currentContent = runReadAction { syncProvider.retrieveCurrentContent() }

src/main/kotlin/eu/ibagroup/formainframe/editor/ChangeContentServiceImpl.kt

+8-4
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,19 @@ class ChangeContentServiceImpl : ChangeContentService {
4848
override fun afterActionPerformed(action: AnAction, event: AnActionEvent, result: AnActionResult) {
4949
if (action is EditorPasteAction || (action is PasteAction && event.place == "EditorPopup")) {
5050
val editor = event.getData(CommonDataKeys.EDITOR) ?: return
51-
52-
processMfContent(editor)
51+
val isFileWritable = requestDocumentWriting(editor)
52+
if (isFileWritable) {
53+
processMfContent(editor)
54+
}
5355
}
5456
}
5557

5658
override fun afterEditorTyping(c: Char, dataContext: DataContext) {
5759
val editor = dataContext.getData(CommonDataKeys.EDITOR) ?: return
58-
59-
processMfContent(editor)
60+
val isFileWritable = requestDocumentWriting(editor)
61+
if (isFileWritable) {
62+
processMfContent(editor)
63+
}
6064
}
6165
}
6266
)

src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorEventsListener.kt

+9-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,16 @@ class FileEditorEventsListener : FileEditorManagerListener {
4141
override fun fileOpened(source: FileEditorManager, file: VirtualFile) {
4242
if (file is MFVirtualFile) {
4343
val editor = source.selectedTextEditor as? EditorEx
44-
editor?.addFocusListener(focusListener)
44+
if (editor != null) {
45+
editor.addFocusListener(focusListener)
46+
val isDumbMode = ActionUtil.isDumbMode(editor.project)
47+
if (isDumbMode) {
48+
editor.document.setReadOnly(true)
49+
editor.isViewer = true
50+
}
51+
super.fileOpened(source, file)
52+
}
4553
}
46-
super.fileOpened(source, file)
4754
}
4855
}
4956

0 commit comments

Comments
 (0)