Code Monkey home page Code Monkey logo

atom-expand-region'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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

atom-expand-region's Issues

Add documentation for customizing

Hello. This is by far one of my favorite packages, so thanks for putting it together! I did have some issues figuring out how the customization works though, as the README doesn't explain it too thoroughly. What do you think about adding a bit more info and perhaps an example, like:


Customize selected regions

Follow the Atom guide on language-specific configuration to adjust how regions are selected per language. Edit ~/.atom/config.cson and use the default settings as a reference.

For example, if you want to select words with dashes first in CSS (instead of words without dashes), you could change your config.cson to something like:

'.source.css':
  'expand-region':
    commands: [
      # Note how `expand-region:select-word` is no longer here 
      # like it is in the defaults
      {
        command: 'expand-region:select-word-include-dash',
        recursive: false
      }
      # etc...
    ]

And now if you expanded while your cursor was—for example—between x and t in text-align, rather than selecting text first, you'd select the whole text-align property.

"expand-region:expand" unfolds entire document

Version : 0.2.5
Atom Version: 1.10.2

Keybinding resolver shows expand-region is the only command activating.
Glanced quickly over the code. Don't see why it's happening.

Folding the second method and expanding anything in the first will unfold the second.
Example code:

{
  addLoggingToReducers(allReducers){
    return _.transform(allReducers, (agg, rawReducer, combineReducersKey)=>{
      agg[combineReducersKey] = function(state, action){
        // console.group(combineReducersKey);
        // console.log(`%c prev state`, `color:lightgreen`, store.getState());
        // if (action.type.startsWith('@@redux')){
        //   return rawReducer.apply(this, arguments);
        // }
        // console.groupCollapsed(`%c ${combineReducersKey}.${action.type} reducer`, 'color:darkblue');
        console.log(`%c ${combineReducersKey}.${action.type} reducer`, 'color:darkblue');
        // console.log(`%c action`, 'color:darkblue', action);
        const returnValue = rawReducer.apply(this, arguments);
        // console.groupEnd(`%c ${combineReducersKey}.${action.type} reducer`, 'color:darkblue');
        // console.log(`%c next state`, `color:darkgreen`, store.getState());
        // console.groupEnd(combineReducersKey);
        return returnValue;
      };
    });
  },

  addLoggingToDispatch(storeShadow){
    const dispatchRaw = storeShadow.dispatch;
    storeShadow.dispatch = (action)=>{
      // console.groupCollapsed(action.type);
      // console.log(`%c prev state`, `color:lightgreen`, storeShadow.getState());
      console.log(`%c dispatching ${action.type}`, 'color:blue', action);
      // console.log(`%c action`, 'color:lightblue', action);
      const returnValue = dispatchRaw(action);
      // console.log(`%c next state`, `color:darkgreen`, storeShadow.getState());
      // console.groupEnd(action.type);
      return returnValue;
    };
    return storeShadow;
  },
}

Probably a separate issue, but placing the cursor on the word "returnValue" in the first method, and expanding twice, results in a selection that starts in the comment and goes to the end of the enclosing method. Only happens when the comment is there.

Cancel command does not place cursor back to where it started

Hi,

An improvement I want to suggest is to place the cursor back to where it started in case one cancels the command (e.g., press ESC).

Currently, what happens is that the cursor stays at the last character of the last expanded selection. This is somewhat undesirable because when the selection is over-expanded and canceled, the cursor is often at a totally distant location from the location one was editing.

In any case, thank you for the great work done so far!

User defined selection order is ignored

Hi there.

Reading the instructions for customising selected regions it is my understanding that the user can specify the order they want selections to be made, with each expansion, for a given scope.

However, regardless of what order the user specifies, it seems the smallest selections are always made in order of smallest to largest. The user can remove a selection from a given scope, but they can't dictate what order they take place.

It would be great if the user also had control over what order the selections are cycled through with each expansion.

TextEditor.get is deprecated.

TextEditor.prototype.displayBuffer has always been private, but now
it is gone. Reading the displayBuffer property now returns a reference
to the containing TextEditor, which now provides some of the API of
the defunct DisplayBuffer class.

TextEditor.get (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:101:14)
Function.selectScope (/Users/andreadessi/.atom/packages/expand-region/lib/selector.coffee:60:28)
<unknown> (/Users/andreadessi/.atom/packages/expand-region/lib/selector.coffee:22:32)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2467:13)
TextEditor.mergeSelections (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2544:18)
TextEditor.mergeIntersectingSelections (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2506:35)

Select all inside HTML tags

Example:

<ul>
  <li class="listbox-option"><a href="">Link1</a></li>
  <li class="listbox-option"><a href="">Link2</a></li>
</ul>

Is it possible to configure the plugin to act in the following way?:

  • when the caret is on Link1, expanding goes in the following way:
    Link1 > a > li > both li (ul inner) > ul (including ul tags)
  • when the caret is between the ul and li tags (for example: <ul>|<li>, the selection is expanded to the ul content, that being the 2 li elements.

Expand region

The reason is that i often need to add another container for some elements, and I can do this easily in ST3's Expand Region in combination with emmet.

Default alt-up / alt-down are overwritten by Emmet

Is there a way in which I can make sure expand-region alt-up/alt-down are triggered instead of emmet? I use the alt-up / alt-down trigger in other apps (ie Webstorm) and I would much rather it trigger than emmet (can I disable emmet usage of these triggers

Configuration for Vuejs component

Hi.
Vuejs components described with js, html, scss\css in a single file.
Is there a way to configure plugin for vuejs components?

Customize selected regions for '*' scope

Atom    : 1.22.0
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0
atom-expand-regoin: 0.4.0

Step

  1. copy from settings.cson
  2. paste to under '*' scope

Expected result

The config is set and respected normally

Actual result

The config is converted to "expand-region": {} after saved

not working windows 8 64 bit

Installed this package, restarted atom.

Package doesn't appear inside the packages menu, the shortcuts don't work and when I paste the suggested shortcuts into the keymap, it doesn't do anything.

Does this plugin still work?

Uncaught TypeError: languageMode.rowRangeForFoldAtBufferRow is not a function

Steps to reproduce:

  1. Setup 1.22.0-beta0
  2. option+arrow up

Atom: 1.22.0-beta0 x64
Electron: 1.6.9
OS: Mac OS X 10.12.6
Thrown From: expand-region package 0.3.2

Stack Trace

Uncaught TypeError: languageMode.rowRangeForFoldAtBufferRow is not a function

At /Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:959

TypeError: languageMode.rowRangeForFoldAtBufferRow is not a function
    at Function.module.exports.Selector.selectFold (/packages/expand-region/lib/selector.coffee:47:7)
    at /packages/expand-region/lib/selector.coffee:13:7
    at /Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:2558:19
    at TextEditor.module.exports.TextEditor.mergeSelections (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:2635:24)
    at TextEditor.module.exports.TextEditor.mergeIntersectingSelections (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:2597:41)
    at TextEditor.module.exports.TextEditor.expandSelectionsForward (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:2552:25)
    at Function.module.exports.Selector.select (/packages/expand-region/lib/selector.coffee:12:12)
    at /packages/expand-region/lib/main.coffee:32:56)
    at CommandRegistry.handleCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app/src/command-registry.js:381:36)
    at CommandRegistry.dispatch (/Applications/Atom Beta.app/Contents/Resources/app/src/command-registry.js:266:23)
    at /packages/expand-region/lib/expand-region.coffee:113:21
    at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:952:24)
    at TextEditor.module.exports.TextEditor.transact (/Applications/Atom Beta.app/Contents/Resources/app/src/text-editor.js:1687:32)
    at ExpandRegion.module.exports.ExpandRegion.computeRanges (/packages/expand-region/lib/expand-region.coffee:112:13)
    at ExpandRegion.module.exports.ExpandRegion.computeCandidates (/packages/expand-region/lib/expand-region.coffee:65:7)
    at ExpandRegion.module.exports.ExpandRegion.expand (/packages/expand-region/lib/expand-region.coffee:16:20)
    at /packages/expand-region/lib/expand-region.coffee:1:1)
    at CommandRegistry.handleCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app/src/command-registry.js:381:36)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom Beta.app/Contents/Resources/app/src/window-event-handler.js:100:42)
    at HTMLDocument.<anonymous> (/Applications/Atom Beta.app/Contents/Resources/app/src/window-event-handler.js:3:65)

Commands

     -0:39.5.0 vim-mode-plus:insert-below-with-newline (input.hidden-input)
     -0:38.7.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
     -0:38.5.0 core:save (input.hidden-input)
  2x -0:37.3.0 vim-mode-plus:move-up (input.hidden-input)
     -0:34.8.0 intentions:highlight (input.hidden-input)
     -0:34.6.0 datatip:toggle (input.hidden-input)
     -0:18.4.0 editor:move-line-up (input.hidden-input)
     -0:17.5.0 editor:move-line-down (input.hidden-input)
     -0:16.9.0 intentions:highlight (input.hidden-input)
     -0:16.7.0 expand-region:expand (input.hidden-input)
     -0:16.7.0 editor:select-word (atom-text-editor.editor.vim-mode-plus.normal-mode.is-focused)
     -0:16.7.0 expand-region:select-word-include-dash (atom-text-editor.editor.vim-mode-plus.is-focused.normal-mode)
     -0:16.7.0 expand-region:select-word-include-dash-and-dot (atom-text-editor.editor.vim-mode-plus.is-focused.normal-mode)
     -0:16.7.0 expand-region:select-fold (atom-text-editor.editor.vim-mode-plus.is-focused.normal-mode)
     -0:16.5.0 datatip:toggle (input.hidden-input)
     -0:15.8.0 vim-mode-plus:reset-normal-mode (input.hidden-input)

Non-Core Packages

atom-beautify 0.30.5 
atom-elixir 0.2.3 
atom-jest-snippets 1.1.1 
atom-lcov 2.0.0 
atom-typescript 11.0.9 
autoclose-html 0.23.0 
build 0.69.0 
busy 0.7.0 
busy-signal 1.4.3 
clipboard-plus 0.5.1 
cucumber-step 0.2.0 
cursor-history 0.12.0 
editorconfig 2.2.2 
egghead-react-snippets 1.2.2 
erb-snippets 1.1.0 
es6-javascript 1.0.0 
exfmt-atom 0.4.5 
expand-region 0.3.2 
file-icons 2.1.12 
git-plus 7.9.3 
go-debug 1.5.2 
go-find-references 1.2.3 
go-imports 0.1.1 
go-plus 5.5.5 
go-quick-import 0.3.1 
go-rename 0.3.0 
go-signature-statusbar 1.2.3 
haskell-grammar 0.4.0 
highlight-selected 0.13.1 
intentions 1.1.5 
jump-to-import 3.5.0 
jumpy 3.1.3 
language-actionscript 0.2.0 
language-babel 2.75.1 
language-docker 1.1.8 
language-elixir 0.20.3 
language-gherkin 1.0.4 
language-nginx 0.8.0 
language-ocaml 1.9.5 
language-thrift 1.0.2 
language-x86asm 0.9.0 
last-cursor-position 0.9.2 
line-ending-converter 1.3.2 
linter 2.2.0 
linter-csslint 2.0.0 
linter-docker 0.2.1 
linter-eslint 8.3.2 
linter-flow 5.6.1 
linter-golinter 1.2.2 
linter-gotype 0.1.0 
linter-govet 0.1.5 
linter-ruby 1.2.6 
linter-ui-default 1.6.10 
nuclide 0.258.0 
open-git-modified-files 0.2.4 
open-this 0.4.0 
pigments 0.40.2 
prettier-atom 0.40.0 
pretty-json 1.6.4 
react-native-snippets 0.3.0 
ruby-block-converter 4.0.1 
ruby-syntax-replacer 0.5.1 
sort-lines 0.15.0 
tool-bar 1.1.0 
vim-mode-clipboard-plus 0.2.0 
vim-mode-plus 1.8.2 
vim-mode-plus-ex-mode 0.10.0 
vim-mode-plus-move-selected-text 0.11.0 
you-complete-me 0.8.0 

Uncaught TypeError: state.set is not a function

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.19
System: Mac OS X 10.10.1
Thrown From: expand-region package, v0.2.3

Stack Trace

Uncaught TypeError: state.set is not a function

At /Users/peterkadlot/.atom/packages/expand-region/lib/expand-region.coffee:111

TypeError: state.set is not a function
  at ExpandRegion.module.exports.ExpandRegion.computeRanges (/Users/peterkadlot/.atom/packages/expand-region/lib/expand-region.coffee:111:13)
  at ExpandRegion.module.exports.ExpandRegion.computeCandidates (/Users/peterkadlot/.atom/packages/expand-region/lib/expand-region.coffee:68:7)
  at ExpandRegion.module.exports.ExpandRegion.expand (/Users/peterkadlot/.atom/packages/expand-region/lib/expand-region.coffee:16:20)
  at atom-text-editor.<anonymous> (/Users/peterkadlot/.atom/packages/expand-region/lib/expand-region.coffee:1:1)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:184:20)

Commands

     -1:40.9.0 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.is-focused)
     -1:38.4.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -1:38.4.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -1:37.5.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -1:35 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -1:35 core:cancel (atom-text-editor.editor.mini.is-focused)
  8x -1:09.4.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:52.6.0 core:copy (div.package-readme.native-key-bindings)
     -0:10 core:paste (atom-text-editor.editor.is-focused)
     -0:08.7.0 core:save (atom-text-editor.editor.is-focused)
     -0:03.4.0 core:move-up (atom-text-editor.editor.is-focused)
     -0:03.2.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:03.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:02.7.0 core:move-up (atom-text-editor.editor.is-focused)
     -0:02.3.0 expand-region:expand (atom-text-editor.editor.is-focused)
     -0:00.3.0 expand-region:shrink (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "one-dark-ui",
      "new-era-syntax"
    ],
    "useReactEditor": false,
    "disabledPackages": [
      "mark",
      "ember-snippets",
      "selection-outlines",
      "rainbow-selection",
      "language-javascript-subtlegradient",
      "language-javascript-semantic",
      "open-last-project",
      "nuclide-installer",
      "nuclide-language-hack",
      "nuclide-quick-open",
      "nuclide-remote-projects",
      "nuclide-type-hint",
      "nuclide-hg-repository",
      "linter-jade",
      "ember-cli-helper",
      "neon-selection",
      "cucumber-step",
      "linter-jshint",
      "atom-handlebars",
      "atom-ternjs",
      "better-handlebars",
      "highlight-selected",
      "language-js-specs",
      "linter-9e-sass",
      "linter-jsonlint",
      "minimap-git-diff",
      "node-debugger",
      "turbo-javascript",
      "package-cop",
      "autocomplete-plus"
    ]
  },
  "expand-region": {}
}

Installed Packages

# User
atom-jade, v0.3.0
atom-wallaby, v1.0.6
cucumber, v0.5.0
docblockr, v0.7.3
editorconfig, v1.2.0
ember-tabs, v2.0.1
expand-region, v0.2.3
figlet, v0.5.2
fonts, v0.7.0
highlight-line, v0.11.0
language-gherkin, v1.0.3
linter, v1.9.0
linter-eslint, v3.1.1
linter-markdownlint, v1.0.1
minimap, v4.15.0
minimap-find-and-replace, v4.3.1
minimap-selection, v4.3.1
new-era-syntax, v1.0.1

# Dev
No dev packages

Back tick

Hi there,
ES6 javascript uses backtick:

`

for strings now. May you please add support for this. Thanks!

Plugin fails to load on beta release (1.37.0)

[Enter steps to reproduce:]

  1. On Atom start

Atom: 1.37.0-beta0 x64, 1.37.0-beta1 x64
Electron: 2.0.18
OS: Mac OS X 10.14.3
Thrown From: Atom Core

Stack Trace

Uncaught Error: ::set with a 'source' and no 'sourceSelector' is not yet implemented!

At /Applications/Atom Beta.app/Contents/Resources/app/static/<embedded>:11

Error: ::set with a 'source' and no 'sourceSelector' is not yet implemented!
    at Config.set (/Applications/Atom Beta.app/Contents/Resources/app/static/<embedded>:11:330629)
    at SettingsFile.activate (/Applications/Atom Beta.app/Contents/Resources/app/static/<embedded>:14:6114)
    at SettingsFile.load (/Applications/Atom Beta.app/Contents/Resources/app/static/<embedded>:11:3425225)
    at l.readFile (/Applications/Atom Beta.app/Contents/Resources/app/static/<embedded>:14:5992)
    at /Applications/Atom Beta.app/Contents/Resources/app/static/<embedded>:11:581165
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)

Commands

Non-Core Packages

atom-beautify 0.33.4 
atom-change-case-menu 0.2.0 
atom-jest-snippets 2.1.0 
atom-lcov 2.0.0 
autoclose-html 0.23.0 
build 0.70.0 
busy 0.7.0 
busy-signal 2.0.1 
clipboard-plus 0.5.1 
cucumber-step 0.2.0 
cursor-history 0.13.2 
double-tag 1.7.0 
editorconfig 2.4.0 
egghead-react-snippets 1.2.2 
erb-snippets 1.1.0 
es6-javascript 1.0.0 
ex-mode 0.18.0 
expand-region 0.4.2 
file-icons 2.1.31 
git-blame 1.8.0 
git-plus 8.6.2 
go-debug 1.6.2 
go-expanderr 0.1.1 
go-find-references 1.2.3 
go-imports 0.2.0 
go-plus 6.1.0 
go-quick-import 0.3.1 
go-rename 0.3.0 
go-signature-statusbar 1.2.3 
haskell-grammar 0.4.0 
highlight-selected 0.16.0 
hyperclick 0.1.5 
intentions 1.1.5 
jump-to-import 3.6.5 
jumpy 5.0.2 
language-actionscript 0.2.0 
language-arduino 0.4.3 
language-babel 2.85.0 
language-docker 1.1.8 
language-elixir 0.22.1 
language-gherkin 1.0.4 
language-haml 0.32.1 
language-nginx 0.8.0 
language-ocaml 1.9.5 
language-powershell 5.0.0 
language-thrift 1.0.2 
language-x86asm 0.9.0 
last-cursor-position 0.9.3 
line-ending-converter 1.3.2 
linter 2.3.0 
linter-csslint 2.0.5 
linter-docker 0.3.2 
linter-eslint 8.5.3 
linter-flow 5.6.1 
linter-golinter 1.3.0 
linter-gotype 1.0.0 
linter-govet 1.0.0 
linter-ruby 1.3.0 
linter-ui-default 1.7.1 
nuclide 0.366.0 
open-git-modified-files 0.2.4 
open-this 0.5.0 
pigments 0.40.2 
prettier-atom 0.56.4 
pretty-json 2.1.1 
ruby-block-converter 4.1.1 
ruby-syntax-replacer 0.5.1 
teletype 0.13.3 
todo-show 2.3.2 
toggle-quotes 1.1.3 
vim-mode-clipboard-plus 0.3.0 
vim-mode-plus 1.36.0 
vim-mode-plus-move-selected-text 0.12.0 
you-complete-me 0.8.1 

Here is original issue I posted to Atom Core
atom/atom#19144

Uncaught TypeError: undefined is not a function

Hi! I was very happy to see a plugin like this for atom since it's one of the things holding me back from Sublime. Unfortunately, I get the below error when using it. Can you help?

[Enter steps to reproduce below:]

  1. Run expansion command on any javascript file

Atom Version: 1.0.7
System: Mac OS X 10.10.4
Thrown From: expand-region package, v0.2.2

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/Sander/src/dotfiles/atom.symlink/packages/expand-region/lib/expand-region.coffee:14

TypeError: undefined is not a function
  at ExpandRegion.module.exports.ExpandRegion.expand (/Users/Sander/src/dotfiles/atom.symlink/packages/expand-region/lib/expand-region.coffee:14:30)
  at atom-text-editor.<anonymous> (/Users/Sander/src/dotfiles/atom.symlink/packages/expand-region/lib/expand-region.coffee:1:1)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/command-registry.js:241:29)
  at /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:177:20)

select inside/around single/double quote stops working

Hi @aki77
I usually use expand and shrink feature of this package, but today when I try to use the the select inside/around single/double quote feature, I noticed it stops working. I haven't used them for quite a while, but I remembered there were working when I used them previously.

Atom 1.120-beta 5

Not be able to select inside HTML tag, and mis-recognise quotes

Hi @aki77

Amazing package and exactly what atom is missing from the built-in packages.

However, trying it in the HTML brought up the issue below:
image
You can see that not only did it fail to select the text inside the HTML tag, it also failed to recgnise the quote appeared under the context by selecting lines of irrelavant text.

Judging from the development, I guess you're probably all tied-up and need some help (Wish I could, but I don't have the skill). Hope it will be fixed soon. Thanks.

Just updated to 0.3.0

Failed to load the expand-region package
Unexpected token o in JSON at position 5224 in /Users/Pro/.atom/packages/expand-region/package.json
Hide Stack Trace
SyntaxError: Unexpected token o in JSON at position 5224
at Object.parse (native)
at parseObject (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/season/lib/cson.js:54:19)
at parseContentsSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/season/lib/cson.js:68:16)
at Object.readFileSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/season/lib/cson.js:170:14)
at PackageManager.module.exports.PackageManager.loadPackageMetadata (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:721:29)
at PackageManager.module.exports.PackageManager.loadPackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:434:35)
at /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:412:19
at Config.module.exports.Config.transact (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:312:16)
at PackageManager.module.exports.PackageManager.loadPackages (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:407:19)
at /Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:792:28
at /Users/Pro/.atom/packages/expand-region/package.json:1:1

Uncaught TypeError: Cannot read property 'push' of undefined

Code block that caused this bug:
Cursor position is somewhere within the word, not exact position.

<option value="" data-state="Melb[cursor]ourne">Melbourne</option>
<option value="" data-state="Syd[cursor]ney">Sydney</option>
<option value="" data-state="Adel[cursor]aide">Adelaide</option>
<option value="" data-state="Brisb[cursor]ane">Brisbane</option>
<option value="" data-state="Canb[cursor]erra">Canberra</option>
  1. Multi-cursor, press Alt+Up, it throws error.
  2. Tested this with only 2 cursors, it works, 3 or more seems to break.

I hope that's helpful.

Atom: 1.18.0 x64
Electron: 1.3.15
OS: Mac OS X 10.12.5
Thrown From: expand-region package 0.3.0

Stack Trace

Uncaught TypeError: Cannot read property 'push' of undefined

At /Users/maikel/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:854

TypeError: Cannot read property 'push' of undefined
    at /packages/expand-region/lib/expand-region.coffee:129:42
    at TextBuffer.module.exports.TextBuffer.transact (/Users/maikel/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:849:24)
    at TextEditor.module.exports.TextEditor.transact (/Users/maikel/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1599:32)
    at ExpandRegion.module.exports.ExpandRegion.computeRanges (/packages/expand-region/lib/expand-region.coffee:112:13)
    at ExpandRegion.module.exports.ExpandRegion.computeCandidates (/packages/expand-region/lib/expand-region.coffee:65:7)
    at ExpandRegion.module.exports.ExpandRegion.expand (/packages/expand-region/lib/expand-region.coffee:16:20)
    at /packages/expand-region/lib/expand-region.coffee:1:1)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Users/maikel/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:265:35)
    at /Users/maikel/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:65
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Users/maikel/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:610:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Users/maikel/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:401:28)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Users/maikel/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:100:42)
    at HTMLDocument.<anonymous> (/Users/maikel/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:3:65)

Commands

     -0:38.4.0 docblockr:parse-enter (input.hidden-input)
     -0:38.4.0 editor:newline (input.hidden-input)
     -0:22.8.0 core:move-left (input.hidden-input)
  2x -0:11.6.0 core:backspace (input.hidden-input)
     -0:11 core:move-right (input.hidden-input)
     -0:10.6.0 editor:select-to-end-of-word (input.hidden-input)
     -0:10 core:copy (input.hidden-input)
  2x -0:09.8.0 core:move-left (input.hidden-input)
     -0:09.1.0 core:paste (input.hidden-input)
  2x -0:08.0 core:move-left (input.hidden-input)
     -0:07.5.0 editor:select-to-beginning-of-word (input.hidden-input)
     -0:06.9.0 core:move-left (input.hidden-input)
  2x -0:06.7.0 core:move-right (input.hidden-input)
     -0:05.8.0 expand-region:expand (input.hidden-input)
     -0:05.8.0 editor:select-word (atom-text-editor.editor.is-focused)
  2x -0:05.7.0 emmet:balance-outward (atom-text-editor.editor.is-focused)

Non-Core Packages

atom-handlebars 1.3.0 
atom-ternjs 0.18.3 
custom-title 1.0.1 
docblockr 0.10.5 
editorconfig 2.2.2 
emmet 2.4.3 
expand-region 0.3.0 
sort-lines 0.14.0 
sync-settings 0.8.2 

expanding "speed"

Hi,
Thank you for your package.
Its what I was looking for.
But there is slight problem, how can I control speed of selection?
I mean first few expanding works as expected, but after its selects method with params, its expands to whole scope.
Here is my desired expanding selection behavior
vs

How can i achieve this?

expand must select line before block

Hi, first thanks for this extension, I was missing this feature, secondly, I think than would be a big improve if before select block the expansion selects the entire line before, hope you implement this in a future, thank you!.....

Incorrect expansion at end of quoted text

Open a tab and copy this in:

('abc')

("def")

('abc')

("def")

Put your cursor between c' or f" and try to expand. Instead of expanding to select abc or def, it selects between the quote next to the cursor and the next matching quote a couple lines down.

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.