termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.39k stars 3.08k forks source link

[Bug]: Cannot paste `Markdown` howtos into `Termux` through `vi` or `vim` (to store pages to view when network is slow): `a<ctrl><alt>v` causes "Termux isn't responding" #22393

Open SwuduSusuwu opened 1 day ago

SwuduSusuwu commented 1 day ago

Problem description

None of the solutions from https://stackoverflow.com/questions/18258561/pasting-a-huge-amount-of-text-into-vim-is-slow or https://askubuntu.com/questions/221148/vim-struggles-when-copy-pasting-large-blocks-of-text-in-from-an-external-window fix this; have done :set noswapfile, :set lazyredraw, :set paste, :set syntax=off, :set foldexpr='', but cannot do this.

This was a problem for years, with the solution to just use wget or fetch to download the howtos.

Steps to reproduce the behavior.

https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html does not look good in vim as raw HTML (although you can paste the raw HTML into vim), thus have pasted its HTML into GitHub (which takes just a few milliseconds to convert it to Markdown), and then pasted that Markdown into vim (which causes "Termux isn't responding"). [Am sure that this is a crash and not a performance issue, since iIt doesn't matter how long you wait for it to finish, and you cannot use shortcuts to switch to another tab (such as to launch top).] Thought that perhaps a much smaller page would do, thus pasted https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html into GitHub's comment window (to convert it to Markdown), and from that into vim, which also crashes.

What is the expected behavior?

Should allow to paste into vim, should allow to switch tabs to launch top. Object.html is just 24kilobytes, thus it should not hang forever; was able to load 4megabyte binaries into vim in an instant, or to convert those into 16megabyte hexcode which load in a few seconds (so know this is not a performance issue.) It is remarkable how fast Termux + vim is for most uses.

System information

~ $ termux-info
Termux Variables:
TERMUX_EXEC__PROC_SELF_EXE=/data/data/com.termux/files/usr/bin/termux-info
TERMUX_VERSION=googleplay.2024.10.24
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://termux.net stable main
Updatable packages:
clang/stable 19.1.4 aarch64 [upgradable from: 19.1.3]
command-not-found/stable 2.4.0-52 aarch64 [upgradable from: 2.4.0-51]
git/stable 2.47.1 aarch64 [upgradable from: 2.47.0]
harfbuzz/stable 10.1.0-1 aarch64 [upgradable from: 10.1.0]
libcompiler-rt/stable 19.1.4 aarch64 [upgradable from: 19.1.3]
libllvm/stable 19.1.4 aarch64 [upgradable from: 19.1.3]
libltdl/stable 2.5.4 aarch64 [upgradable from: 2.5.3]
libsqlite/stable 3.47.1 aarch64 [upgradable from: 3.46.1]
libssh/stable 0.11.1 aarch64 [upgradable from: 0.10.6]
lld/stable 19.1.4 aarch64 [upgradable from: 19.1.3]
llvm-tools/stable 19.1.4 aarch64 [upgradable from: 19.1.3]
llvm/stable 19.1.4 aarch64 [upgradable from: 19.1.3]
vim-runtime/stable 9.1.0850 all [upgradable from: 9.1.0800]
vim/stable 9.1.0850 aarch64 [upgradable from: 9.1.0800]
termux-tools version:
3.0.8
Android version:
14

but version is not relevent as this was a problem for years (whether you use Termux from F-droid or Google Store).

SwuduSusuwu commented 1 day ago

Screenshot_20241126-190926 "+p pastes fast, but just 52 lines (out of 202).

TomJo2000 commented 1 day ago

This should be relocated to termux/termux-packages as a bug report, as it appears to be a packaging issue rather than an application issue.

From a quick reading of what you have described it looks like you're running into the differences between the "+ register and the "* register. I also notice you are running an out of date version of the Vim package and a Playstore build of Termux either of which may be a contributing factor in the unexpected behavior you are seeing.

I am unable to replicate the issue you are describing in either Vim or Neovim on my device.