Coder Social home page Coder Social logo

dqisme / vscode-sync-scroll Goto Github PK

View Code? Open in Web Editor NEW
34.0 2.0 7.0 23.32 MB

A Visual Studio Code Extension that make split panels scroll synchronically.

Home Page: https://marketplace.visualstudio.com/items?itemName=dqisme.sync-scroll

License: MIT License

TypeScript 100.00%
split-panels sync-scroll visual-studio-code vscode-extension

vscode-sync-scroll's Introduction

Sync Scroll - Visual Studio Code extension

A Visual Studio Code extension that makes sync scrolling editing easier.

Features

This extension supports sync scrolling between split panels in different modes:

  • NORMAL: Sync scroll to the same line
  • OFFSET: Sync scroll with the same scrolling distance
  • OFF: Turn off sync scroll

You can change the mode of Sync Scroll in the status bar below when VSCode opens split panels.

NOTE: the default mode is OFF, plesae select your desired mode after you firstly install it and open split panels.

Sync scroll features

It can help you highlight the corresponding selections when you focus the cursor on the one side. Additionally, there are two commands help your cross editing in the right-click menu in the content window when you open the split panels.

  • Jump to Next Panel Corresponding Position for navigating around the panels and in the corresponding position. It's very convenient to quick focus on the other side.
  • Copy to All Corresponding Places for replacing all the text at corresponding positions from the selections. For example, it's for the case that you want to use the selected text on the left side also on the right side.

Right click menu on the content of split panels

Release Notes

1.3.1

Enhancement:

  • Simplified the on/off and mode interaction into one menu with three modes: NORMAL, OFFSET and OFF.
  • By default mode is OFF.

1.3.0

Add features:

  • Add command to jump to corresponding position in the next panel
  • Add command to copy selections to all corresponding positions.

Enhancement:

  • Fix the issue of the output panel which shouldn't be involved in the scrolling sync.

1.2.0

Add features:

  • Add corresponding line highlight feature.

Enhancement:

  • Fix back and forth scroll issue in diff(selecting file to compare)/scm(viewing file changes) case.

1.1.1

Enhancement:

  • Persist the toggle state and mode
  • Fix back and forth scroll issue in diff(selecting file to compare)/scm(viewing file changes) case.

1.1.0

Add features:

  • Now you can choose a sync mode when it turns on:
    • NORMAL - aligned by the top of the view range.
    • OFFSET - aligned by the scrolled lines offset.

Enhancement:

  • Get rid of the scrolling delay.
  • Fix the issue that cannot toggle on/off when not focus on any editor.

1.0.0

Initial release of Sync Scroll with features:

  • Can set all the split panels into scroll synchronized mode.

How to Contribute

This extension is created by VSCode Extension Template (TypeScript) by Yeoman.

Basically, you can work with this extension source code as a normal typescript project.

vscode-sync-scroll's People

Contributors

dependabot[bot] avatar dqisme avatar meteyldrm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vscode-sync-scroll's Issues

The verbose status bar

I think that the status bar of the extension is redurant.

1606202625530

As you can see it is placed over a sufficiently long space.

My suggestion is to reduce the status bar to a few characters. For example

  1. Sync Scroll NORMAL
  2. Sync Scroll OFFSET
  3. Sync Scroll OFF

Also if this can be view I think if the Sync Scroll NORMAL/OFFSET is activated then Sync Scroll should be enabled programmatically.

Please review the issue and let me know what you think and hat you prefered in a PR (if there is a need for it).

Icon redesign

I tried to remake the logo for this extension with my ultra-bad graphic design knowledge as a hobby.

It turned out like this:
logo

I think it can be a good icon redesign for the Visual Studio Marketplace icon.

not work with big file

i open a 200M file into two split view

and the sync scroll not work

but a 10M file is ok

Does not work with Jupyter Notebooks

Hi,
Thanks for the extension.
I am trying to use with jupyter notebooks, unfortunately, it does not work.
Is there anything that can be done?

error: Illegal value for `line`

error: Illegal value for line

this come up on lastest vscode update.
Vscode version:
Version: 1.78.0 (Universal)
Commit: 252e5463d60e63238250799aef7375787f68b4ee

err

Mantain scroll sync after off/on

It can be useful to sync scrolling without realign the row number.

Example:

  • Open file A and file B
  • Deactivate sync
  • Scroll A or B to pair the code you want to compare, but having different row number.
  • Activate sync

Actual:

  • When you scroll the files realign to the same row number

Desired:

  • When you scroll 5 line, each file scroll 5 lines indipendentily by the row position.

Maybe you can set three state:

  • OFF: don't sync
  • ON: sync scroll without row number pair
  • PAIR: sync scroll with row number pair

Sync only editor groups in the same window

Vscode now supports opening detachable windows.
I wanted to sync the scroll of just two side by side files in the detached window... but if I scroll in the main one (or any), all the editor views scroll in sync.

Would be great if this was limited to the same window, maybe by adding another mode (sync all might be desirable in some cases).

Feature Request: Proportional Scrolling

I would be interesting and useful if the scrolling sync was proportional to the number of lines of each file.

For example:
A file with 100 lines and other file with 50 lines in a split panel.

The behavior would be something like this:
If in the first file I scroll to the line 50, the other file should be on line 25. And so...


I don't know exactly how to code extensions in VSCode, but it would work something like this in this pseudocode:

linesFileA = getLines(fileA)
linesFileB = getLines(fileB)

percentLineA = currentLine(fileA) * 100 / linesFileA

syncLineB = linesFileB * percentLineA / 100

setPosition(fileB, syncLineB)

And the same the other way around.

I know that's not how VSCode extensions works, but I hope the idea is understandable ^^"

Sync scroll gets in the way of three-way merge

Type: Bug

  1. Enable three-way merge
  2. Create a merge conflict
  3. Try to scroll past the first conflict

Result: Sync scroll won't let me scroll further down than the first conflict.
Expected Result: I should be able to scroll freely within the file.

Extension version: 1.3.1
VS Code version: Code 1.74.0 (5235c6bb189b60b01b1f49062f4ffa42384f8c91, 2022-12-05T16:38:16.075Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No

Feature Request: Offset scrolling by fixed amount

The offset feature somewhat already performs this task, but it would be more convenient to use a command that enables offset scrolling with a pre-defined offset.

This is useful for expanding the usable area of the editor pane. I want to see my code scroll off of the bottom of the left pane, and onto the top of the right pane and visa versa.

Things editor features like code folding would need to be synchronized between panes in this mode.

The justification:
Code is largely a vertical format, but most people have horizontal screens. This means in a single-pane environment there is a ton of empty space on the screen on the left side.
I want to see more of my code on the screen at a time to have more context, but I still want a unified scroll.

How to turn it off

Hi everybody,

thanks for this wonderful tool. Sry if this is a naive question, but is it actually possible to switch "Synch Scroll" off, in case I want to work on completely independent scripts on different panes?

Many thanks in advance :)

Even when Sync Scroll is ON it does not work

I have installed Sync Scroll on the latest VS Code, but unfortunately, it's not working as it should.
My two pages won't scroll together no matter what I try.
I have restarted and reinstall the package.

image

Any idea to try?

Thank you very much!

Unable to switch to Offset mode

Hi!

Thanks for the awesome extension ๐Ÿ˜ƒ
I am having trouble turning the Offset mode on.
No matter what I do, it always stays in the Normal mode.
Trmi8dntBM

Horizontal scrolling supported?

Hi,

thanks for maintaining this very useful extension. Is there any support for splitting up/down and synchronizing the horizontal scroll? Vertical works fine for me, but I cannot figure out how to get horizontal.

Thanks!

Sync is consistently off by 4 lines

I've used this on many machines with no issues, but after a new install on a new machine, the sync is consistently off by 4 lines - if I start at line 1 on both left and right files, and scroll one line at a time with the mouse wheel (set to 1 line at a time), the left file doesn't start scrolling until line 6 on the right, at which point the left window is at line 2, and it consistently stays offset by 4.

Erratic behavior if "Cursor Surrounding Lines" > 0 and/or "Smooth Scrolling" is set

If the Editor pref "Cursor Surrounding Lines" is set to be greater than 0 (e.g., 6 lines) and/or if "Smooth Scrolling" is set, sync scrolling gets confused and results in erratic up and down scrolling or continued scrolling in one or both panes even after the user has stopped actively scrolling. I encountered a similar problem in a split editor HTML project I was working on; in my case it was a rounding issue in the math when working with the height of iframe/textarea elements and the scroll position. My solution was to round numbers to at most 1 or 2 decimal places.

Publish on Open VSX

Could you add the extension to Open VSX as well please?
It will make it easier for us that use other non-Microsoft builds of VSCode like VSCodium to install and update the extension.

Some links:

  • About Open VSX
  • Who's using it? source

    As an open alternative to the Visual Studio Marketplace, the Open VSX Registry offers free access to extensions that can be used with any technology or tool that supports them. These include many open source solutions like Eclipse Che and Eclipse Theia, as well as Salesforce Code Builder, Google Cloud Workstations, Gitpod, SAP Business Application Studio and other applications based on Eclipse projects.

  • How to publish

Feature Request: Sync 'File Compare' Views

When I am comparing two pairs of files in VS Code (for example, A vs. B in one pane and B vs. C in another pane) I would like for Sync Scroll to keep the two (or more) panes in sync with each other when scrolling either horizontally or vertically.

Is this feasible?
Do you require some update in VS Code itself to enable this feature?

Thank you for your consideration.
Please let me know how I can make it worth your time to implement this feature.

`syncScroll.toggle` vs `syncScroll.changeMode`

I just upgraded to today's version.

I had a shortcut for syncScroll.toggle which was very convenient.

Now I see I need to bind to syncScroll.changeMode instead. However that shows a dropdown with normal / offset / off.

Is there a way to bind to the old behaviour quickly - which I assume is "normal" mode?

Global user settings for initial status of extension

It would be nice, if there would be global User settings (Preferences > Settings), which define the initial status of the extension for every new window or file view. All three states should be possible: NORMAL, OFFSET, OFF.

Up to now it is permanently set to NORMAL for splitted views.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.