biscuit icon indicating copy to clipboard operation
biscuit copied to clipboard

Implement the history navigation buttons

Open tomlin7 opened this issue 1 year ago • 19 comments

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 avatar Oct 07 '24 20:10 tomlin7

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

abhishek-singh0710 avatar Oct 09 '24 02:10 abhishek-singh0710

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

tomlin7 avatar Oct 09 '24 06:10 tomlin7

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

abhishek-singh0710 avatar Oct 09 '24 14:10 abhishek-singh0710

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

abhishek-singh0710 avatar Oct 10 '24 09:10 abhishek-singh0710

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

tomlin7 avatar Oct 10 '24 11:10 tomlin7

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

abhishek-singh0710 avatar Oct 10 '24 12:10 abhishek-singh0710

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

abhishek-singh0710 avatar Oct 10 '24 12:10 abhishek-singh0710

@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 https://github.com/andfoy/pywinpty/issues/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.

tomlin7 avatar Oct 10 '24 13:10 tomlin7

pywinpty hasn't provide the wheels yet

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

shirsakm avatar Oct 10 '24 14:10 shirsakm

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

tomlin7 avatar Oct 17 '24 17:10 tomlin7

@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 :)

tomlin7 avatar Nov 02 '24 06:11 tomlin7

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

vyshnav-vinod avatar Dec 11 '24 05:12 vyshnav-vinod

@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.

tomlin7 avatar Dec 11 '24 05:12 tomlin7

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)??

vyshnav-vinod avatar Dec 11 '24 16:12 vyshnav-vinod

@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.

tomlin7 avatar Dec 11 '24 17:12 tomlin7

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

vyshnav-vinod avatar Dec 11 '24 17:12 vyshnav-vinod

@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.

tomlin7 avatar Dec 11 '24 18:12 tomlin7

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 :).

vyshnav-vinod avatar Dec 15 '24 13:12 vyshnav-vinod

@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.

tomlin7 avatar Dec 16 '24 08:12 tomlin7