juliusHuelsmann / st-history-vim

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

Feature: Restore vanilla feature of selecting text with shift-double|tripple-click #11

Closed 0xACE closed 3 years ago

0xACE commented 4 years ago

This patch removes the default behavior of selecting text of:

  1. shift+double click - select word (based on worddelimiter)
  2. shift+triple click - select line

I would fix it myself but this patch is overwriting a lot of the same code as upstream.

Any comments?

0xACE commented 4 years ago

Posting here because I think it's somewhat related.

Selecting text with the mouse (shift+ drag left mouse button) in a tmux window and then switching to another window within tmux makes the selection highlight remain from the previous window tmux was in.

Wouldn't it be better to keep the logic of this vim-patch seperated from st?

juliusHuelsmann commented 4 years ago

Hi! You're right, that functionality is removed in the selection patch patch_sel; the selection does not snap to the word that was defined. The task of the selection patch is to allow for selections spanning more than the current screen size and I did not port the selection-snap code. If you want to use this patch as-is, you might want to try out the vim patch without the selection patch pre-applied.

As for the TMUX window: I think this is due to the missing selclear in tclearregion in the selection patch.

If you're using tmux during your entire terminal sessions, you don't benefit from the history feature of this patch, as TMUX is an ALT-screen application and manages the history on its own (which cannot be searched by the vim patch). Maybe the keyboard select patch is a better solution for you, as it allows for some vim-like selection & search motions without shipping a history patch.

I'm currently busy but I can have a look at this bug some time in the future!

aldevv commented 3 years ago

is there any progress with this?

0xACE commented 3 years ago

@Akuseru1 no idea, but i encountered other issues with this branch/patch set so I stuck with the st pipe solutions and haven't looked back since...

aldevv commented 3 years ago

What solution is that?

0xACE commented 3 years ago

Basically https://st.suckless.org/patches/externalpipe/ along with the scrollback patch...

juliusHuelsmann commented 3 years ago

is there any progress with this?

No, sorry I didn't have a look at this issue yet. I didn't use the mouse tripple click feature before writing this patch (I'm not even entirely sure if it existed in the version in which I started my work on this patch, I ported my code since) and I needed to completely rewrite the selection functions in order to also operate on data that is not currently visible on screen, therefore I most likely dropped the feature without noticing.

When I work on other issues I want to solve on this patch, I can have a look at this, even though I cannot say for certain when this will be the case.

0xACE commented 3 years ago

I recall checking out the problem. it wasn't hard to fix but this repo had completely rewritten the functions that where relevant to this issue. Rather than making them work together I just stopped using this repo... I opted to manage my own branches as I did before this, vim in st seemed nice, but this repo had too many issues for my taste...

juliusHuelsmann commented 3 years ago

Integrated into the current version (though through existing functionality of the vim patch).