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

Switching buffers in the standard ctrl-tab way #443

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

onelivesleft
Copy link
Contributor

Allows the user to switch between recent buffers, which should be an orthogonal operation to the cursor history (current move_to_previous_buffer/move_to_next_buffer use the cursor history). This organises the buffers in order of recent access, per pane (i.e left / right editor). While choosing a buffer, the filenames are drawn as tabs in the status bar.

Normally editors would bind this to ctrl-tab/ctrl-shift-tab; I've left the defaults for it as ctrl-pagedown/pageup for consistency with the current keymap, but would recommend rearranging these (and moving the current switch_between_open_files dialog to something else). In this PR the ctrl key is hard-coded: once the user starts flipping through open buffers, we stay in this mode until the user releases ctrl.

Also added close_current_buffer (default Alt-w)

Other changes in this PR:

  • Switched most_recent_buffers to our Array type.
  • Renamed Tween_Animation.speed to Tween_Animation.duration
  • draw_file_info now takes a flags parameter which governs which things to draw

@onelivesleft
Copy link
Contributor Author

This is usable as is, but needs a bit of polish on close_current_buffer when the buffer is modified, which I'm working on now

@onelivesleft
Copy link
Contributor Author

close_current_buffer polishing done.

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.

1 participant