-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Update entry for every change in the source panel #3366
Conversation
I have several issues with this on my machine.
Some of the things might be older issues but leaving the source editor unusable should be introduced by this PR. |
@halirutan Thank you for the intensive testing.
|
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.
As far as I've tested, this resolves #3352 #3363 #3375 #3369 and maybe also a few other of the entry editor issues that I haven't tested.
- Seems to work again as far as I can see
- Seems to be broken since moving to JavaFX
- Agreed
- Undo in the source tab is essentially broken since changing the entry editor to JavaFX. The
CodeArea
listens to undo events on its own and that is not integrated into the undo framework for the remaining field editors. That is the reason for the strange behavior (which is still present in this PR).
When adding a new entry of type article and moving to the source tab, I get the exception below. After that, the entire entry editor seems to be broken, regardless of the tab.
12:04:25.997 [JavaFX Application Thread] ERROR org.jabref.FallbackExceptionHandler - Uncaught exception occurred in Thread[JavaFX Application Thread,5,main]
java.lang.IndexOutOfBoundsException: [-2147483648, 8) is not a valid range within [0, 8)
at org.reactfx.util.Lists.checkRange(Lists.java:128) ~[reactfx-2.0-M5.jar:?]
at org.reactfx.util.Lists.checkRange(Lists.java:123) ~[reactfx-2.0-M5.jar:?]
at org.reactfx.collection.MemoizationListImpl.forget(MemoizationList.java:184) ~[reactfx-2.0-M5.jar:?]
at org.fxmisc.flowless.CellListManager.cropTo(CellListManager.java:71) ~[flowless-0.5.2.jar:?]
at org.fxmisc.flowless.CellPositioner.cropTo(CellPositioner.java:24) ~[flowless-0.5.2.jar:?]
at org.fxmisc.flowless.Navigator.cropToNeighborhoodOf(Navigator.java:209) ~[flowless-0.5.2.jar:?]
at org.fxmisc.flowless.Navigator.placeStartAtMayCrop(Navigator.java:182) ~[flowless-0.5.2.jar:?]
at org.fxmisc.flowless.Navigator.visit(Navigator.java:111) ~[flowless-0.5.2.jar:?]
at org.fxmisc.flowless.StartOffStart.accept(TargetPosition.java:49) ~[flowless-0.5.2.jar:?]
at org.fxmisc.flowless.Navigator.layoutChildren(Navigator.java:67) ~[flowless-0.5.2.jar:?]
at javafx.scene.Parent.layout(Parent.java:1087) ~[jfxrt.jar:?]
at org.fxmisc.flowless.VirtualFlow.layoutChildren(VirtualFlow.java:165) ~[flowless-0.5.2.jar:?]
at javafx.scene.Parent.layout(Parent.java:1087) ~[jfxrt.jar:?]
at javafx.scene.Parent.layout(Parent.java:1093) ~[jfxrt.jar:?]
at javafx.scene.Parent.layout(Parent.java:1093) ~[jfxrt.jar:?]
at javafx.scene.Parent.layout(Parent.java:1093) ~[jfxrt.jar:?]
at javafx.scene.Parent.layout(Parent.java:1093) ~[jfxrt.jar:?]
at javafx.scene.Parent.layout(Parent.java:1093) ~[jfxrt.jar:?]
at javafx.scene.Scene.doLayoutPass(Scene.java:552) ~[jfxrt.jar:?]
at javafx.scene.Scene.preferredSize(Scene.java:1646) ~[jfxrt.jar:?]
at javafx.scene.Scene.impl_preferredSize(Scene.java:1720) ~[jfxrt.jar:?]
at javafx.stage.Window$9.invalidated(Window.java:846) ~[jfxrt.jar:?]
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109) ~[jfxrt.jar:?]
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:144) ~[jfxrt.jar:?]
at javafx.stage.Window.setShowing(Window.java:922) ~[jfxrt.jar:?]
at javafx.stage.Window.show(Window.java:937) ~[jfxrt.jar:?]
at com.sun.javafx.stage.EmbeddedWindow.show(EmbeddedWindow.java:58) ~[jfxrt.jar:?]
at javafx.embed.swing.JFXPanel.lambda$addNotify$49(JFXPanel.java:799) ~[jfxrt.jar:?]
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295) ~[jfxrt.jar:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_121]
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294) ~[jfxrt.jar:?]
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) ~[jfxrt.jar:?]
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) ~[jfxrt.jar:?]
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191) ~[jfxrt.jar:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
Code-wise the PR looks fine. I have to say that I do not like the bindings, since in my point of view they make the code harder to read and much harder to debug. They also provide for more seamless updates, though, so maybe I just still need time to get more comfortable with them.
Because it fixes so many things, I am for eventually merging it when all exceptions are fixed and the localizations are synchronized. @tobiasdiez @halirutan You should probably synchronize on how does what when it comes to repairing the source tab. Just to avoid effort duplication.
@lenhard Also thanks to you for the intensive testing! I've not realized how many bugs this PR actually fixes. The exception you get is also present in the current master #3375. I actually cannot reproduce it, so its not possible for me to solve or analyze it (however: it seems to be a problem with the code editor itself, Sidenote: you are right, debugging these bindings is a nightmare...on the other hand, they are really powerful and make things easier (as the 2-way binding in this PR shows; setting up something similar with our event system would be way harder). @halirutan I'm really sorry that my changes overlapped with your's. I read it to late that you already had a solution for some of these issues. Feel free to work on the editor, I'll stay put and work at other things now. (A more detailed communication on these matters is hard at the moment since my skype is not working due to the great firewall and vpn issues...) |
I just tried testing the latest build which I believe includes this change. Changes now a properly saved |
I tried this release too, here (#3383) it even "destroys" the source field until I restart Jabref. In the Example I documented there is also a |
@sambo57u Thank you very much for trying the new build. If you add an additional { jabref can no longer parse the entry successful and thus does not stores the changes. But as soon as you close the bracket } JabRef should start to update the entry again. I just pushed a fix to the newest development version that makes the error message at the bottom disappear as soon as the code can be parsed again. |
Trying 4.1dev build 2017-11-01 04:42
|
* upstream/master: (79 commits) Update richtext and flowless (#3386) Source tab: hide notification pane when code is correct again (#3387) Titles are optional at crossref (#3378) Update entry for every change in the source panel (#3366) Rework AutoSetFileLinks (#3368) revert wrongly commited changes Refactorings (#3370) Fix freezing when running cleanup file operations like rename (#3315) This additional style setting for IDEA (#3355) Fix checkstyle Add proper equals to content selector Source tab entry duplication (#3360) Use CITE_COMMENT not only for external latex editors but also for cop… (#3351) Updating with new translations (#3348) Upgrade error-prone (#3350) Jabref_pt_BR partially updated (#3349) Delete unused code Extract difference finder from gui to logic Used late initialization for context menus (#3340) Fix NPE when calling with bib file as cmd argument (#3343) ...
@tobiasdiez It seems that several other people are experiencing problems with the source tab that are affecting the complete entry editor, e.g. also #3217 (comment) I guess the binding as it stands here does not work properly. I think the merge of this might have been a little too early. Could you please investigate this issue (sort of soon, sorry), because the master branch is kind of broken at the moment. I am not sure, but maybe an alternative would be to revert the merge, reopen the closed issues linked above, and go for a new PR. After all, it might be better to have no sync between source tab and other tabs than to have no entry editor at all. But maybe the whole problem is easily fixed soon in a follow-up PR and then reverting would not be necessary. |
@lenhard Yes, sorry for merging a bit to early. I thought that since the index out of bounds exception was already a known issue, I did not introduce a new bug and thus everything is fine. But, as we learned now, the fixes in this PR actually make it so that users hit the IndexOutOfBounds bug way more often (since now the external updates actually work...). Hopefully #3390 provides a temporary fix until FXMisc/RichTextFX#637 is solved. |
@tobiasdiez Thanks for the quick action :) I'll try to review the new PR as soon as possible and then we will hopefully be back in a working state soon. |
I am only seeing the 11-01 12;11 build on master. Testing that two problems remain, the mouse movement and nothing is saved. Even after making a change one does ctrl+s and sees a message that the bib file is saved, it is really not saved. |
As of 4.1dev 2017-11-03 07:17 version no change in the source editor is saved, plus the cursor issue. |
@sambo57u As of now, the fix is not yet merged into master, so this is expected. If you want to try out the current version of the fix that seems to repair the saving, you can get it here: http://builds.jabref.org/storeSourceFix/ |
Hi, unfortunately the version from http://builds.jabref.org/storeSourceFix/ have the same problem. This was fixed at some point except the issue of getting an error message when one tried to enter a curly bracket. At this point no changes are saved in my test. |
Ok, I also have some update problems in that left. Looks like they won't get fixed as part of that PR. Well have to see if someone addresses them. |
* upstream/master: (22 commits) Improve SyncLang.py (#3184) Config intellj code style to adhere to empty lines checkstyle rule (#3365) Don't list same look and feels more than once (#3393) progessdialog and result table are now shown correclty on copy files Export pdf/linked files (#3147) Added checking integrity dialog (#3388) Update richtext and flowless (#3386) Source tab: hide notification pane when code is correct again (#3387) Titles are optional at crossref (#3378) Update entry for every change in the source panel (#3366) Rework AutoSetFileLinks (#3368) revert wrongly commited changes Refactorings (#3370) Fix freezing when running cleanup file operations like rename (#3315) This additional style setting for IDEA (#3355) Fix checkstyle Add proper equals to content selector Delete unused code Extract difference finder from gui to logic Remove unnecessary EntrySorter ... # Conflicts: # src/main/java/org/jabref/gui/entryeditor/SourceTab.java
* upstream/master: (26 commits) Fix static localized text (#3400) Fix problems in source editor (#3398) Fix MathSciNet fetcher (#3402) Fix NPE when saving new file Improve SyncLang.py (#3184) Config intellj code style to adhere to empty lines checkstyle rule (#3365) Don't list same look and feels more than once (#3393) progessdialog and result table are now shown correclty on copy files Export pdf/linked files (#3147) Added checking integrity dialog (#3388) Update richtext and flowless (#3386) Source tab: hide notification pane when code is correct again (#3387) Titles are optional at crossref (#3378) Update entry for every change in the source panel (#3366) Rework AutoSetFileLinks (#3368) revert wrongly commited changes Refactorings (#3370) Fix freezing when running cleanup file operations like rename (#3315) This additional style setting for IDEA (#3355) Fix checkstyle ... # Conflicts: # CHANGELOG.md
In #3352 (comment), @lenhard suggested to update the entry as soon as the source code is changed (instead of only on focus lost). This is accomplished in this PR.
Jörg mentioned that the most direct solution does not work since
This problem is circumvented by implementing a proper bidirectional binding between the entry and the source code, which prevents update cycles.
Moreover, in case of a parse error, the message is no longer shown in a dialog but inline as a notification:
gradle localizationUpdate
?