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

Selector randomly jumps up #41

Closed
ghost opened this issue Sep 21, 2017 · 25 comments
Closed

Selector randomly jumps up #41

ghost opened this issue Sep 21, 2017 · 25 comments

Comments

@ghost
Copy link

ghost commented Sep 21, 2017

Building from HEAD on nixOS.
I have a weird bug which makes the 'current selection' jump up several entries randomly, without any input. Reproduced with different emulators and in a tty.

@jarun
Copy link
Owner

jarun commented Sep 21, 2017

Does the same item remain selected or the selection moves to a different item?

@jarun
Copy link
Owner

jarun commented Sep 21, 2017

Also, please share the steps for reproduction. Otherwise it's difficult to figure out what's going wrong.

@ghost
Copy link
Author

ghost commented Sep 22, 2017

The selector moves to a higher item, by a constant number, repeatedly with random intervals.
I used the nixpkgs expression to build, but pointed the 'src' to the latest commit (plus my own key config, but I tried a vanilla build, and had the same bug).
The behavior is constant.

@jarun
Copy link
Owner

jarun commented Sep 22, 2017

What is the interval? Are you having any filter enabled (like size, time etc.)?

I didn't understand what you meant regarding building... did you try compiling and using nnn from master?

@jarun
Copy link
Owner

jarun commented Sep 22, 2017

The behavior is constant.

I need the exact steps to observe this behaviour.

@ghost
Copy link
Author

ghost commented Sep 22, 2017

Yes I compiled from master (I used the expression 'latest commit', but I means, latest commit on master). I used the nix expression I linked, but used the latest master as 'src'.
It seems to only jump up once every time a new folder is opened, after about one second. I said the number of entries jumped was constant. I was wrong; it usually jumps to the first item but not always.

@jarun
Copy link
Owner

jarun commented Sep 22, 2017

When you enter a new directory, nnn should jump to the first entry instantly. Please note down what you did after entering the directory.

@ghost
Copy link
Author

ghost commented Sep 22, 2017

I have narrowed it down better. Basically, every time it switches to a new folder (left or right), after a second it jumps to the highest visible item. If the intended behavior is to automatically selecte the highest visible item (I would want to change that personally), then there should not be 1000+ms before it happens. Could I just disable that 'goto top on open dir' completely?

edit: s/should/should\ not

@jarun
Copy link
Owner

jarun commented Sep 22, 2017

Here's the defined behaviour:

  • If you are going into a directory (right) the first entry will be selected (otherwise, which one do we select?)
  • If you are going to the parent (left), the child directory will be selected in the parent

The selection is instant, there is no delay. If you are seeing a delay, there's something else in play.

Also, I asked earlier, do you have any filter set or are you in the navigate-as-you-type mode?

@jarun
Copy link
Owner

jarun commented Sep 22, 2017

In addition to my earlier comment, I am not sure if it's relevant, but what's your hardware (CPU, RAM)?

@ghost
Copy link
Author

ghost commented Sep 22, 2017

The expected behavior you are describing is what im seeing, so the jump is a separate issue. There is no filter, no navigate as I type mode, just plain browsing. This is happening on my workstation, so lots of cpu and ram.

@jarun
Copy link
Owner

jarun commented Sep 22, 2017

Yes, we need to figure out what's taking it so long to jump.

Now when you say jump, are you saying that the selection shows up after a second, OR when you enter the dir something is selected first, then the selection jumps up to the topmost entry (as it should)?

Also what happens if you are in the light mode (press d)?

@jarun
Copy link
Owner

jarun commented Sep 22, 2017

I'll setup nixOS on a VM and see if I can reproduce it. Makes life easier for both of us. ;)

@ghost
Copy link
Author

ghost commented Sep 22, 2017

I mean everything behaves fine, the cursor appears where it should be, but if I then move the cursor down (or if it wasnt placed at the top), after a second the cursor will move back to the highest visible item. It will only do this only once every time a directory is opened.

@ghost
Copy link
Author

ghost commented Sep 22, 2017

Light mode has the same bug.

@jarun
Copy link
Owner

jarun commented Sep 22, 2017

I'll check.

@jarun
Copy link
Owner

jarun commented Sep 22, 2017

Does nixos have libncursesw or ncursesw? I can see it links to ncurses.

@ghost
Copy link
Author

ghost commented Sep 22, 2017

I rebuilt my system and the issue went away.
Sorry about that. Ill let you know if I ever find the cause.
Thanks a lot for nnn, I love it.

@ghost ghost closed this as completed Sep 22, 2017
@jarun
Copy link
Owner

jarun commented Sep 22, 2017

Awesome! Award a star. ;)

@ghost
Copy link
Author

ghost commented Sep 22, 2017

The issue is caused by my custom key bindings.
I'll try reversing my changes line by line.

@ghost
Copy link
Author

ghost commented Sep 22, 2017

Found it.
Changing 'Ctrl-U' for 'Ctrl-L' triggers the bug.
That makes sense, it's the shortcut for PageUp.
So it seems something is sending a 'Ctrl-L' signal to nnn after opening a directory.
Is it nnn doing that or would that be ncurses library?

@jarun
Copy link
Owner

jarun commented Sep 22, 2017

Ctrl-L is for triggering a refresh. If you are tinkering with the defaults, I believe you have to go all the way and figure out the issue. I would have suggested something if I had any idea what goes wrong, but the number of keybinds are just too many right now to guess something.

@ghost
Copy link
Author

ghost commented Sep 23, 2017

So nnn is sending the Ctrl-L signal?

@jarun
Copy link
Owner

jarun commented Sep 23, 2017

No Page up. It's above Ctrl-L in the key bindings structure. So pressing Ctrl-L is doing what Ctrl-U should do.

@jarun
Copy link
Owner

jarun commented Sep 23, 2017

It's difficult for me to pursue an issue which is not under my control. In your issue report you didn't even mention you are changing the code. If you are trying to hack things, you are welcome to do so. If you find it worth changing mainline, please raise a PR and I will review it if the change adds value to the current set of features. A bug report is not the right place to support experimental code changes.

Repository owner locked and limited conversation to collaborators Sep 23, 2017
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant