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

Wish: When syntax error happens, put cursor at the end of broken expression #32

Open
zvirja opened this issue Sep 30, 2021 · 1 comment
Labels
enhancement New feature or request PR Welcome! Contribute to this project

Comments

@zvirja
Copy link

zvirja commented Sep 30, 2021

Wish

First of all, thank you very much for the excellent tool you created! I used basics of it only, but already found it amazing.

One thing which immediately hit me, is that in case of error the cursor is put at the beginning of the error expression, not the end. For example if you type

bin something

the cursor is put at the beginning of something:

image

That feels "unexpected" to me. It's a bit unusual to use "delete" button to correct the error, not the "backspace" one. It's very difficult for me though to explain why exactly I feel the current behavior non-natural. Like I would naturally have an intent to look for an error left to the cursor, not right. And also I have intuition to fix error to the left, not to the right.
Could be because in IDE you would usually have the whole error selected with the cursor at the end - so that's where I got used to that.

I do not have strong arguments in favor of suggested behavior change and I did not test how it would feel if that would be different. But decided to drop an issue in case I'm not the only one or you yourself thought about it as well 😃

Idea

In case AST underneath allows to precisely track position, one of the ideas could be to have something like this:
https://twitter.com/firstdrafthell/status/1427936354214764548

Then repeat the prompt again with the cursor at the end. This way it's clear what the boundaries of the error are even in case when broken expression has multiple words.

@xoofx
Copy link
Owner

xoofx commented Oct 1, 2021

I would naturally have an intent to look for an error left to the cursor, not right. And also I have intuition to fix error to the left, not to the right.

yep, why not.

@xoofx xoofx added enhancement New feature or request PR Welcome! Contribute to this project labels Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR Welcome! Contribute to this project
Projects
None yet
Development

No branches or pull requests

2 participants