Skip to content
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

Colors dissapear and text is messed up on kakoune master #27

Open
CharlesGueunet opened this issue May 11, 2020 · 12 comments · May be fixed by #31
Open

Colors dissapear and text is messed up on kakoune master #27

CharlesGueunet opened this issue May 11, 2020 · 12 comments · May be fixed by #31

Comments

@CharlesGueunet
Copy link
Contributor

kak

Using this plugin in Kakoune master works but the preview is a bit messed up (see the right part of the picture)

  • Color of anchors are not displayed anymore,
  • Here I used the word version and some lines are now merged.
@danr
Copy link
Owner

danr commented May 11, 2020

Interesting, do you know which changes to kakoune are causing this?

@CharlesGueunet
Copy link
Contributor Author

I have bissected and it seems this change was introduced in commit 954373d3cfa9d168f7949f12cb7b2e730d18de99

This commit is not really documented. It is named Support multi-line replace-ranges

@danr
Copy link
Owner

danr commented May 13, 2020

Thanks for bisecting! Maybe the easymotion code is doing something sloppy around line endings that now get catched with this new commit.

@danr
Copy link
Owner

danr commented Jul 23, 2020

Maybe related: #29

@Anomalocaridid
Copy link

I am also experiencing this.

@lf94
Copy link

lf94 commented Sep 28, 2020

I am putting a $25 Bitcoin bounty on this (enough for a pizza basically).

It should also resolve #29 .

@ghost
Copy link

ghost commented Oct 15, 2020

Looked into this, only the red foreground is missing, if you change EasyMotionForeground to set a background it will still show. This includes formatting such as underlines or italics. This doesn't solve it but can be used to increase contrast.

I've also messed around with the new replace-ranges and the reason that lines are missing is that the return character is replaced on the above line. This most likely has to do with the added functionality to allow someone to implement code folding. I think fixing this on the plugin side is honestly impractical.

@lf94
Copy link

lf94 commented Oct 21, 2020

If the task is more difficult or time consuming than expected I will raise the bounty in increments of $25 USD.

@JJK96
Copy link

JJK96 commented Oct 21, 2020

I made a minimal reproducer.

Have the following buffer (27 times "a\n") and execute easy-motion-w

a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a

You'll see that the last two lines are joined

@JJK96
Copy link

JJK96 commented Oct 21, 2020

My proposed solution after some investigation would be to also get the selection contents to the python script.
Then the script can check if there is a newline in the contents. If there is a newline, replace only the characters until the newline, otherwise replace everything.

Getting the selections to the python script is not trivial, since currently all the variables are sent to the python script in one string, delimited by ^, since selections can also contain ^ characters (or any other proposed delimiter for that matter), we cannot do it in this way.

@lf94
Copy link

lf94 commented Oct 29, 2020

I'm revoking the bounty; it seems there are some deep issues with the plugin, and after learning some kakoune script myself, I'm not sure I see a proficient way to achieve this functionality. (Also, no one has declared to be working on it.)

@kulynyak
Copy link

kulynyak commented Nov 22, 2020

I'm using workaround (order is important):

colorscheme default # your colorscheme
set-face global EasyMotionForeground rgb:fdf6e3,rgb:268bd2+fg

tomKPZ added a commit to tomKPZ/kakoune-easymotion that referenced this issue Feb 28, 2022
Fixes danr#27

The strategy is to select the newlines in addition to the targets
so that we can keep track of line lengths. Then if a range would
have replaced a newline, the replaced string is clamped to the last
character of the line.
@tomKPZ tomKPZ linked a pull request Feb 28, 2022 that will close this issue
tomKPZ added a commit to tomKPZ/kakoune-easymotion that referenced this issue Feb 28, 2022
Fixes danr#27

The strategy is to select the newlines in addition to the targets
so that we can keep track of line lengths. Then if a range would
have replaced a newline, the replaced string is clamped to the last
character of the line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants