martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.19k stars 259 forks source link

Mysterious string makes regex behavior dependent on cursor position #1064

Open ldwgchen opened 1 year ago

ldwgchen commented 1 year ago

Said string is present in the second line of every PDF file. I believe its use is to declare the version of PDF format.

Say we use vis to edit a file like this:

himom
MYSTERIOUS_STRING
hidad
hidad

If I place the cursor before the string, /hidad won't move my cursor as expected. If I place the cursor after the string, however, searching by / works normally.

Also, :x/hidad/c/hiaunt/ won't work no matter where I position my cursor.

mcepl commented 1 year ago

vis doesn’t touch files much, but I am really not sure whether it supports editing of binary (non-text) files.

rnpnr commented 8 months ago

I think we will a minimal example file that demonstrates this behaviour. Otherwise it will be difficult to debug.

ldwgchen commented 8 months ago

I think we will a minimal example file that demonstrates this behaviour. Otherwise it will be difficult to debug.

Here is an example. example.txt