Skip to content

Slice fails sometimes if using tabs. #1586

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

Open
Emberstorm-John opened this issue Jul 6, 2023 · 4 comments
Open

Slice fails sometimes if using tabs. #1586

Emberstorm-John opened this issue Jul 6, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@Emberstorm-John
Copy link

Emberstorm-John commented Jul 6, 2023

Command used: Take made past play rangle take slice yellow cross rangle

Behaviour:
image

Expected Behaviour:
image

Example code:

progressionDebug += "\n<indent=15%>Maps visited: "					+ "<indent=75%>" + mapsVisited					+ "</indent>";
		progressionDebug += "\n<indent=15%>Places visited total: "			+ "<indent=75%>" + poisVisitedTotal				+ "</indent>";
		progressionDebug += "\n<indent=15%>Misteries solved total: "		+ "<indent=75%>" + poisSolvedTotal				+ "</indent>";

		progressionDebug += "\n";
		progressionDebug += "\n<indent=15%>Villagers helped: "				+ "<indent=75%>" + customersSolved				+ "</indent>";
		progressionDebug += "\n<indent=15%>Trades made: "					+ "<indent=75%>" + tradesMade					+ "</indent>";

		progressionDebug += "\n<indent=15%>Deco built total: "				+ "<indent=75%>" + bbsPlacedTotal				+ "</indent>";
		progressionDebug += "\n<indent=15%>Deco removed: "					+ "<indent=75%>" + bbsRemoved					+ "</indent>";
@pokey
Copy link
Member

pokey commented Jul 6, 2023

This is almost certainly due to the fact that we're counting characters, rather than using display characters. Not sure if there's a way to use the latter, but that would solve this issue. wdyt @AndreasArvidsson?

@AndreasArvidsson
Copy link
Member

I agree, but there is no way to do that to my knowledge.

@pokey
Copy link
Member

pokey commented Jul 7, 2023

I think it's probably doable. I believe there is a setting which will tell us the tab width, and then we can try to reproduce VSCode's tab display logic. It feels a bit dicey tho tbh, and things get even more confusing with grapheme clusters (see #1264), which are multiple javascript characters but show as a single display char. VSCode's logic for determining display columns is gnarly, so I'd be a bit nervous to try to reproduce it. We could try to handle the simple tab case, then leverage #1264 once we have that to make it even fancier. Prob not too bad

@Emberstorm-John you mentioned on slack you usually do this sort of thing by mouse and keyboard. Curious how you do that

@pokey pokey added the bug Something isn't working label Jul 7, 2023
@Emberstorm-John
Copy link
Author

You can click top left corner of the rectangle and then click the bottom right with shift+alt+click. That is how I got the expected results screenshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants