Skip to content

VIM Visual Mode#80

Open
Enoumy wants to merge 14 commits into
darylhjd:mainfrom
Enoumy:visual-mode
Open

VIM Visual Mode#80
Enoumy wants to merge 14 commits into
darylhjd:mainfrom
Enoumy:visual-mode

Conversation

@Enoumy

@Enoumy Enoumy commented May 26, 2023

Copy link
Copy Markdown
Contributor

Addresses #79

Pressing Shift+V or v in the manga page will toggle something similar to vim's visual mode. (It's not fully 1:1 with vim's visual mode as you can't select things horizontally).

This lets you select a range of manga easily + it has the side effect of letting you select all manga chapters with ggvG.

Testing

Manual testing by runnging go build and then ./mangadesk.

@Enoumy

Enoumy commented May 26, 2023

Copy link
Copy Markdown
Contributor Author

Oh whoops, sorry, I'm a bit of a github newbie too. I think this diff also includes the commits from the guest mode pr. Is this fine and just gets resolved whenever the other pr is merged? Still sad that the diff from the guest feature shows up in your review though. Will be moving this pr to a draft in the meantime.

@Enoumy Enoumy marked this pull request as draft May 26, 2023 01:07
@darylhjd

darylhjd commented Jul 4, 2023

Copy link
Copy Markdown
Owner

You will likely need to rebase once I merge your other PR to the main branch.

@Enoumy Enoumy marked this pull request as ready for review July 29, 2023 16:53
@darylhjd

Copy link
Copy Markdown
Owner

Sorry for the inaction regarding this PR, have been busy.

Seems like this branch is currently not rebased on main. I will do that and review it soon.

Thanks!

@darylhjd

Copy link
Copy Markdown
Owner

Please add new keybindings to the README.

@darylhjd darylhjd linked an issue Jan 27, 2024 that may be closed by this pull request
Comment thread app/ui/page_inputs.go Outdated
Enoumy and others added 3 commits January 30, 2024 20:10
Applying suggested change.

Co-authored-by: Har Jing Daryl <53652695+darylhjd@users.noreply.github.com>
@Enoumy

Enoumy commented Jan 31, 2024

Copy link
Copy Markdown
Contributor Author

Sorry for the inaction regarding this PR, have been busy.

No worries! Thanks for reviewing! Thanks for rebasing too!

Please add new keybindings to the README.

Added! Lmk if reasonable wording!

I've also included your changes and re-manually tested by building + running and testing that selecting in visual mode still works manually.

Thanks!

@darylhjd

darylhjd commented Mar 5, 2024

Copy link
Copy Markdown
Owner

im not too familiar with visual mode on VIM, so i am not sure what it does and how the behaviour translates to mangadesk.

i guess it works something like text selection, just that it works with rows here. do correct me if im wrong.

from my testing, it works well, but there are a few quirks:

  1. Starting visual mode (pressing 'v' once) provides no indication that the mode is active, since the current row isn't highlighted green immediately. only after moving up or down once is there an indication.
    • Ideally, the indication that the mode is active should be shown (i.e. current row where mode was activated is highlighted).
  2. If there are currently selected chapters (e.g. from ctrlE toggling), entering visual mode deselects all of them.
    • I am okay with this behaviour as we can treat it as previously highlighting something, and then now changing to highlighting something else. But the behaviour of this could be documented in the README, perhaps as a small note in the keybindings table. I can foresee that this behaviour might be unexpected to some users.

Comment thread app/ui/page_inputs.go
return event
})

p.Table.SetSelectionChangedFunc(func(row, _column int) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment on what this binding does would be useful. See line 182 of same file for example.

Comment thread app/ui/page_inputs.go
p.markAll()
}

func (p *MangaPage) selectRange(from, to int) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment for this function and the one below would also be great.

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.

[Feature Request] VIM Visual Mode for Selecting Manga

2 participants