juliusHuelsmann / st-history-vim

Development of the "vim patch" and a minimalist "history patch" for the suckless simple terminal (st).
MIT License
50 stars 1 forks source link

CRASH: 0001-feat-create-column-patch-equivalent-for-unpatched-st #17

Closed BeyondMagic closed 3 years ago

BeyondMagic commented 3 years ago

A few months ago you posted a patch on https://github.com/juliusHuelsmann/st-history-vim/releases/tmpColDraft/ called 0001-feat-create-column-patch-equivalent-for-unpatched-st.patch to fix columns disappearing on resizing. The good news is that it works when ST size is changed when the new size is very different from before (it doesn't work fine with small resizes), the bad new is that when you change the size multiple times and tries to back to the normal one, it crashes with seg fault. Now, I know that this patch was meant only for a small help in a thread in Reddit, but I'm asking sincerely for help here, the seg fault happens in the following line in the tresize function:

//          tclearregion(mincol, 0, col - 1, minrow - 1);
      tclearregion(pmc, 0, col - 1, minrow - 1);

I tried looking at your official path here, but it's so different that trying to apply the same changes without applying the full history-vim patch is impossible for me. I tried really a lot of things, but it just seems that anything that is not the mincol of the terminal will eventually crashes.

Looking at the tclearregion doesn't seem to help a lot for me, of course I know it clears the terminal, so the size that we want is the pmc variable to be used; anything else is kinda useless for the changes applied from the rest of the patch.

Thanks in advance.

BeyondMagic commented 3 years ago

Resolved in my build by changing some things.

juliusHuelsmann commented 3 years ago

Awesome I'll have a look at your fix :)

BeyondMagic commented 3 years ago

It was the latest commit before the last one. It's obviously based on your collumns official patch, Since mine has the scrollback patch I think it's great it's working fine now, though I still have to make the background looks like the rest when resizing something in the log:

image

Thanks for the patch.