Skip to content

Multiline comments support #185

Description

@msk4862

hey @otakustay, First of all Thanks for going ahead and making the changes also, really appreciate it.
and sorry, for being inactive for a while I got busy in some other things.

I checked your implementation and selecting lines with shift key does look good but I wanted to know If we can have something more similar to what Github has which is selecting lines by clicking and dragging the mouse?
Let me know your thoughts on this and meanwhile I'm also going through the codebase to check the possibilities.

Originally posted by @msk4862 in #180 (comment)

Activity

  1. stale commented on Feb 2, 2023

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  2. otakustay commented on Feb 10, 2023

    @otakustay
    Owner

    Dragging over cells is much more complicated since we can't afford the performance dropdown using dnd components, so I'm going to see whether I can expose some data on DOM elements like data-change-key, so a native DOM event can also get enough context to build a dragged selection

  3. otakustay commented on Nov 13, 2023

    @otakustay
    Owner

    In 3.2.0 we add data-change-key to gutter and code <td> elements so that we can point to the change object from DOM

  4. nlbaobao commented on Mar 27, 2024

    @nlbaobao

    这个问题好像没有最终的结果,我也实现了一个相关的但是,这个mouseenter有点不尽人意。

  5. nlbaobao commented on Mar 27, 2024

    @nlbaobao

    image
    移动过快的时候选中行并不能选中

  6. otakustay commented on Mar 27, 2024

    @otakustay
    Owner

    嗯,一般用enter再计算start到现在这行中间行全给选上,而不是只看当前这个……然后up的时候再做一次同样的事才能判断

  7. nlbaobao commented on Mar 27, 2024

    @nlbaobao

    我感觉做不到github那么流畅,data-change-key 这个api会对多行有帮助吗?

  8. nlbaobao commented on Mar 27, 2024

    @nlbaobao

    嗯,一般用enter再计算start到现在这行中间行全给选上,而不是只看当前这个……然后up的时候再做一次同样的事才能判断

    这样的话会失去那个选中时的动态效果,选中是选中了。我觉得enter并不是一个好方案,但是目前的api看来得花只有这个事件支持了。

  9. nlbaobao commented on Mar 27, 2024

    @nlbaobao

    image
    这哥们做的好流畅。我采用的也是enter和up方案,但是我什么动效都不加,仅仅只是渲染selectChanges,都达不到连续选中。

  10. nlbaobao commented on Mar 27, 2024

    @nlbaobao
  11. nlbaobao commented on Mar 27, 2024

    @nlbaobao

    gif 显示不出来
    这个是我做的感觉差强人意,滑的快了就不行

  12. nlbaobao commented on Mar 27, 2024

    @nlbaobao

    嗯,一般用enter再计算start到现在这行中间行全给选上,而不是只看当前这个……然后up的时候再做一次同样的事才能判断

    你还在吗?

  13. otakustay commented on Mar 27, 2024

    @otakustay
    Owner

    这样的话会失去那个选中时的动态效果,选中是选中了。我觉得enter并不是一个好方案,但是目前的api看来得花只有这个事件支持了。

    主要是我现在实在没时间去实现这个功能,按理是比如mousedown在第1行,然后快速划到了第10行,这个时候取第1行、第10行的key,从hunks里去找,把1-10行之间所有的change全部取出来,把它们加到selection里去

  14. nlbaobao commented on Mar 27, 2024

    @nlbaobao

    selection

    selection 是selectedChanges吗?

  15. nlbaobao commented on Mar 27, 2024

    @nlbaobao

    按照上述思路,我已经是实现了这个功能了。等我闲了改天提个pr。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions