Skip to content
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

Cursors jumps to the beginning #5904

Closed
buhtz opened this issue Feb 2, 2020 · 47 comments · Fixed by #6528 or #11282
Closed

Cursors jumps to the beginning #5904

buhtz opened this issue Feb 2, 2020 · 47 comments · Fixed by #6528 or #11282
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs entry-editor export / save ui

Comments

@buhtz
Copy link

buhtz commented Feb 2, 2020

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.

@Siedlerchr
Copy link
Member

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

@buhtz
Copy link
Author

buhtz commented Feb 9, 2020

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
Copy link
Author

buhtz commented Feb 9, 2020

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.

@AEgit
Copy link

AEgit commented Feb 10, 2020

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

#5079 (comment)

@buhtz
Copy link
Author

buhtz commented Feb 10, 2020

I do not understand your question.

@AEgit
Copy link

AEgit commented Feb 10, 2020

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?

(#5904 (comment))

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.

(#5904 (comment))

Isn't this video meant as a response to the question made here:
#5079 (comment)

?

@buhtz
Copy link
Author

buhtz commented Feb 10, 2020

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.

@AEgit
Copy link

AEgit commented Feb 10, 2020

Ah, cheers! Sorry for the confusion.

@Ka0o0
Copy link
Contributor

Ka0o0 commented Feb 12, 2020

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

@buhtz
Copy link
Author

buhtz commented Feb 25, 2020

Can still reproduce with windows nightly from 24.02.2020

@EliasBRL
Copy link

EliasBRL commented Apr 14, 2020

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)

@remi-garcia
Copy link

remi-garcia commented May 6, 2020

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)

@buhtz
Copy link
Author

buhtz commented May 6, 2020

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

@Siedlerchr Siedlerchr reopened this May 6, 2020
@Siedlerchr
Copy link
Member

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
Copy link
Member

Siedlerchr commented May 11, 2020

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 Siedlerchr added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label May 11, 2020
@EliasBRL
Copy link

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.

@notuntoward
Copy link

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

@Siedlerchr
Copy link
Member

Siedlerchr commented May 12, 2020

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.

@notuntoward
Copy link

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

@reox
Copy link
Contributor

reox commented Jul 24, 2020

I'm on

JabRef 5.1--2020-07-20--9cd9390
Linux 5.7.0-1-amd64 amd64 
Java 14.0.2

and still have this issue :(. On some occasions the cursor will jump to the beginning of the comment field.
Should the fix be in that version already? Or do I need to fix the library file first or something like that?

@ilippert
Copy link
Contributor

Sorry; I am afraid the issue reoccurs:
JabRef 5.2--2020-11-23--350ec1f
Linux 5.9.9-200.fc33.x86_64 amd64
Java 15.0.1

I use the Annote field to annotate the entry. And the cursor jumps occasionally back to the first line's beginning.

Should this be a new issue, or reopened here?

@ilippert
Copy link
Contributor

ilippert commented Aug 15, 2021

@Siedlerchr, I still experience this problem in

JabRef 5.3--2021-07-16--c99d61c
Linux 5.13.8-200.fc34.x86_64 amd64
Java 16.0.1
JavaFX 16+8

@ilippert
Copy link
Contributor

ilippert commented Sep 24, 2021

still experience this here

JabRef 5.4--2021-09-22--e9d845b
Linux 5.13.16-200.fc34.x86_64 amd64
Java 16.0.2
JavaFX 17+18

@ilippert
Copy link
Contributor

The issue seems to involve the following:

  1. edit a field, add some new and empty paragraphs at the end of the text
  2. save, switch to another application, wait for a bit
    when I return to JabRef, the empty paragraphs at the end are removed and the cursor is back to the beginning of the field's text.

@ilippert
Copy link
Contributor

ilippert commented Sep 24, 2021

Ok, if this is re-opened, please note the considerations at #8095 (which are slightly more developed than the ones here). I will close the other issue in favour of this one.

@Siedlerchr
Copy link
Member

Does this happen in normal text fields (e.g. authors/title/journal)
Does this happe in multiline fields?
Does this happen in the bibtex entry editor?

@ilippert
Copy link
Contributor

I experience this in multiline fields only so far (but have not tested in the other fields)

@ilippert
Copy link
Contributor

JabRef 5.4--2021-10-19--f328363
Linux 5.14.12-200.fc34.x86_64 amd64
Java 16.0.2
JavaFX 17.0.0.1+1
still happening (multiline field)

@ilippert
Copy link
Contributor

JabRef 5.4--2021-12-20--ab44182
Linux 5.15.11-200.fc35.x86_64 amd64
Java 16.0.2
JavaFX 17.0.1+1

still happening

@ilippert
Copy link
Contributor

ilippert commented Jan 5, 2022

JabRef 5.5--2022-01-02--55ceed9
Linux 5.15.12-200.fc35.x86_64 amd64
Java 16.0.2
JavaFX 17.0.1+1

same here

@ilippert
Copy link
Contributor

JabRef 5.7--2022-06-15--cb5fe60
Linux 5.18.5-200.fc36.x86_64 amd64
Java 18.0.1
JavaFX unknown

Experienced again in multiline field.

@github-project-automation github-project-automation bot moved this to Normal priority in Prioritization Jan 18, 2023
@ThiloteE ThiloteE added the bug Confirmed bugs or reports that are very likely to be bugs label Jan 18, 2023
@ilippert
Copy link
Contributor

experienced again a few times with

JabRef 5.13--2024-01-09--01c3e15
Linux 6.6.11-200.fc39.x86_64 amd64
Java 21.0.1
JavaFX 20+19

@koppor koppor moved this from Normal priority to High priority in Prioritization Mar 25, 2024
@ilippert
Copy link
Contributor

ilippert commented May 5, 2024

and via

JabRef 5.14--2024-05-02--ca16e86
Linux 6.8.7-300.fc40.x86_64 amd64
Java 21.0.2
JavaFX 22.0.1+7

sorry, I don't want to call out a problem here or attract attention; I merely seek to provide a trace of information, in case that becomes helpful.

@Siedlerchr
Copy link
Member

Siedlerchr commented May 5, 2024

I can reproduce this here on mac with latest dev if I have spaces before the first character:
Autosave + Reformat on change are disabled and no save actions are configured.
Wait like 10-20 seconds or so until the automatic backup kicks in.
=> The spaces before the first char are removed, and the cursor jumps to the beginning

e.g. something like

         ssssss

@koppor koppor self-assigned this May 6, 2024
@koppor
Copy link
Member

koppor commented May 6, 2024

For the record: Implemented on January 17, 2020 at #5838 and noticed a few days later. Kudos to @buhtz. The team just did not correlate.

The little pre-save processing (newlines, trim values) is now implemented as a mandatory save action.

(And I am working on a fix)

@koppor koppor mentioned this issue May 7, 2024
6 tasks
@koppor
Copy link
Member

koppor commented Jun 7, 2024

Intermediate result: The code doing this is javafx.scene.control.TextInputControl#filterAndSet.

@github-project-automation github-project-automation bot moved this from High priority to Done in Prioritization Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs entry-editor export / save ui
Projects
Archived in project