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

Insert mode "eats" the line above cursor #16

Closed
kyx0r opened this issue Oct 22, 2020 · 9 comments
Closed

Insert mode "eats" the line above cursor #16

kyx0r opened this issue Oct 22, 2020 · 9 comments

Comments

@kyx0r
Copy link
Contributor

kyx0r commented Oct 22, 2020

Hello, entering insert mode using 'o' or 'i' and then hitting linefeed shifts every line and ends up not drawing the line above the cursor until you exit the insert mode. This is really annoying when editing and not something I would expect to happen. Let me know if this is an interesting issue to you as well. My terminal of choice is st, yet I have confirmed that this bug does not occur in tty nor xterm. The culprit is patch https://st.suckless.org/patches/anysize/st-anysize-0.8.1.diff which changes st window height to not be rounded to the equivalent rows * charheight, etc. Is there a way to patch out neatvi to be independent of this terminal size limitation? I'm thinking redraw stuff midway in insert mode may do the trick.

@kyx0r
Copy link
Contributor Author

kyx0r commented Oct 22, 2020

*Update never mind the anysize patch, it's actually caused by this patch :
https://st.suckless.org/patches/vim_browse/

@aligrudi
Copy link
Owner

aligrudi commented Oct 25, 2020 via email

@kyx0r
Copy link
Contributor Author

kyx0r commented Oct 25, 2020

Hello Ali,

Here is how generally it works in unpatched st version and other terminals like xterm, tty, etc.
https://ibb.co/k8XDfht
On the image vi.c is open and cursor moved to line that says "WITH REGARD TO THIS SOFTWARE ..."
then 'o' is pressed. The bottom portion of the screen gets moved down and new line is created. This is just how it should
work, no issue here.

https://ibb.co/nwYd9VJ
This is how the same operation looks like in patched st build with vim_browse. You can see that the "WITH REGARD TO THIS SOFTWARE ..." was "eaten" and instead of bottom part shifting down, the top part moved up instead and now there is also a weird new line at line 0.

@kyx0r
Copy link
Contributor Author

kyx0r commented Oct 25, 2020

It feels like because vim_browse patch adds a history buffer that is "above" the current displayed characters, it also messes up the line where the '\n' should be created, meaning that '\n' is always inserted on line 0. So if you keep hitting linefeed (enter) the result will look like this: https://ibb.co/grZ3DVD

@aligrudi
Copy link
Owner

aligrudi commented Oct 25, 2020 via email

@kyx0r
Copy link
Contributor Author

kyx0r commented Oct 26, 2020

It doesn't.

unpatched: https://ibb.co/5x17Pp4
patched:https://ibb.co/6WQ2LBg

@kyx0r
Copy link
Contributor Author

kyx0r commented Oct 26, 2020

Either way, I think the terminal is at fault here, I hope the patch maintainer from suckless sees this report here and fixes it, because terminal should not be changing the way basic commands like this work.

@aligrudi
Copy link
Owner

aligrudi commented Oct 26, 2020 via email

@kyx0r
Copy link
Contributor Author

kyx0r commented Apr 26, 2021

Fixed by maintainers.

@kyx0r kyx0r closed this as completed Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants