Code Monkey home page Code Monkey logo

autoscrolldown's Introduction

autoscrolldown README

This Visual Studio Code extension automatically scrolls externally modified files to the end. By default, Code just reloads these files; with autoscrolldown they also scroll to the last line if certain conditions are met.

Features

Simply enable the autoscrolldown settings in the config or run the command.

An example of how the command performs:

autoscroll example

You'll know the feature is active when you see the "arrow-down" indicator in the status bar:

autoscroll indicator

Depending on the onlyWhenAtEnd setting, sometimes it's necessary to be at the very end of the buffer for the indicator to appear and the extension to do its job.

Requirements

Visual Studio Code newer than 1.58.0.

Extension Settings

This extension contributes the following settings:

  • autoscrolldown.allFiles: all files scroll automatically to the end when modified externally
  • autoscrolldown.onlyWhenAtEnd: scrolling happens only if the cursor was already in the last position within the file
  • autoscrolldown.alsoAutoscrollActive: if Code has focus and the current buffer meets the requirements to be autoscrolled, scroll it. This setting might lead to confusion while editing a file, as it might move things around.

There is also one command available, useful when autoscrolldown.allFiles is turned off:

  • autoscrolldown: Toggle autoscroll To End For Current File

Known Issues

None yet.

autoscrolldown's People

Contributors

foxx1337 avatar ipcjs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ipcjs

autoscrolldown's Issues

Simplify _scrollActiveEditorToEnd()

private _scrollActiveEditorToEnd() {
        const editor = vscode.window.activeTextEditor;
        const lineCount = editor.document.lineCount;
        const range = editor.document.lineAt(lineCount - 1).range;
        editor.selection = new vscode.Selection(range.end, range.end);
        editor.revealRange(range);
    }

Perhaps you could simplify the actual scroll with the complex command

editorScroll - Scroll editor in the given direction

Editor scroll argument object
Property-value pairs that can be passed through this argument:
'to': A mandatory direction value.
'up', 'down'
'by': Unit to move. Default is computed based on 'to' value.
'line', 'wrappedLine', 'page', 'halfPage'
'value': Number of units to move. Default is '1'.
'revealCursor': If 'true' reveals the cursor if it is outside view port.

since you have the lineNumber/lineCount

From https://code.visualstudio.com/docs/extensionAPI/vscode-api-commands

FileType: AutoEnable (*.log)

May it possible to enable the "autoscrolldown" on *.log files?
It would be fine, if the autoscroll does work on inactive Tabs, too.

Autoscrolldown for VSCodium

Please provide autoscrolldown for VSCodium. When I search for this extension in VSCodium, it says: No extension found.

In addition I would like to ask you to publish your extension in Open VSX Registry. Thanks in advance.

Not working, if the (Visual Studio Code) window is not selected/focused

PROBLEM

The autoscroll feature is NOT working if the (Visual Studio Code) window is not selected/focused on a local opened file in Windows11 (latest release 2024.01.04).

Even if the file to watch/observe in VSC was trusted (not opened in Restricted Mode) and the directory of the file was added to "Trusted Folders & Workspaces.

But exactly such a behavior is crucial/needed when looking at *.log files.

SOLUTION/WORKAROUND

  • Open same file in Notepad++
  • Click in menu on symbol "Watch (tail -f)"
  • RESULT: Working in Notepad++ perfectly!

PROPOSAL

Can you please implement it the same way as in Notepad++?

Settings not exposed in settings UI

  • Enable the extension
  • In command palatte, go to settings ui
  • search for autoscrolldown
  • zero results shown

Going there via Extension -> Show extension settings which autofills extension ID also shows the same zero settings.

Only works when Visual Studio Code 1.25 is unfocused

Auto scrolling only seems to be working on VSCode 1.25 Linux when the entire visual studio code window is unfocused, despite the indicator in the status bar. At first I thought the extension wasn't working.

It might make sense if it was the editor that had to be unfocused, but it seems to be the entire visual studio code window.

{
    "autoscrolldown.allFiles": true,
    "autoscrolldown.onlyWhenAtEnd": true
}

Thanks for the terminal style one line scrolling, much nicer than the other similar extension.

1.2 version scrolls down when changing tabs and editing internally

Reproduce Steps:

  1. have 2 documents open in 2 tabs in 1 editor
  2. click the inactive tab
  3. edit the document in any way in the editor
  4. edit takes effect and immiediately autoscrolldown triggers and puts the cursor at the bottom of the document.
    This happens once after every tab switch.

image

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.