IngoMeyer441 / tmux-easy-motion

Vim's easy-motion for tmux
MIT License
81 stars 6 forks source link

Landing one row above target when starting from topmost row, leftmost column #10

Closed butwerenotthereyet closed 3 years ago

butwerenotthereyet commented 3 years ago

Fill the history with more than a screen of text: 0 Scroll to the top and move to the far left: 1 Prepare to target a letter: 2 Target a letter that appears more than once (in the image, r): 3 If there are multiple target letters, press the first (in the image, x): 4 Press the final target letter (in the image, y): 5 Land one row above the targeted letter (in the image, the o above the targeted r)

IngoMeyer441 commented 3 years ago

For me, tmux-easy-motion does not work at all if starting from the topmost row, leftmost column :astonished: I have to debug this first...

butwerenotthereyet commented 3 years ago

Yeah 😅 I think difference might be if you run tmux clear. Without you get behavior you see.

IngoMeyer441 commented 3 years ago

Commit 8308bd1c66541bb8cc0c3978c9a24389b7eb68f9 fixes that no jump target is displayed at all. But I cannot reproduce the behavior you describe. Is it maybe also fixed with 8308bd1c66541bb8cc0c3978c9a24389b7eb68f9?

butwerenotthereyet commented 3 years ago

No, it still happens to me. Did you try use long lines in the text file so that they wrap when running cat? Does it happen for you if you set your shell's PS1 to $ before following the steps in https://github.com/IngoMeyer441/tmux-easy-motion/issues/10#issue-796561785 ?

$ tmux -V
tmux next-3.3
$ cat ~/test.conf
run-shell "~/tmux-easy-motion/easy_motion.tmux"
set -g default-shell /bin/bash
set-option -g status-right ''
$ cat .bash-profile
export PS1=$
$ #to launch tmux:
$ tmux -L test -f ~/test.conf
IngoMeyer441 commented 3 years ago

Thanks, I could reproduce it now. The tmux command start-of-line behaves differently for wrapped text if the cursor is already on the left-most column (in that case the cursor is set to the beginning of the wrapped line and causes the wrong row offset in your example). Commit b395c45e54de2907bdef6abe1da48844dab93e1a adds a column check and only executes start-of-line if the cursor is not in the first column.

butwerenotthereyet commented 3 years ago

That fixed it, thank you!!