Skip to content

Fix vi_to_column which was broken - #679

Merged
ima1zumi merged 1 commit into
ruby:masterfrom
tompng:fix_vi_to_column
Apr 15, 2024
Merged

ima1zumi merged 1 commit into
ruby:masterfrom
tompng:fix_vi_to_column

Conversation

@tompng

@tompng tompng commented Apr 14, 2024

Copy link
Copy Markdown
Member
def current_row
  wrapped_lines.flatten[wrapped_cursor_y]
end

wrapped_cursor_y does not exist, and raises NoMethodError.

Old implementation of vi_to_column is counting width. vi does it, Readline's vi-mode does not. It only counts string size.

I Removed the condition (total.last + mbchar_width) >= current_row_width because it is not needed in both vi and Readline's behavior.

@ima1zumi ima1zumi added the bug Something isn't working label Apr 15, 2024

@ima1zumi ima1zumi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@ima1zumi
ima1zumi merged commit 9e93ad5 into ruby:master Apr 15, 2024
@tompng
tompng deleted the fix_vi_to_column branch April 15, 2024 13:31
tenderlove added a commit to tenderlove/ruby that referenced this pull request Apr 15, 2024
* master: (29 commits)
  Not all `nm`s support the `--help` option
  Emit a performance warning when redefining specially optimized methods
  YJIT: A64: Avoid intermediate register in `opt_and` and friends (ruby#10509)
  [ruby/reline] Remove not implemented method (ruby/reline#680)
  [ruby/reline] Fix vi_to_column which was broken (ruby/reline#679)
  Include more debug information in test_uplus_minus
  [Universal parser] DeVALUE of p->debug_lines and ast->body.script_lines
  Add more assertions in `test_uplus_minus`
  `super{}` doesn't use block
  fix incorrect warning.
  Update default gems list at fc36394 [ci skip]
  [ruby/optparse] bump up to 0.5.0
  show warning for unused block
  Emit `warn` event for duplicated hash keys on ripper
  [ruby/reline] Refactored Default Key Bindings (ruby/reline#678)
  [ruby/reline] Refactor waiting_proc and waiting_operator_proc (ruby/reline#649)
  [pty] Fix missing `or`
  [pty] Fix `ptsname_r` fallback
  [ruby/irb] Allow defining custom commands in IRB (ruby/irb#886)
  [ruby/reline] Support `menu-complete-backward` command for upward navigation (ruby/reline#677)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants