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

Don't cycle tab position by default anymore (and a few other cleanups) #3

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

FichteFoll
Copy link
Member

@FichteFoll FichteFoll commented Mar 10, 2024

Closes #2.

I'm breaking compatibility with older ST builds here because I believe they are not worth maintaining, so I created a PC PR for this: wbond/package_control_channel#8886
Tags are already pushed.

I chose to make behavior configurable via a command parameter because a setting would have been overkill and because you may want to have both modes simultaneously.

@deathaxe
Copy link
Member

I've forked this repo to https://github.com/deathaxe/MoveView years ago to

  1. add ListInputHandler for targets
  2. create commands which align better with ST's built-in commands.

I never liked those string arguments here. Mixing them up with integers doesn't improve it.

@deathaxe
Copy link
Member

If compatibility is not an issue and separate commands as in MoveView are not desired, the API should IMHO at least look a bit more ST like by

Move tab relative

{ "command": "move_tab", "args": {"by": -1, "cycle": false} }

Move tab to absolute position counting from first tab onwards

{ "command": "move_tab", "args": {"to": 5} }

Move tab to absolute position counting from last tab backwards

{ "command": "move_tab", "args": {"to": -5} }

@FichteFoll
Copy link
Member Author

If compatibility is not an issue

That is indeed the biggest question here. So far, aside from the cycling behavior, my changes are backwards compatible, but I agree that we can use this opportunity to make more changes

I suspect that most users just use the default key bindings and haven't added their own. Even then, I could provide a backwards compatibility argument which would ensure everything works exactly as before when the old position argument is used.

I'll think about it for a bit.

@gioisco
Copy link

gioisco commented Mar 10, 2024

I attempted to utilize this branch and encountered the following error:

reloading python 3.3 plugin move_tab
Traceback (most recent call last):
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 308, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 853, in _load_module
  File "<frozen importlib._bootstrap>", line 980, in get_code
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/home/giovanni/.config/sublime-text/Packages/move_tab.py", line 22
    if not (view := self.window.active_view()):
                 ^
SyntaxError: invalid syntax

I am uncertain why my Sublime Text editor - Build 4169, appears to be using Python 3.3. I'm on Pop!_OS 22.04 LTS. Any insights or suggestions on resolving this issue would be greatly appreciated.

@deathaxe
Copy link
Member

It's controlled by .python-version file in root of the package.

That said, assignment expressions are of little value here.

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 this pull request may close these issues.

[Request] Behaviour compatibility with Chrome, Firefox, VSCode...
3 participants