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

DEL key visually deletes two characters instead of one #15020

Closed
HennyH opened this issue Jul 8, 2021 · 10 comments
Closed

DEL key visually deletes two characters instead of one #15020

HennyH opened this issue Jul 8, 2021 · 10 comments
Labels
bug issues reporting wrong behavior display redraw, layout, presentation tui
Milestone

Comments

@HennyH
Copy link

HennyH commented Jul 8, 2021

  • nvim --version:
NVIM v0.5.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe /DWIN32 /D_WINDOWS /W3 -DNVIM_TS_HAS_SET_MATCH_LIMIT /MD /Zi /O2 /Ob1 /DNDEBUG /W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -D_WIN32_WINNT=0x0600 -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -ID:/a/neovim/neovim/build/config -ID:/a/neovim/neovim/src -ID:/a/neovim/neovim/nvim-deps/usr/include -ID:/a/neovim/neovim/build/src/nvim/auto -ID:/a/neovim/neovim/build/include
Compiled by runneradmin@fv-az152-786

Features: -acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM\sysinit.vim"
  fall-back for $VIM: "C:/Program Files/nvim/share/nvim"

Run :checkhealth for more info
  • Operating system/version: Windows 10 Pro 21H1
  • Terminal name/version: Windows Terminal Preview
  • $TERM: builtin_vtpcon

Steps to reproduce using nvim -u NORC

Create a HTML file with the following contents:

<p style="margin: 2em; text-align: center;">
    <strong style="color: var(--primary-header-color);">
            ⚠️  Due to Coronavirus restrictions Church capacity has been limited to 150 persons in masks per Mass.
            Four meter social distancing is in place.
    </strong>
</p>

Open the file with neovim, move to line 3 and enter INSERT mode. Navigate to the beginning of the "150" on the third line. Press DEL.

I've also asked a question on stackexchange: https://vi.stackexchange.com/questions/31773/delete-key-appears-to-remove-two-characters

Actual behaviour

Visually both the 1 and the 5 from the 150 are removed visually. However if I save the file and view the contents, or ESC into NORMAL mode and then press CTRL+SHIFT+L I can see that only the 1 was deleted.

Expected behaviour

Visually only the 1 is deleted.

@HennyH HennyH added the bug issues reporting wrong behavior label Jul 8, 2021
@rktjmp
Copy link
Contributor

rktjmp commented Jul 11, 2021

Can't reproduce this in Linux x Alacritty, xterm or wezterm, probably fair to tag this as a window and/or windows term preview issue?

I assume by the description that you only see the errant behaviour on the line with an emoji on it?

Do you see the same or similar effects on the following example when performing the same steps?

<p style="margin: 2em; text-align: center;">
    <strong style="color: var(--primary-header-color);">
            How does it behave on this line 150 with a tail ⚠️
    </strong>
</p>

@justinmk justinmk added display redraw, layout, presentation platform:windows tui labels Jul 11, 2021
@HennyH
Copy link
Author

HennyH commented Jul 11, 2021

I paste in the example text:
image
I then press the DEL key
image

So it correctly only removes one character however my cursor ends up in the wrong position (one extra to the right). If I attempt to delete text within the "with" the cursor also moves weirdly in the same manner.

Interestingly it seems if I instead use Backspace to delete a character I have no issues. :verbose imap <del> reports "No mapping found"

@justinmk
Copy link
Member

what does :checkhealth nvim report? specifically the terminal section of that report.

@HennyH
Copy link
Author

HennyH commented Jul 12, 2021

When I run :checkhealth nvim I only see the following:

image

Is there a specific option to get a report relating to the terminal?

@rktjmp
Copy link
Contributor

rktjmp commented Jul 12, 2021

What happens if you paste the line (⚠️ Due to Coronavirus restrictions Church capacity has been limited to 150 persons in masks per Mass.) onto the command prompt (outside of vim) and try to delete the 1? There's more going on in nvim, but just to check it's not a basic issue with windows terminal mishandling emoji width.

Or even test it in another editor like nano too, to narrow down the focus.

@HennyH
Copy link
Author

HennyH commented Jul 12, 2021

  1. Pasting into commandline prompt and deleting the 1 works as expected (Powershell, Fish under WSL).
  2. Pasting the text into nano and then deleting the 1 as expected.
  3. If I open vi (/usr/bin/vi under WSL) and paste the text in, and then move to before the 1 and press delete it works as expected (different to nvim).

All of the above was done in windows terminal as before.

@djdv
Copy link

djdv commented Jul 16, 2021

Adding to vi in the post above, this also seems to work as expected inside of the win32 distributions of vim (v8.2.3161).
nvim(v0.6.0-dev+42-geece0735f) seems to corrects itself if I move off of the line after the edit.
You can see characters being drawn into the line number column as well in nvim. Probably related to #14650

Desktop.2021.07.16.-.10.54.15.05-halfresolution.mp4

Fullsize video

(There seems to be 2 other emoji related issues visible here too, but they're likely unrelated. Probably tied to glyph font fallback. The glyph for ⚠️ is different in vim and nvim, I think it's actually the same glyph, but scaled differently. And a separate glyph 📝 isn't appearing properly in my status bar at all within nvim. This glyph does appear (without color) in nvim-qt.)

@justinmk
Copy link
Member

justinmk commented Jul 2, 2022

Assuming this is fixed in recent Windows Terminal, if not leave a comment

@justinmk justinmk closed this as completed Jul 2, 2022
@3N4N
Copy link
Contributor

3N4N commented Jul 2, 2022

@justinmk Not fixed in Windows Terminal (v1.14.1452.0). And behaves the same in the old conhost.exe terminal, too. But this is a conhost/WT bug, not nvim specific. WT+conhost behaves weird with that yellow triangle emoji outside nvim, too. So maybe this issue should be on the microsoft side.

@justinmk justinmk reopened this Jul 2, 2022
@justinmk justinmk added the status:blocked-external Needs a third-party / external change or fix label Jul 2, 2022
@justinmk justinmk added this to the unplanned milestone Jul 2, 2022
@zeertzjq
Copy link
Member

Fixed by #19686

@zeertzjq zeertzjq removed status:blocked-external Needs a third-party / external change or fix platform:windows labels Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior display redraw, layout, presentation tui
Projects
None yet
Development

No branches or pull requests

6 participants