Skip to content

Commit

Permalink
fix only one-char decoration bug and support ripple config
Browse files Browse the repository at this point in the history
  • Loading branch information
metasong committed Oct 1, 2021
1 parent c69d02a commit dfb3160
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 25 deletions.
3 changes: 2 additions & 1 deletion src/metaJump/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ All notable changes to the "metaJump" extension will be documented in this file.
- [x] make all the 'smart'(triggered by '/') commands use single target encoding. (note: the others are still multiple target encoding. we could config which command to use single-target-encoding)
- [x] document work for the changes.
#### Fixed
- [ ] 'Return' key's target decorators could shown if press press multiple time. (ripple function not work.)
- [x] 'Return' key's target decorators could shown if press press multiple time. (ripple function not work.)
- [x] could only show one-length decorators for multiple-target-location-chars commands.
#### Plan
---
### V1.3.0 Sep 28, 2021
Expand Down
20 changes: 12 additions & 8 deletions src/metaJump/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,18 @@ MetaJump provides fast cursor moving/selecting/deleting commands with decoration
> 1. two target-chars for current doc;
> 1. three or more target-chars for all opened editors;
> tip for fast jumping:
> 1. if goto location within the active document but not in the section(seperated by empty lines) with cursor, directly **type 2 target location chars**.
> 1. if want to go to another document but not active, **always typing 3 target chars**.
> Ripple support for sequential-target commands:
> * ripple support are used to reduce the decorations shown on screen.
> * it take the idea of the water ripple caused by a rock.
> * just show target-location candidates in current section(seperated by empty lines) if user typed one target char;
> * just show location candidates of current document, if there is more than one document visible and user typed 2 target chars.
> * one-char-decorators will pass through boundaries(section or document) if possible. (i.e. for one-target-char, one-char-decorators has encoded all possible target locations in the section, then it will continue encodes until all one-char-decorators are used up).
> * it is only for sequential-target commands, the default configured value is true.
> tips for fast jumping of ripple enabled sequential-target commands:
> 1. if go to another section within the active document but not in the active section.(sections are seperated by empty lines), directly **type 2 target location chars**.
> 1. if want to go to another visible document, **always typing 3 target chars**.
>
> for one or two target-chars:
> one-char-decorators will pass through boundaries(section or document) if possible. (i.e. for one-target-char, one-char-decorators has encoded all possible target locations in the section, then it will continue encodes until all one-char-decorators are used up). if ripple support is enable, and candidate locations need more than one decorator chars in the section, to reduce the decorators shown on screen, only the current section are decorated.
> two-char-decorators: if ripple support is enable, more than one document opened, and candidate locations need more than two decorator chars in the active document, to reduce the decorators shown on screen, only the current document are decorated.

> Note: <kbd>Enter</kbd>, <kbd>Space</kbd> and <kbd>Tab</kbd> are also usable as location characters. <kbd>Enter</kbd> means the end of line. You could press <kbd>Enter</kbd> any times to trigger the decorator-encoding for the line-end out side of current section(2 times) or document(3 times). (like a ripple)
Expand All @@ -81,7 +85,7 @@ MetaJump provides fast cursor moving/selecting/deleting commands with decoration

> commands that only navigate in the active editor are also provided: metaGo.gotoAfterActive, metaGo.gotoBeforeActive, metaGo.gotoSmartActive, you could assign shortcuts by yourself.
> for the metajump location navigation commands, user could config to use single-target-char or multiple-target-chars to navigate to location:
> for the metajump location navigation commands, user could config to use single-target-char or sequential-target-chars to navigate to location:
> by default all the 'smart' commands (triggered with '/') are configured as single-target-char as below
>
> ```json
Expand Down
35 changes: 20 additions & 15 deletions src/metaJump/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"metaGo.decoration.useTextBasedDecorations": {
"type": "boolean",
"default": true,
"description": "Only enable if editor decorations are not showing. Use text-based decorations in editors instead of SVG based. Supports fewer customisations but may be more robust."
"description": "Use text-based decorations in editors instead of SVG based. Supports fewer customizations but may be more robust."
},
"metaGo.decoration.width": {
"type": "number",
Expand Down Expand Up @@ -250,30 +250,30 @@
"type": "string",
"default": "#1e1e1e"
},
"metaGo.decoration.matchBackground": {
"type": "string",
"default": "editor.wordHighlightBackground",
"description": "in sequential-target-chars jump, background color of matched chars"
},
"metaGo.decoration.targetFollowCharBackground": {
"metaGo.decoration.backgroundColor": {
"type": "string",
"default": "#3058B888",
"description": "in sequential-target-chars jump, background color of the char follows target char"
"default": "#4068FF,yellow",
"description": "code decorator background color for different code length"
},
"metaGo.decoration.backgroundOpacity": {
"type": "string",
"default": "0.8"
},
"metaGo.decoration.backgroundColor": {
"type": "string",
"default": "#4068FF,yellow",
"description": "code decorator background color for different code length"
},
"metaGo.decoration.color": {
"type": "string",
"default": "white,blue",
"description": "code decorator foreground color for different code length"
},
"metaGo.decoration.matchBackground": {
"type": "string",
"default": "editor.wordHighlightBackground",
"description": "in sequential-target-chars jump, background color of matched chars"
},
"metaGo.decoration.targetFollowCharBackground": {
"type": "string",
"default": "#3058B888",
"description": "in sequential-target-chars jump, background color of the char follows target char"
},
"metaGo.decoration.characters": {
"type": "string",
"default": "k, j, d, f, l, s, a, h, g, i, o, n, u, r, v, c, w, e, x, m, b, p, q, t, y, z"
Expand Down Expand Up @@ -306,7 +306,12 @@
"metaGo.jumper.commandsToUseSingleTargetChar": {
"type": "string[]",
"default": ["metaGo.gotoSmart", "metaGo.selectSmart", "metaGo.addCursorSmart", "metaGo.metaJump.deleteToSmart"],
"description": "the names of the command to use the single target char, so could only type one target location char after command is triggered"
"description": "the commands to use the single target char, so we can only type one target location char after command is triggered"
},
"metaGo.jumper.enableRippleSupportForSequentialTargetCharsCommand": {
"type": "boolean",
"default": true,
"description": "to reduce decorations shown on screen, just show target-location candidates in current section(seperated by empty lines) if user typed one target char; just show location candidates of current document, if there is more than one document visible and user typed 2 target chars."
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/metaJump/src
Submodule src updated from 64cf42 to da6049

0 comments on commit dfb3160

Please sign in to comment.