personal image registories for my oss project
t9md / atom-quick-highlight Goto Github PK
View Code? Open in Web Editor NEWHighlight text quickly
Home Page: https://atom.io/packages/quick-highlight
License: MIT License
Highlight text quickly
Home Page: https://atom.io/packages/quick-highlight
License: MIT License
personal image registories for my oss project
Current code base is a bit old.
I want to overhaul it to be easy to read/maintain.
In your screenshots in README, it looks like it highlights across panes. But this doesn't work for me, and I don't see any setting to enable it.
Is there a way to enable highlighting whatever is under the cursor without any need for shortcut to be pressed, i.e. wherever the cursor goes, the highlight changes/follows to the word under it?
Or is there maybe a package I could look into? I couldn't find any on my own...
I would really appreciate any help because I find such feature extremely useful.
Thanks for all the great work you do.
[Enter steps to reproduce:]
Atom: 1.48.0 x64
Electron: 5.0.13
OS: Mac OS X 10.14.6
Thrown From: quick-highlight package 0.13.0
Uncaught Error: regular expression is too large
At /Applications/Atom.app/Contents/Resources/app.asar/node_modules/superstring/index.js:256
Error: regular expression is too large
at TextBuffer.findAllInRangeSync (/app.asar/node_modules/superstring/index.js:256:44)
at TextBuffer.findAllInRangeSync (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:495632)
at TextBuffer.scanInRange (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:494582)
at TextBuffer.scan (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:494345)
at TextEditor.scan (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:40885)
at QuickHighlightView.highlight (/packages/quick-highlight/lib/quick-highlight-view.js:108:17)
at QuickHighlightView.highlightSelection (/packages/quick-highlight/lib/quick-highlight-view.js:95:52)
at later (/packages/quick-highlight/node_modules/underscore/underscore.js:724:25)
3x -1:57.4.0 core:confirm (input.hidden-input)
-1:35.3.0 find-and-replace:show (input.hidden-input)
-1:31.4.0 core:confirm (input.hidden-input)
-1:30.7.0 editor:consolidate-selections (input.hidden-input)
-1:30.7.0 core:cancel (input.hidden-input)
-1:24.4.0 find-and-replace:show (input.hidden-input)
-1:22.2.0 core:confirm (input.hidden-input)
-1:08.2.0 editor:toggle-soft-wrap (input.hidden-input)
-1:06.1.0 core:move-down (input.hidden-input)
4x -1:05.4.0 core:move-up (input.hidden-input)
4x -1:03.5.0 find-and-replace:find-next (input.hidden-input)
-0:39.2.0 quick-highlight:toggle (input.hidden-input)
-0:16.5.0 core:select-down (input.hidden-input)
8x -0:15.2.0 core:select-page-down (input.hidden-input)
25x -0:07.9.0 core:select-up (input.hidden-input)
-0:01.9.0 core:copy (input.hidden-input)
atom-beautify 0.33.4
atom-jinja2 0.6.0
base64 0.8.0
compare-files 0.8.1
default-language 0.3.1
language-ada 1.1.0
language-ldif 0.3.0
language-log 1.10.1
pretty-json 2.1.2
quick-highlight 0.13.0
xml-formatter 0.13.0
xml-tools undefined
Really like the plugin. Would it be feasible to allow making the first highlight work on whatever’s selected? Then the toggle command can make it a persistent highlight, and I can use this plugin to meet the highlighting behaviour in SublimeText 3.
after quick-highlight:clear the counter in the status line still remains.
However the "natural" behavior would be to hide it when there is no selection.
Hi. First of all, this package is great!
In the description of the package (README.md) I see that there is possible to enable a box highlight instead of underline. More specifically, from the comments taken from the LESS suggestion on how to override (shown in the snippet below), we see that there may be two classes (underline-01
and box-01
for instance):
// quick-highlight use 0 to 7 color
// for box style, use box-01 to box-07
// for highlight style, use highlight-01 to highlight-07
How do I switch from one to another?
Or should I simply override the border in the class underline-01
?
Thanks!
I realized that all highlights are gone after I restart atom :/ Is it possible to make the highlights permanent? What would I have to change in the code to do that if it is at all possible?
Suggested in #4
Hi guys, I just had this issue right after upgrading the plugin to 0.3.9
Atom Version: 1.3.2
System: Ubuntu 14.04.3
Thrown From: quick-highlight package, v0.3.9
Uncaught TypeError: Cannot read property 'map' of null
At /home/lmarchesini/.atom/packages/quick-highlight/lib/main.coffee:105
TypeError: Cannot read property 'map' of null
at getVisibleBufferRange (/home/lmarchesini/.atom/packages/quick-highlight/lib/main.coffee:105:40)
at Object.module.exports.renderEditor (/home/lmarchesini/.atom/packages/quick-highlight/lib/main.coffee:221:19)
at Object.module.exports.refreshEditor (/home/lmarchesini/.atom/packages/quick-highlight/lib/main.coffee:212:19)
at /home/lmarchesini/.atom/packages/quick-highlight/lib/main.coffee:156:26
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:86:11)
at /usr/share/atom/resources/app.asar/src/text-editor-element.js:113:47
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:86:11)
at TextEditorPresenter.module.exports.TextEditorPresenter.updateScrollTop (/usr/share/atom/resources/app.asar/src/text-editor-presenter.js:1024:29)
at TextEditorPresenter.module.exports.TextEditorPresenter.restoreScrollTopIfNeeded (/usr/share/atom/resources/app.asar/src/text-editor-presenter.js:1940:21)
at TextEditorPresenter.module.exports.TextEditorPresenter.setLineHeight (/usr/share/atom/resources/app.asar/src/text-editor-presenter.js:1411:14)
at LinesComponent.module.exports.LinesComponent.measureLineHeightAndDefaultCharWidth (/usr/share/atom/resources/app.asar/src/lines-component.js:136:22)
at TextEditorComponent.module.exports.TextEditorComponent.measureLineHeightAndDefaultCharWidth (/usr/share/atom/resources/app.asar/src/text-editor-component.js:1002:36)
at TextEditorComponent.module.exports.TextEditorComponent.sampleFontStyling (/usr/share/atom/resources/app.asar/src/text-editor-component.js:983:14)
at TextEditorComponent.sampleFontStyling (/usr/share/atom/resources/app.asar/src/text-editor-component.js:3:61)
at TextEditorComponent.module.exports.TextEditorComponent.becameVisible (/usr/share/atom/resources/app.asar/src/text-editor-component.js:267:12)
at TextEditorComponent.module.exports.TextEditorComponent.checkForVisibilityChange (/usr/share/atom/resources/app.asar/src/text-editor-component.js:933:16)
at atom-text-editor.TextEditorElement.attachedCallback (/usr/share/atom/resources/app.asar/src/text-editor-element.js:95:22)
at atom-pane.PaneElement.activeItemChanged (/usr/share/atom/resources/app.asar/src/pane-element.js:138:24)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:86:11)
at Pane.module.exports.Pane.setActiveItem (/usr/share/atom/resources/app.asar/src/pane.js:248:22)
at Pane.module.exports.Pane.activateItem (/usr/share/atom/resources/app.asar/src/pane.js:316:21)
at atom-tabs.TabBarView.onMouseDown (/usr/share/atom/resources/app.asar/node_modules/tabs/lib/tab-bar-view.js:670:19)
-0:18.5.0 settings-view:check-for-package-updates (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
{
"core": {},
"quick-highlight": {}
}
# User
language-gherkin, v1.0.3
quick-highlight, v0.3.9
react, v0.12.10
# Dev
No dev packages
This is not a bug report but a suggestion for enhancement:
I use Atom to write text (no code). As far as I am aware there is no package which allows me to highlight random words all in the same colour. Accordingly, it would be awesome if I could clear only the highlighting for a certain group of words which all have the same colour.
For my purposes it would be an improvement if there would only be one highlight colour even though that would not allow me to do what I described above (different colors for different self selected groups of words). I managed to do this by editing the quick-highlight.less file. If anyone wants to replicate this: search for @color01/02/03 etc in the uick-highlight.less file and change all of those (or only for one kind of highlighting (e.g. underline)) to one color, e.g. @Color01)).
For some reason in my configuration I barely see the selection. I tried to use "highlight and box" but it looks exactly the same (most likely as "box").
Could you please check it out?
What are the differences between this package and another one called highlight-selected? As far as i can see they both pretty similar, so please explain motivation to me.
Currently if one selects a symbol named e.g. fields_ptr
and let the package to highlight all its occurrences the package highlights also e.g. fields_ptr_size
which is desired not in every case.
[Enter steps to reproduce below:]
Atom Version: 1.2.4
System: Ubuntu 14.04.3
Thrown From: quick-highlight package, v0.3.9
Uncaught TypeError: Cannot read property 'getCursorBufferPosition' of undefined
At /home/george/.atom/packages/quick-highlight/lib/main.coffee:123
TypeError: Cannot read property 'getCursorBufferPosition' of undefined
at Object.module.exports.toggle (/home/george/.atom/packages/quick-highlight/lib/main.coffee:123:23)
at atom-text-editor.subs.add.atom.commands.add.quick-highlight:toggle (/home/george/.atom/packages/quick-highlight/lib/main.coffee:84:4)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:260:29)
at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61
at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/usr/share/atom/resources/app.asar/node_modules/command-palette/lib/command-palette-view.js:159:32)
at CommandPaletteView.module.exports.SelectListView.confirmSelection (/usr/share/atom/resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
at space-pen-div.atom.commands.add.core:confirm (/usr/share/atom/resources/app.asar/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:260:29)
at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:533:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:356:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (/usr/share/atom/resources/app.asar/src/window-event-handler.js:99:36)
at HTMLDocument.<anonymous> (/usr/share/atom/resources/app.asar/src/window-event-handler.js:3:61)
-0:45 snippets:expand (atom-text-editor.editor.is-focused)
-0:45 docblockr:parse-tab (atom-text-editor.editor.is-focused)
-0:45 editor:indent (atom-text-editor.editor.is-focused)
5x -0:44 core:backspace (atom-text-editor.editor.is-focused)
-0:42.4.0 core:save (atom-text-editor.editor.is-focused)
-0:30.6.0 settings-view:show-keybindings (atom-text-editor.editor.is-focused)
-0:27.1.0 core:paste (atom-text-editor.editor.mini.is-focused)
-0:26.2.0 core:undo (atom-text-editor.editor.mini.is-focused)
5x -0:21.3.0 core:backspace (atom-text-editor.editor.mini.is-focused)
-0:12.6.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
-0:12.6.0 core:cancel (atom-text-editor.editor.mini.is-focused)
-0:11.2.0 command-palette:toggle (atom-text-editor.editor.mini.is-focused)
2x -0:05.5.0 core:backspace (atom-text-editor.editor.mini.is-focused)
-0:02.2.0 core:move-down (atom-text-editor.editor.mini.is-focused)
-0:01.8.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-0:01.7.0 quick-highlight:toggle (atom-text-editor.editor.mini)
{
"core": {
"themes": [
"one-light-ui",
"one-light-syntax"
],
"ignoredNames": [
".git"
],
"projectHome": "/home/george/workspace",
"disabledPackages": [
"atom-jshint",
"color-picker"
]
},
"quick-highlight": {
"countDisplayPosition": "Right"
}
}
# User
atom-ternjs, v0.9.1
docblockr, v0.7.3
linter, v1.11.3
linter-htmlhint, v0.2.1
linter-js-standard, v3.2.1
linter-jshint, v1.2.1
linter-markdown, v1.2.1
linter-phpcs, v1.3.0
linter-sass-lint, v0.4.1
markdown-preview-plus, v2.2.2
minimap, v4.16.2
minimap-git-diff, v4.1.8
minimap-highlight-selected, v4.3.1
project-manager, v2.6.5
quick-highlight, v0.3.9
# Dev
No dev packages
Hello,
Yesterday I updated "quick-highlight" and since I encountered the following error:
[Enter steps to reproduce below:]
Atom Version: 1.0.19
System: Unknown Windows Version
Thrown From: quick-highlight package, v0.3.4
Uncaught TypeError: editorElement.getVisibleRowRange is not a function
At /C:/Users/xtqm513/.atom/packages/quick-highlight/lib/main.coffee:110
TypeError: editorElement.getVisibleRowRange is not a function
at getVisibleBufferRange (C:\Users\xtqm513\.atom\packages\quick-highlight\lib\main.coffee:62:38)
at Object.module.exports.renderEditor (C:\Users\xtqm513\.atom\packages\quick-highlight\lib\main.coffee:141:31)
at Object.module.exports.refreshEditor (C:\Users\xtqm513\.atom\packages\quick-highlight\lib\main.coffee:136:6)
at Object.module.exports.toggle (C:\Users\xtqm513\.atom\packages\quick-highlight\lib\main.coffee:131:6)
at atom-text-editor.subs.add.atom.commands.add.quick-highlight:toggle (C:\Users\xtqm513\.atom\packages\quick-highlight\lib\main.coffee:83:37)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\ProgramData\xtqm513\atom\app-1.0.19\resources\app.asar\src\command-registry.js:245:29)
at C:\ProgramData\xtqm513\atom\app-1.0.19\resources\app.asar\src\command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\ProgramData\xtqm513\atom\app-1.0.19\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:524:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\ProgramData\xtqm513\atom\app-1.0.19\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:347:22)
at HTMLDocument.module.exports.WindowEventHandler.onKeydown (C:\ProgramData\xtqm513\atom\app-1.0.19\resources\app.asar\src\window-event-handler.js:184:20)
-2:36.6.0 quick-highlight:toggle (atom-text-editor.editor.is-focused)
-1:53.6.0 core:move-left (atom-text-editor.editor.is-focused)
2x -1:53.5.0 core:move-down (atom-text-editor.editor.is-focused)
4x -1:52.6.0 core:select-right (atom-text-editor.editor.is-focused)
-1:51.3.0 quick-highlight:toggle (atom-text-editor.editor.is-focused)
-1:30.5.0 command-palette:toggle (atom-text-editor.editor.is-focused)
-1:29 core:move-down (atom-text-editor.editor.mini.is-focused)
-1:28.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-1:28.4.0 quick-highlight:toggle (atom-text-editor.editor)
-1:26 command-palette:toggle (atom-text-editor.editor.is-focused)
-1:24.8.0 core:confirm (atom-text-editor.editor.mini.is-focused)
2x -1:24.8.0 quick-highlight:clear (atom-text-editor.editor)
-1:22.4.0 quick-highlight:toggle (atom-text-editor.editor.is-focused)
-0:19.1.0 core:paste (atom-text-editor.editor.mini.is-focused)
-0:18.9.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-0:04.4.0 quick-highlight:toggle (atom-text-editor.editor.is-focused)
{
"core": {
"disabledPackages": [
"linter-perlcritic",
"SFTP-deployment",
"keyboard-localization",
"linter-perl"
]
},
"quick-highlight": {}
}
# User
atom-perl-prove, v0.5.0
compare-files, v0.6.2
editorconfig, v1.2.2
file-icons, v1.6.11
fold-functions, v0.4.3
highlight-column, v0.5.0
highlight-selected, v0.10.1
linter, v1.10.0
quick-highlight, v0.3.4
remote-sync, v3.1.2
Sublime-Style-Column-Selection, v1.3.0
tree-view-open-files, v0.2.4
# Dev
No dev packages
For example, I am using this, and would like to match the regex that vim-mode
uses for *
and #
. Possibly would be nice to add option to match vim-mode's regex, or to allow a custom regex.
In quick-highlight/styles/quick-highlight.less
:
Starting from Atom v1.13.0, the contents of atom-text-editor
elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host
and ::shadow
pseudo-selectors, and prepend all your syntax selectors with syntax--
. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:
atom-text-editor .quick-highlight.box-01 .region, atom-text-editor::shadow .quick-highlight.box-01 .region
=> atom-text-editor .quick-highlight.box-01 .region, atom-text-editor.editor .quick-highlight.box-01 .region
atom-text-editor .quick-highlight.box-02 .region, atom-text-editor::shadow .quick-highlight.box-02 .region
=> atom-text-editor .quick-highlight.box-02 .region, atom-text-editor.editor .quick-highlight.box-02 .region
atom-text-editor .quick-highlight.box-03 .region, atom-text-editor::shadow .quick-highlight.box-03 .region
=> atom-text-editor .quick-highlight.box-03 .region, atom-text-editor.editor .quick-highlight.box-03 .region
atom-text-editor .quick-highlight.box-04 .region, atom-text-editor::shadow .quick-highlight.box-04 .region
=> atom-text-editor .quick-highlight.box-04 .region, atom-text-editor.editor .quick-highlight.box-04 .region
atom-text-editor .quick-highlight.box-05 .region, atom-text-editor::shadow .quick-highlight.box-05 .region
=> atom-text-editor .quick-highlight.box-05 .region, atom-text-editor.editor .quick-highlight.box-05 .region
atom-text-editor .quick-highlight.box-06 .region, atom-text-editor::shadow .quick-highlight.box-06 .region
=> atom-text-editor .quick-highlight.box-06 .region, atom-text-editor.editor .quick-highlight.box-06 .region
atom-text-editor .quick-highlight.box-07 .region, atom-text-editor::shadow .quick-highlight.box-07 .region
=> atom-text-editor .quick-highlight.box-07 .region, atom-text-editor.editor .quick-highlight.box-07 .region
atom-text-editor .quick-highlight.box-selection .region, atom-text-editor::shadow .quick-highlight.box-selection .region
=> atom-text-editor .quick-highlight.box-selection .region, atom-text-editor.editor .quick-highlight.box-selection .region
atom-text-editor .quick-highlight.highlight-01 .region, atom-text-editor::shadow .quick-highlight.highlight-01 .region
=> atom-text-editor .quick-highlight.highlight-01 .region, atom-text-editor.editor .quick-highlight.highlight-01 .region
atom-text-editor .quick-highlight.highlight-02 .region, atom-text-editor::shadow .quick-highlight.highlight-02 .region
=> atom-text-editor .quick-highlight.highlight-02 .region, atom-text-editor.editor .quick-highlight.highlight-02 .region
atom-text-editor .quick-highlight.highlight-03 .region, atom-text-editor::shadow .quick-highlight.highlight-03 .region
=> atom-text-editor .quick-highlight.highlight-03 .region, atom-text-editor.editor .quick-highlight.highlight-03 .region
atom-text-editor .quick-highlight.highlight-04 .region, atom-text-editor::shadow .quick-highlight.highlight-04 .region
=> atom-text-editor .quick-highlight.highlight-04 .region, atom-text-editor.editor .quick-highlight.highlight-04 .region
atom-text-editor .quick-highlight.highlight-05 .region, atom-text-editor::shadow .quick-highlight.highlight-05 .region
=> atom-text-editor .quick-highlight.highlight-05 .region, atom-text-editor.editor .quick-highlight.highlight-05 .region
atom-text-editor .quick-highlight.highlight-06 .region, atom-text-editor::shadow .quick-highlight.highlight-06 .region
=> atom-text-editor .quick-highlight.highlight-06 .region, atom-text-editor.editor .quick-highlight.highlight-06 .region
atom-text-editor .quick-highlight.highlight-07 .region, atom-text-editor::shadow .quick-highlight.highlight-07 .region
=> atom-text-editor .quick-highlight.highlight-07 .region, atom-text-editor.editor .quick-highlight.highlight-07 .region
Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.
Hi ! Happy new year to all.
I've had a look at how to build a minimap integration for this package, as @t9md noted elsewhere he is not a user of minimap himself.
I have something basic working, but I've had to make some modifications to quick-highlight as one of the current optimizations (highlighting only what's visible) means we would also show, in the minimap, those highlights only. In the context of minimap it kind of defeats its purpose, in my opinion.
So, I'm now creating all highlights (even invisible ones), which could affect performance negatively, especially for large files.
On the other side, there's currently two subscriptions to the editor scroll events that I can remove, so this will give a smoother experience during scroll, especially on large files.
What do you think @t9md ? Should such changes live in a fork, or could they be merged here ? I know some people do not use minimap, so if the change mentioned above sounds bad to you, I understand you'll be cautious about it.
cc: @as-cii
After upgrading Atom v1.1.0.
editorElement.getVisibleRowRange()
return [undefined, undefined]
when editor is not shown before.
May be its related to introduction of editorElement.component.presenter.pendingScrollTop
?
I believe atom/vim-mode#906 is caused by same reason(scrollTop is not immediately refreshed).
I believe this should be fixed in Atom core side.
To avoid this problem, I can't use editorElement.getVisibleRowRange()
on atom.workspace.onDidChangeActivePaneItem
event.
Need investigation to provide immediate fix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.