jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Cursors jumps to the beginning

Open buhtz opened this issue 5 years ago • 46 comments

Using JabRef 5.* dev (29th January 2020).

I intensivly use the "comments" field to add my own notes to the entries. So there is often a lot of text and lines in it.

While typing it often happens that the cursor jumps back to the first line and first column.

buhtz avatar Feb 02 '20 09:02 buhtz

On Windows 10 I cannot reproduce the error. Could you also please try the latest snapshot and report your OS?

Siedlerchr avatar Feb 09 '20 17:02 Siedlerchr

I am confused. Somebody asked me (on a GitHub issue) to record a video about this behavior. I did and uploaded it here/somehwere (?).

Maybe it was a forked repo?

buhtz avatar Feb 09 '20 20:02 buhtz

I got it. I was totally stumped about reading to much Issues the same time. ;) I posted the video on the wrong Issue.

5904 - entry window - cursor jump.zip

The zip file contains an avi-file (recorded with MS PowerPoint 2016 and converted with Avidemux) and the bib-file generated while the recording. The video is recorded on Windows 10. But I can also reproduce the behaviour with Debian 10.

What you can see in the video: The first jumps of the cursors looks like that they are somehow connected to my Strg+S pressing. But later the jumps ocure also without saving. There is also a nice Exception. btw: I totally ignore exceptions in the current state of JabRef because they appear so often in so many cases.

buhtz avatar Feb 09 '20 21:02 buhtz

@Codeberg-AsGithubAlternative-buhtz Wasn't this meant as an answer to this question?

https://github.com/JabRef/jabref/issues/5079#issuecomment-581174352

AEgit avatar Feb 10 '20 09:02 AEgit

I do not understand your question.

buhtz avatar Feb 10 '20 09:02 buhtz

I am referring to this:

I am confused. Somebody asked me (on a GitHub issue) to record a video about this behavior. I did and uploaded it here/somehwere (?).

Maybe it was a forked repo?

(https://github.com/JabRef/jabref/issues/5904#issuecomment-583892624)

and this:

I got it. I was totally stumped about reading to much Issues the same time. ;) I posted the video on the wrong Issue.

(https://github.com/JabRef/jabref/issues/5904#issuecomment-583894638)

Isn't this video meant as a response to the question made here: https://github.com/JabRef/jabref/issues/5079#issuecomment-581174352

?

AEgit avatar Feb 10 '20 09:02 AEgit

Correct. The video was not an answer to #5079 . Because of that I removed the video and my comment from there.

I am not sure how this confusion could happened. ;)

The video is for this (#5904) Issue to demonstrate the problem.

buhtz avatar Feb 10 '20 09:02 buhtz

Ah, cheers! Sorry for the confusion.

AEgit avatar Feb 10 '20 10:02 AEgit

I can reproduce this issue if one places a whitespace at the end of the comment and saves the library with ctrl+s

Edit: This actually happens with every field

Ka0o0 avatar Feb 12 '20 17:02 Ka0o0

Can still reproduce with windows nightly from 24.02.2020

buhtz avatar Feb 25 '20 12:02 buhtz

I have the same issue on Windows 10 (10.0 amd64) with JabRef 5.0--2020-03-06--2e6f433 and Java 13.0.2.

On my system, the following approach reproduces the issue:

  1. Create new entry
  2. Go to 'Comments' field
  3. Press Enter once
  4. Keep pressing any key, e.g. a

After about 400 keystrokes (the number varies) the cursor jumps to the beginning of the comments field.

If I press Spacebar instead of Enter in Step 3, I get an uncaught exception, again after about 400 keystrokes:

java.lang.IndexOutOfBoundsException
	at org.jabref.merged.module/javafx.scene.control.TextInputControl.replaceText(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.scene.control.behavior.TextAreaBehavior.replaceText(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.scene.control.behavior.TextInputControlBehavior.defaultKeyTyped(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.scene.control.behavior.TextInputControlBehavior.lambda$keyMapping$62(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.scene.control.inputmap.InputMap.handle(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
	at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Scene$KeyHandler.process(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Scene.processKeyEvent(Unknown Source)
	at org.jabref.merged.module/javafx.scene.Scene$ScenePeerListener.keyEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.glass.ui.View.handleKeyEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.glass.ui.View.notifyKey(Unknown Source)
	at org.jabref.merged.module/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at org.jabref.merged.module/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

EliasBRL avatar Apr 14 '20 12:04 EliasBRL

I have the same (or at least similar) issue. However there is a popup error too.

JabRef 5.0--2020-03-09--6bff936
Linux 5.3.0-51-generic amd64 
Java 13.0.2

Ubuntu 18.04.4 LTS

me@pc:~$ java --version
openjdk 11.0.7 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)
Content of the popup:
java.lang.IllegalStateException: Task must only be used from the FX Application Thread
	at org.jabref.merged.module/javafx.concurrent.Task.checkThread(Unknown Source)
	at org.jabref.merged.module/javafx.concurrent.Task.isRunning(Unknown Source)
	at org.jabref.merged.module/org.controlsfx.control.textfield.AutoCompletionBinding.onUserInputChanged(Unknown Source)
	at org.jabref.merged.module/org.controlsfx.control.textfield.AutoCompletionBinding.setUserInput(Unknown Source)
	at org.jabref/org.jabref.gui.autocompleter.AutoCompletionTextInputBinding.setUserInputText(Unknown Source)
	at org.jabref/org.jabref.gui.autocompleter.AutoCompletionTextInputBinding.lambda$new$0(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.TextInputControl$TextProperty.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.TextInputControl$TextProperty.markInvalid(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.TextInputControl$TextProperty.controlContentHasChanged(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.TextInputControl.lambda$new$0(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.TextArea$TextAreaContent.insert(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.TextInputControl.replaceText(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.TextInputControl.filterAndSet(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.TextInputControl$TextProperty.doSet(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.TextInputControl$TextProperty.set(Unknown Source)
	at org.jabref.merged.module/javafx.scene.control.TextInputControl$TextProperty.set(Unknown Source)
	at org.jabref.merged.module/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref.merged.module/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.binding.BidirectionalBinding$TypedGenericBidirectionalBinding.changed(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/javafx.beans.property.StringPropertyBase.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/javafx.beans.property.StringPropertyBase.markInvalid(Unknown Source)
	at org.jabref.merged.module/javafx.beans.property.StringPropertyBase.set(Unknown Source)
	at org.jabref.merged.module/javafx.beans.property.StringPropertyBase.set(Unknown Source)
	at org.jabref.merged.module/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref.merged.module/javafx.beans.property.StringProperty.setValue(Unknown Source)
	at org.jabref/org.jabref.gui.util.BindingsHelper$BidirectionalBinding.updateLocked(Unknown Source)
	at org.jabref/org.jabref.gui.util.BindingsHelper$BidirectionalBinding.changedB(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/javafx.beans.binding.ObjectBinding.invalidate(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.binding.BindingHelperObserver.invalidated(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.collections.MapListenerHelper$Generic.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.collections.MapListenerHelper.fireValueChangedEvent(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.collections.ObservableMapWrapper.callObservers(Unknown Source)
	at org.jabref.merged.module/com.sun.javafx.collections.ObservableMapWrapper.put(Unknown Source)
	at org.jabref/org.jabref.model.entry.BibEntry.setField(Unknown Source)
	at org.jabref/org.jabref.model.cleanup.FieldFormatterCleanup.cleanupSingleField(Unknown Source)
	at org.jabref/org.jabref.model.cleanup.FieldFormatterCleanup.cleanupAllFields(Unknown Source)
	at org.jabref/org.jabref.model.cleanup.FieldFormatterCleanup.cleanup(Unknown Source)
	at org.jabref/org.jabref.logic.exporter.BibDatabaseWriter.applySaveActions(Unknown Source)
	at org.jabref/org.jabref.logic.exporter.BibDatabaseWriter.savePartOfDatabase(Unknown Source)
	at org.jabref/org.jabref.logic.exporter.BibDatabaseWriter.saveDatabase(Unknown Source)
	at org.jabref/org.jabref.logic.autosaveandbackup.BackupManager.performBackup(Unknown Source)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at org.jabref/org.jabref.logic.autosaveandbackup.BackupManager.lambda$startBackupTask$2(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)windows sometimes
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

remi-garcia avatar May 06 '20 14:05 remi-garcia

I also know this popup error. But I wasn't able to reproduce it stable. So I did not report it here.

buhtz avatar May 06 '20 17:05 buhtz

There have been multiple reports on the errors. They have more or less the same underlying reason (gui access from other thread). Comes from saving/backup manager.

Siedlerchr avatar May 06 '20 17:05 Siedlerchr

Could you all please try this version? https://builds.jabref.org/pull/6455/merge/ I disabled autoconpletion for multiline fields as it appeared to be the reason for the error and the threading error is fixed as well.

Siedlerchr avatar May 11 '20 17:05 Siedlerchr

I did a quick test and the issue seems to be fixed! Thanks :)

I'll keep using your build and let you know if any errors occur.

EliasBRL avatar May 11 '20 18:05 EliasBRL

For me, there's no change in the "cursor bouncing to top of comment window" problem.

JabRef 5.1-PullRequest6455.385--2020-05-11--afc4fd7 Windows 10 10.0 amd64 Java 14.0.1

notuntoward avatar May 11 '20 19:05 notuntoward

We merged the changes from the PR to master

We would like to ask you to use a development build from https://builds.jabref.org/master and report back if it works for you. Please remember to make a backup of your library before trying-out this version.

Siedlerchr avatar May 12 '20 06:05 Siedlerchr

Still no change. The cursor bounces to the top of the comment window.

JabRef 5.1--2020-05-12--ce49261 Windows 10 10.0 amd64 Java 14.0.1

notuntoward avatar May 12 '20 14:05 notuntoward

I can confirm, that the problem of the bouncing cursor is still present. It is particularly tedious because it jumps while writing.

The Markdown feature is awesome, however! One slight problem I am experiencing with the Markdown extension is, that the symbol ">" is not parsed and instead I get >. This might be due to the German keyboard, though

JabRef 5.1--2020-05-18--a4f8ba3 Windows 10 10.0 amd64 Java 14.0.1

florianHofherr avatar May 19 '20 10:05 florianHofherr

Internal idea: we check at the update of a field: if new text != old text then udpate (see binding)

koppor avatar May 26 '20 06:05 koppor

Can confirm that the curors still jumps to the beginning when saving.

JabRef 5.1--2020-05-26--0d7156b Windows 10 10.0 amd64 Java 14.0.1

buhtz avatar May 28 '20 12:05 buhtz

Interestingly, the jumping to the start seems to have disappeared in

JabRef 5.1--2020-06-15--ed96faa
Linux 5.6.0-2-amd64 amd64 
Java 14.0.1

(But I'm not quite sure yet, it is hard to trigger on purpose...) However, I still get a "The library has been modified by another program" warning which says the comment has changed: image

reox avatar Jun 16 '20 05:06 reox

@reox We are currently investigating this issue and discovered that it has to do with different line break characters. See #6528

Siedlerchr avatar Jun 16 '20 06:06 Siedlerchr

Not disappeared by me. Cursor still jumps in

JabRef 5.1--2020-06-22--403a47f
Windows 10 10.0 amd64 
Java 14.0.1

buhtz avatar Jun 23 '20 15:06 buhtz

JabRef 5.1--2020-06-25--d364ffb Linux 5.6.19-300.fc32.x86_64 amd64 Java 14.0.1

cursor still jumps

ilippert avatar Jun 29 '20 13:06 ilippert

I think i fixed the issue with cursor jumping. This might also fix the library changed. Could you please test this version from here? https://builds.jabref.org/pull/6528/merge/

Siedlerchr avatar Jul 11 '20 18:07 Siedlerchr

thanks a lot!

JabRef 5.1-PullRequest6528.793--2020-07-11--93eaf4f Linux 5.7.7-200.fc32.x86_64 amd64 Java 14.0.1

seems to have fixed this, tells my 10 min testing. i would post it here, if it reappears anytime soon?

ilippert avatar Jul 12 '20 07:07 ilippert

Yes, if you encounter the problem again with that version please let us know.

Siedlerchr avatar Jul 12 '20 09:07 Siedlerchr

Can confirm the fix for this version


JabRef 5.1-PullRequest6528.793--2020-07-11--93eaf4f
Windows 10 10.0 amd64 
Java 14.0.1

https://github.com/JabRef/jabref/pull/6528

buhtz avatar Jul 14 '20 09:07 buhtz