GithubHelp home page GithubHelp logo

trevorpogue / topspace Goto Github PK

View Code? Open in Web Editor NEW
75.0 3.0 1.0 205 KB

Recenter line 1 with scrollable upper margin/padding in Emacs

License: GNU General Public License v3.0

Emacs Lisp 100.00%
scrolling center convenience padding margin cursor elisp upper fringe distraction-free

topspace's People

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  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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

emacsmirror

topspace's Issues

topspace empty lines vs real new lines

Is there a way to visually distinguish the topspace lines from actual leading new lines in the file itself?

Activating indicate-empty-lines only shows the bottom empty lines in the fringe.

does not work for narrowed buffers

When a buffer is narrowed to a region that doesn't include the first line, then it is not possible to scroll the narrowed region down from the top of the buffer.

To Reproduce

  1. open a document
  2. highlight a region of the document not including the first line
  3. execute M-x narrow-to-region
  4. try to scroll down from the top -- not possible.

Emacs version

GNU Emacs 28.2 (build 2, x86_64-w64-mingw32) of 2022-09-13.

feat: customize a `blacklist` of mode where `topspace` should not be activated

Is your feature request related to a problem? Please describe.

Some modes, like telega, org-agenda-mode look really bad with this mode active, which prevents me from using the global-topspace-mode

Describe the solution you'd like
It would be nice if there was a defcustom variable to customize certain modes where the user does not wish this mode to be active.

Confict with multiple lines in ElDoc

Describe the bug
When ElDoc shows more than 1 line, topspace "jumps" up.

To Reproduce
I'm using Spacemacs and I don't have enough Emacs experience to test this in an isolated environment.

  1. Install Spacemacs
  2. Enable typescript layer
  3. Add topspace to additional packages
  4. Open a typescript (.ts) file. Add console.log("test"). Add some extra lines so it doesnt fit in the window.
  5. Scroll up
  6. Move the cursor to console. It should now show 2 lines in the echo area below
  7. Bug: the content "jumps" back and the topspace above the first line gets smaller/disappears

Expected behavior
Nothing should happen :)

topspace version information

Latest from MELPA

Emacs version

GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6)
of 2022-04-04

[Bug] Breaks Shell-mode in Emacs 29 master

Describe the bug

Initialising Emacs with global-topspace-mode breaks Shell-mode in the master branch of Emacs 29.

When you spawn Shell buffers with Global-TopSpace on, the shell prompt fails to get displayed in buffer. If you try to execute any commands, Emacs freezes up and you have to kill it.

I've narrowed TopSpace down as the culprit for this as commenting it out in my init fixes the issue.

To reproduce

  1. Turn on global-topspace-mode in your init.el (I use use-package, and the code I use is:)

    (use-package topspace
        :ensure t
        :config (global-topspace-mode 1)
        )
    
  2. Launch Emacs

  3. Spawn a Shell buffer (M-x shell RET)

  4. Type anything and press Return

  5. Freeze up

Expected behavior

Shell-mode (and Emacs in-turn) to not freeze up. And spawn with the shell prompt.

TopSpace version information

Version: 20220513.1925
Commit: dd7d35b

Emacs version

GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6) of 2022-05-22

text-scale breaks scrolling

Topspace does not behave when changing the text scale with text-scale-set. When you scroll past the top the screen wraps around the point instead of moving it.
Also evil-scroll-* commands misbehave, sometimes the down scroll gets stuck at a certain point and stops moving further, while the up scroll will once again wrap the screen.
The problem occurs after changing the buffer's text-scale and persists even after reverting the change.

To Reproduce

  1. Open Buffer
  2. enable topspace
  3. M-x eval-expression (text-scale-set 2)
  4. scroll past the point
  5. try evil-mode scroll movement

Emacs version

GNU Emacs 28.2 (build 2, x86_64-w64-mingw32) of 2022-09-13.

Feature request: Line number 1 in front of first line of text

Is your feature request related to a problem? Please describe.
With line numbers enabled, line number 1 is currently shown at the top of the buffer. This is perfectly workable but it would be nice if it was in front of the actual first line of text.

Describe the solution you'd like
Have line number 1 be in front of the first line of text.

image

"Top lines" may be unclear

Hi,

FYI, I wasn't sure what this package did until I saw the demo GIF, because I didn't know what "top lines" meant. You may want to explain that differently in the description. :)

Local topspace-mode affects other buffers, too

Describe the bug

M-x topspace-mode affects all buffers, not just the local one.

To Reproduce
Steps to reproduce the behavior:

Example:

  1. Open Emacs emacs -Q, install topspace
  2. Visit file1.el with (require 'topspace) in it.
  3. Open other window C-x 3, visiting another file there, file2.el (doesn't have to exist)
  4. Run M-x topspace-mode in one of the splits
  5. scroll both window splits with the mouse

Expected behavior
The window and its buffer where you ran topspace-mode scrolls down; the other doesn't

Actual behavior
Both windows can scroll down with topspace

Screenshots

Edit: I now realize this variable is not buffer-local by default anyway, and also t after the require, so that's irrelevant. Screenshots left here to show that the mode is off in one of the buffers.

The window where topspace-mode is run:
image

The window that shouldn't have been affected still has topspace-active set to t:
image

Emacs version

GNU Emacs 28.0.90 (build 1, aarch64-apple-darwin21.2.0, NS appkit-2113.20 Version 12.1 (Build 21C52))
of 2021-12-28

topspace.el from master

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.