unexpected highlighting/selection
Modernized fork of NEdit, with unicode support and AA text rendering
Brought to you by:
pyrphoros
It’s strange, but I suspect it may be related to the “File Modified” dialog that pops up.
Steps to reproduce (on Linux):
1) Compile the following C code and run the generated executable (for example, "printsomething"). Redirect the output to a file (for example, "aa") using command "printsomething > aa".
#include <stdio.h>
#include <unistd.h>
#include <time.h>
int main()
{
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 200000000; // 200 million ns = 0.2 seconds
for (int i = 0; i < 10000; i++) {
printf("Loop iteration ...................................... %d\n", i);
fflush(stdout);
nanosleep(&ts, NULL);
}
return 0;
}
2) Open another terminal and launch xnedit to open the file "aa".
3) Click anywhere in the file and wait for the “File has been modified” dialog to appear. Click the “Reload” button, then scroll the mouse wheel slowly (not too slow).
You will very likely notice that while scrolling, some text becomes selected and highlighted as shown in the attached screenshot.
Here is the snapshot.
My system is Fedora 43. Xnedit source code is the latest version downloaded from GitHub.