-
Notifications
You must be signed in to change notification settings - Fork 1
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
Where's the column_patch? #18
Comments
Hi! :) ./release.sh 1 1 which generates all patches (including the column patch) from the current state of the repo. Note:
There is also a patch which does what you'ld like to achive without the history patch pre-applied which I released, but it has got the same issue (discussed here, patch linked in the ticket). I hope that helps! |
@juliusHuelsmann Does column_patch remove the functionality of mouse scroll? Ive tried vim-browse , it was great but I needed the mouse scroll support somehow :( Also whats the difference between these two? All I want is text not being cut when I resize my terminal : simplescreenrecorder-2021-06-10_17.56.15.mp4 |
Scrolling via mouse Difference between patches
The first one is the column patch, the second one only the history patch built to be applied on top of commit What you should apply for your use-case
I'll have a look at the cause of the error sometimes this year, but I don't know when (It's likely not too hard to track down, but I'm currently rather busy). If you want I can notify you once I fixed that, I'll just keep this issue open then |
Oh idk C and I have the scrollback patch already applied but it doesnt function at all once I patch vim-browse patch :(( |
Ok looking at the patch again I think I mid've found the root of the bug, maybe this works, didn't test though and I'm currently unsure what the semantics were for clearing the region (meaning of var From d07e686a604eba95f8ef84f2efce946427771f67 Mon Sep 17 00:00:00 2001
From: Julius Huelsmann <juliusHuelsmann@gmail.com>
Date: Thu, 24 Dec 2020 00:34:38 +0100
Subject: [PATCH] feat: create column patch equivalent for unpatched st
Equivalent to history-column patch in https://github.com/juliusHuelsmann/st-history-vim only without ability to inspect if terminal size is smaller.
---
st.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/st.c b/st.c
index abbbe4b..11c768e 100644
--- a/st.c
+++ b/st.c
@@ -113,6 +113,7 @@ typedef struct {
typedef struct {
int row; /* nb row */
int col; /* nb col */
+ int maxCol;
Line *line; /* screen */
Line *alt; /* alternate screen */
int *dirty; /* dirtyness of lines */
@@ -1236,6 +1237,7 @@ tclearregion(int x1, int y1, int x2, int y2)
LIMIT(x2, 0, term.col-1);
LIMIT(y1, 0, term.row-1);
LIMIT(y2, 0, term.row-1);
+ if (!(term.mode &= MODE_ALTSCREEN) && x2 == term.col - 1) { x2 = term.maxCol -1; }
for (y = y1; y <= y2; y++) {
term.dirty[y] = 1;
@@ -2472,9 +2474,10 @@ twrite(const char *buf, int buflen, int show_ctrl)
void
tresize(int col, int row)
{
- int i;
+ int i;
+ int pmc = term.maxCol;
int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col);
+ term.maxCol = MAX(col, pmc);
int *bp;
TCursor c;
@@ -2511,14 +2514,14 @@ tresize(int col, int row)
/* resize each row to new width, zero-pad if needed */
for (i = 0; i < minrow; i++) {
- term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph));
- term.alt[i] = xrealloc(term.alt[i], col * sizeof(Glyph));
+ term.line[i] = xrealloc(term.line[i], term.maxCol * sizeof(Glyph));
+ term.alt[i] = xrealloc(term.alt[i], term.maxCol * sizeof(Glyph));
}
/* allocate any new rows */
for (/* i = minrow */; i < row; i++) {
- term.line[i] = xmalloc(col * sizeof(Glyph));
- term.alt[i] = xmalloc(col * sizeof(Glyph));
+ term.line[i] = xmalloc(term.maxCol * sizeof(Glyph));
+ term.alt[i] = xmalloc(term.maxCol * sizeof(Glyph));
}
if (col > term.col) {
bp = term.tabs + term.col;
@@ -2540,7 +2543,7 @@ tresize(int col, int row)
c = term.c;
for (i = 0; i < 2; i++) {
if (mincol < col && 0 < minrow) {
- tclearregion(mincol, 0, col - 1, minrow - 1);
+ tclearregion(pmc, 0, col - 1, minrow - 1);
}
if (0 < col && minrow < row) {
tclearregion(0, minrow, col - 1, row - 1);
--
2.29.2
|
This patch doesnt depend on other patches right? |
No sorry, the vim-browse patch is not compatible with the |
Right, this shouldn't depend on other patches, however I created it on an old revision of st, there might therefore be some merge conflicts |
Hi! Hope this helps:
The column-patch is not compatible with scrollback. |
@juliusHuelsmann this works but all glyphs like icons look very weird and st force exits itself frequently |
ok sorry then there is still something wrong with that patch, I'll notify you in this issue when there is an update! |
I patched it now , it works but
If you want to test this build git clone https://github.com/siduck76/st --branch test |
cool :) that looks good I'll have a look at the segfault that when I find the time :) And I'll keep the issue open for those who are interested! I think the segfault might be because some areas are uninitialized and interpreted incorrectly, but thats just a hunch |
I didnt find the column_patch in the releases or your st repo
The text was updated successfully, but these errors were encountered: