GithubHelp home page GithubHelp logo

usernamehw / vscode-find-jump Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 6.0 2.02 MB

Like Ace Jump, but better. Quickly move cursor to visible location

Home Page: https://marketplace.visualstudio.com/items?itemName=usernamehw.find-jump

License: MIT License

TypeScript 91.47% JavaScript 8.53%
vscode-extension

vscode-find-jump's People

Contributors

ccjmne avatar nilscox avatar usernamehw avatar wkordalski 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

Watchers

 avatar  avatar

vscode-find-jump's Issues

Quick jump letters choosing

Problem: Quick jump letters are not calculated properly.

Find=>Jump version: v0.6.2


How to reproduce

Assume we have such file:

sh

sasasasasasasasasasasasasasasasasa
sasasasasasasasasasasasasasasasasa
sasasasasasasasasasasasasasasasasa
sasasasasasasasasasasasasasasasasa
sasasasasasasasasasasasasasasasasa
sasasasasasasasasasasasasasasasasa

I place cursor at the end of the file.
When I activate the extension and type letter s, I get this (note I have different order of letters in the alphabet set):

image

I would like to jump to sh in the first line, so I type letter h, which places cursor in the 7-th line.

RFC. Comparative review feedback, and feature requests.

Hi ๐Ÿ‘‹

I'm looking into creating my own extension pack. Because of this i've been reviewing vim-easymotion / aceJump extensions in the VScode marketplace.

My experience with extensions of this type

WARNING: WOT incoming!
  1. Jumpy - For what it does, it works well. But it lacks features for selecting text, and the jump characters aren't customizable in terms of font, colors, etc.

  2. Meta Jump - Is probably the most full featured. But the default configuration is insanely bad, it lacks a "dim mode", sometimes it would generate jumps that were +3 characters long (for no reason), and I had stability issues when using it (maybe because it was designed for use with Vim or as a dependency of MetaGo? Not sure).

  3. Code Ace Jumper - The oldest (going by repo age) and still functional. But it is not very actively maintained, the "dim mode" doesn't work as expected, and the settings API has several options in there that don't actually do anything (have been deprecated but not removed).

... And now we come to 4. Find => Jump

In my opinion, it is the best out of all these listed here ๐Ÿ’ฏ

It provides equal or better functionality as Code Ace Jumper, without any of the shortcomings, no issues with configuration and (more importantly) stability either. ๐Ÿ‘

Feature Requests

Meta Jump is the most full featured "jumper" i have used. If it worked correctly, there are 2 features it has that, as far as i know, none of the other ones have, including find => jump. I request these be added:

  • Smart cursor positioning. From the Meta Jump docs:

the Alt+/ shortcut will trigger the metaGo.gotoSmart command which intelligently set cursor position after navigation:

  • if the target is at the begin of the word, the cursor will be set before target character, otherwise after it;
  • The 'word' is defined as a group of all alphanumeric or punctuation characters.
  • Insert Multi-Cursors
  1. Activate trigger (alt+;)
  2. type target letter -> type jump character -> insert cursor at location
  3. type target letter -> type jump character -> insert second cursor at location
    ...
    Activate trigger to exit mode (alt+;) while keeping cursors

Note: This mode would also need to respond to the editor action : Cursor Undo (default ctrl+u), in case one was added in the wrong place.

Configure colors of decoration

  • Decoration background
  • Decoration background in light themes (fallback to ordinary color)
  • Decoration color
  • Decoration color in light themes (fallback to ordinary color)
  • Hot reload of settings

Configure number of next excluded characters

Original extension scans the entire document and excludes match + 8 next characters that cannot be used as jump character. As a result if there are many matches on the screen the extension runs out of characters to jump and you can only jump to the very small part of the screen.

Activating should focus activeTextEditor

  1. Focus anything except editor (File Explorer/Find Widget; for instance)
  2. Press Ctrl+;

Actual: Status bar entry is blinking, but you cannot type
Expected: Editor should get focus

`goToFirstMatch` selects the last match on a line that has multiple match.

Assuming content like:

export function pickColorType(inputColor: string): ThemeColor | string {
  if (/[a-z]+\.[a-z]+/i.test(inputColor) ||
    ['contrastActiveBorder', 'contrastBorder', 'focusBorder', 'foreground', 'descriptionForeground', 'errorForeground'].includes(inputColor)
  ) {
    return new ThemeColor(inputColor);
  } else {
    return inputColor;
  }
}

Activate findJump, type color, and you'll find multiple matches.
Use findJump.goToFirstMatch and you'll jump the last match on the first line that contains any match, as illustrated below:

//                                                it jumps here
//                                                      v
export function pickColorType(inputColor: string): ThemeColor | string {
//                  ^
//         it should jump here

Does not work in remote development

Hello,
extension doesn't specify extensionKind, tries to run remotely by default and subsequently raises error on executing commands.

[2020-12-10 12:33:04.004] [exthost] [error] Error: command 'type' already exists
	at _.registerCommand (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:723:970)
	at Object.registerCommand (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:1044:634)
	at new e.InlineInput (/home/vagrant/.vscode-server-insiders/extensions/usernamehw.find-jump-0.5.1/dist/extension.js:1:3423)
	at activate (/home/vagrant/.vscode-server-insiders/extensions/usernamehw.find-jump-0.5.1/dist/extension.js:1:4624)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:1044:786
	at t.ExtHostTextEditor.edit (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:676:191)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:1044:775
	at _executeContributedCommand (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:725:220)
	at _.$executeContributedCommand (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:725:595)
	at m._doInvokeHandler (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:916:926)
	at m._invokeHandler (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:916:618)
	at m._receiveRequest (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:915:252)
	at m._receiveOneMessage (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:914:6)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:912:136
	at l.fire (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:46:801)
	at v.fire (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:233:787)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:1119:104
	at l.fire (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:46:801)
	at v.fire (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:233:787)
	at t.PersistentProtocol._receiveMessage (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:238:1004)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:235:927
	at l.fire (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:46:801)
	at p.acceptChunk (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:231:195)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:230:547
	at Socket.t (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:240:822)
	at Socket.emit (events.js:223:5)
	at Socket.EventEmitter.emit (domain.js:475:20)
	at addChunk (_stream_readable.js:309:12)
	at readableAddChunk (_stream_readable.js:290:11)
	at Socket.Readable.push (_stream_readable.js:224:10)
	at TCP.onStreamRead (internal/stream_base_commons.js:181:23) findJump.activate
[2020-12-10 12:34:48.508] [exthost] [error] TypeError: Cannot read property 'destroy' of undefined
	at e.FindJump.cancel (/home/vagrant/.vscode-server-insiders/extensions/usernamehw.find-jump-0.5.1/dist/extension.js:1:6415)
	at activate (/home/vagrant/.vscode-server-insiders/extensions/usernamehw.find-jump-0.5.1/dist/extension.js:1:4454)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:1044:786
	at t.ExtHostTextEditor.edit (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:676:191)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:1044:775
	at _executeContributedCommand (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:725:220)
	at _.$executeContributedCommand (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:725:595)
	at m._doInvokeHandler (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:916:926)
	at m._invokeHandler (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:916:618)
	at m._receiveRequest (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:915:252)
	at m._receiveOneMessage (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:914:6)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:912:136
	at l.fire (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:46:801)
	at v.fire (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:233:787)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:1119:104
	at l.fire (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:46:801)
	at v.fire (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:233:787)
	at t.PersistentProtocol._receiveMessage (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:238:1004)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:235:927
	at l.fire (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:46:801)
	at p.acceptChunk (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:231:195)
	at /home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:230:547
	at Socket.t (/home/vagrant/.vscode-server-insiders/bin/5e350b1b79675cecdff224eb00f7bf62ae8789fc/out/vs/server/remoteExtensionHostProcess.js:240:822)
	at Socket.emit (events.js:223:5)
	at Socket.EventEmitter.emit (domain.js:475:20)
	at addChunk (_stream_readable.js:309:12)
	at readableAddChunk (_stream_readable.js:290:11)
	at Socket.Readable.push (_stream_readable.js:224:10)
	at TCP.onStreamRead (internal/stream_base_commons.js:181:23) findJump.activate

It seems that simply setting it to run locally does help, verified through override in config as following

    "remote.extensionKind": {
        "usernamehw.find-jump": "ui"
    }

... so setting extensionKind to ["ui"] could probably fix it for everyone.

Add option to toggle with Ctrl+;

Right now pressing Ctrl+; resets everything, but the mode stays active.

It would be nice to have option for the default activation command to toggle the state.

cursor not jumping when word is outside of visible area

This fork seems to be the updated one so hoping to get the issue resolved.
Cursor is not jumping to the word automatically when I activate the extension with ctrl+;. When the searched word is in the visible area then it shows some highlight character to jump the cursor.

Is it possible to directly jump to the first occurance of the word as soon as I start typing. Can it be done?

Feature request - select word

Hello, Is it possible to have another type of selection where the selection will be limited to the surrounding word.

hello -> find and select by h -> will select hello
hello -> find and select by el -> will also select hello

This will help in changing the word quickly.

Current selection feature selects everything from the current cursor to the matched character.

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.