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

Implement the history navigation buttons #396

Open
tomlin7 opened this issue Oct 7, 2024 · 19 comments
Open

Implement the history navigation buttons #396

tomlin7 opened this issue Oct 7, 2024 · 19 comments
Labels
enhancement New feature or request help wanted Extra attention is needed text editor Related to text editor's features

Comments

@tomlin7
Copy link
Owner

tomlin7 commented Oct 7, 2024

Feature

The history navigations are placed next to breadcrumbs

image

These shall navigate user's cursor positions

Notes

  • Implementation of history navigation buttons: src/biscuit/editor/breadcrumbs/history_navigation
  • Store the history for each editor within the TextEditor or TextEditor.text instance itself: src/biscuit/editor/text
  • active editor instance is accessible within the history navigation class as self.base.editorsmanager.active_editor. Note that the active_editor.content will be the TextEditor instance and active_editor.content.text will be the Text widget instance.
@tomlin7 tomlin7 added the enhancement New feature or request label Oct 7, 2024
@tomlin7 tomlin7 self-assigned this Oct 7, 2024
@tomlin7 tomlin7 added text editor Related to text editor's features help wanted Extra attention is needed labels Oct 7, 2024
@abhishek-singh0710
Copy link

Hi, I would like to work on this issue.
Could this be assigned to me?
Thanks.

@tomlin7
Copy link
Owner Author

tomlin7 commented Oct 9, 2024

Hi, welcome to the community!
I hope you have used the cursor history navigation in Visual Studio Code, this issue is about achieving the same functionality.
Please let me know in case you need further clarification.

image

@abhishek-singh0710
Copy link

Thanks, I'll try my best to implement this.

@abhishek-singh0710
Copy link

Hi,
I am not sure if this is due to some error on my side but I cannot set up this project on my local machine.
At first it was due to a version of python so I used the command poetry env use python313 to use python 3.13.0
Now when I move to the src and do poetry install it gives the following error-
Screenshot 2024-10-10 151524
Please help me with this

@tomlin7
Copy link
Owner Author

tomlin7 commented Oct 10, 2024

@abhishek-singh0710 thanks for pointing this out, lock file needed updates for new python version. Now the error has been resolved in #407

@abhishek-singh0710
Copy link

I'm sorry if this is trivial but I am still facing issues for pywinpty
Screenshot 2024-10-10 175643

@abhishek-singh0710
Copy link

I've installed Rust and have put cargo in my path variables also

@tomlin7
Copy link
Owner Author

tomlin7 commented Oct 10, 2024

@abhishek-singh0710 this seems to be a common issue as it's listed in many times in the web. I was able to reproduce this issue with python 3.13, but this wasn't causing trouble in 3.12.x.

Since 3.13 is very new, pywinpty hasn't provide the wheels yet. See andfoy/pywinpty#451
I suggest you roll back python to 3.12.x for now, as many libs have not updated yet.

I'm marking this project as unsupported for 3.13 until pywinpty issue gets resolved.

@shirsakm
Copy link
Contributor

pywinpty hasn't provide the wheels yet

Just a heads up, this is the case for google-generativeai as well.

@tomlin7
Copy link
Owner Author

tomlin7 commented Oct 17, 2024

@abhishek-singh0710 issue has been resolved. pywinpty now supports python 3.13.

@tomlin7
Copy link
Owner Author

tomlin7 commented Nov 2, 2024

@abhishek-singh0710 Hello there, as the issue is still assigned to you, I would like to know if you are still working on this. Please open a pr if you have worked on this otherwise I can unassign the issue :)

@vyshnav-vinod
Copy link
Contributor

is this still open? i would love to give it a try

@tomlin7
Copy link
Owner Author

tomlin7 commented Dec 11, 2024

@vyshnav-vinod Yes this is, I guess the assignee doesn't want to continue working on this anymore as they didn't respond to any of the comments. You can give it a try.

@vyshnav-vinod
Copy link
Contributor

is this supposed to be the current editor instance only(so different history for each editor tab) or does it include maintaining a single history across the editor tabs (like in vs code)??

@tomlin7
Copy link
Owner Author

tomlin7 commented Dec 11, 2024

@vyshnav-vinod I think it would make sense to keep a single history across all the tabs, that would make it more usable. But also you may keep a max size to that history. Just clean up old chunks when it's full.

@vyshnav-vinod
Copy link
Contributor

Just a heads up, theres two navigation buttons in the editor rn
image
Is it redundant or ?

@tomlin7
Copy link
Owner Author

tomlin7 commented Dec 11, 2024

@vyshnav-vinod the idea were to have those lookalike buttons for two purposes:

  1. tab shifting
  2. history navigation

Although the former doesn't have a big use case, when you have many tabs open, it's just impossible to access them.
Maybe implementing the ctrl+tab bindings will solve that for now.

You can use the right one to handle history navigation.

@vyshnav-vinod
Copy link
Contributor

vyshnav-vinod commented Dec 15, 2024

Hey so i tried to start this, how would you like to record the cursor postions.. i havent really used vscodes cursor navigation and thought to try it today, it seems they are only recording the first cursor position in a file or something? How would you like to record it? I was thinking of just recording the cursor positions when the user does a huge jump (like either tab switches or after n number of code lines from previous position?). Please let me know if i make no sense :).

@tomlin7
Copy link
Owner Author

tomlin7 commented Dec 16, 2024

@vyshnav-vinod I guess we can just directly store the cursor positions changes on mouse clicks and maybe tab switches for now, no need to check for any n number of lines. Key presses combined with a check for code lines sounds a bit overhead for tkinter, especially since those already require optimizations due to completions and syntax highlight updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed text editor Related to text editor's features
Projects
None yet
Development

No branches or pull requests

4 participants