Giter VIP home page Giter VIP logo

jupyter_highlight_selected_word's People

Contributors

gitter-badger avatar jcb91 avatar toddrme2178 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  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

jupyter_highlight_selected_word's Issues

Variable highlighting in text editor

When I am coding in a Jupyterlab editor, I would like the variable where the cursor is placed to be highlighted throughout the editor. This makes following the code easier. I know that this extension is not about the editor but instead about the cells of a notebook. But, would it be possible to add to the text editor as well? Or, if there exists an extension that already does this, could you please point me to it? Thanks!

possible across all notebook cells?

Thanks for the great extension!
I was wondering though, is it possible to have the highlighting happen throughout all code cells, not only within the current one? Best if configurable, of course. ;)

Feature request: highlight on double-click and bounding box outline

Hi, I was really excited to see this plugin. I have two questions:

First, is it possible to highlight only when the whole word has been highlighted instead of highlighting the current word wherever the cursor is?

Next, is it possible to change the highlighting from a background color to a light bounding box? E.g.
image

Selection highlight is currently applied on partially matched word

From #10 I've disabled the show_token. The only concern remained is when I select a word, it highlights all occurrence of such string disregarding whether it's a word or part of a word. i.e. when I select rand, it will also highlight the rand in rand_number. This behavior differs from common editors, though I'm not sure if you'd like to keep it. If the common way is preferred, I guess a workaround would be like the following (not sure yet).

// main.js line 147
if (selection.length >= params.min_chars) {
    newOverlay = makeOverlay(selection, /[\w$]/, params.highlight_style);
}

Do you think it's reasonable, or you prefer keeping the original behavior?

Doesn't work in Firefox

I'm using Firefox 58.0.1 and JN 5.2.1 and getting the following error message in the console:

[highlight_selected_word] error loading: DOMException("A parameter or an operation is not supported by the underlying object").

Highlighting does not happen. Please see the screenshot below:

image

Not compatible with python 3.11


Could not solve for environment specs
Encountered problems while solving:
  - package jupyter_highlight_selected_word-0.2.0-py310hbe9552e_1005 requires python_abi 3.10.* *_cp310, but none of the providers can be installed

The environment can't be solved, aborting the operation

Stop matching on cursor?

Hi! As you can see in the image, the extension is matching whenever I have the cursor next to a word:

image

Is there a way to stop this behavior, and match only when I highlight words?

Thanks in advance.

How do I remove it?

Noob here.
Even after I've tried disabling or removing it in the prompt it is not found.
What can I do?

I want to match across all the cells, but I cannot...

I like the jupyter_highlight_selected_word so much! Thank you! @jcb91

There is a problem: I want to show all matches across all the cells, but only visible matches are shown. When I scrolled, additional matches were not highlighted until I switched to another page and switched back.

Here are my versions:

Python 2.7.14
Ubuntu 16.04 LTS
jupyter-highlight-selected-word (0.2.0)
Firefox 61.0(x64)

jupyter (1.0.0)
jupyter-client (5.2.3)
jupyter-console (5.2.0)
jupyter-contrib-core (0.3.3)
jupyter-contrib-nbextensions (0.5.0)
jupyter-core (4.4.0)
jupyter-latex-envs (1.4.4)
jupyter-nbextensions-configurator (0.4.0)

Here are my settings:

Highlight matches across all cells --> True
Only apply highlights to editors which are visible in the scrolled view --> False

Please help me...

Preventing highlighting for selected texts doesn't work properly

As described in #9, this feature does not work to me. It seems that CodeMirror-selectedtext isn't applied properly to selected texts under my chrome browser.
('seems' means that I'm not sure whether it's true. I could not observe this property well under chrome's devtool since it changes whenever I switched my mouse from the selected texts to the devtool window.)
Do you have ideas how could I verify this or any workarounds?

Version under conda-forge is still v0.07 (rather than current v0.08)

Hello,

I found this feature in v0.08 great: Prevent highlighting the currently-selected text, to make it clearer where the cursor is****

Though what I got was v0.07 as part of the jupyter_contrib_nbextensions collection.

I've also tried the following command.

conda install -c conda-forge jupyter_highlight_selected_word
Fetching package metadata .........
Solving package specifications: ..........

# All requested packages already installed.
# packages in environment at /anacondas/deepsim/envs/tensor3:
#
jupyter_highlight_selected_word 0.0.7                    py35_0    conda-forge

It seems that the version under conda is v0.07.

Could it be easily solved? Thanks.

Highlight only selected text

Hi, is there a way to highlight only selected text? If I select a block of code it highlights words within. Have both "...match whole words" and "highlight matches if surrounded by non-word characters..." off although the latter is off.

image

Ignore Comments

Hi Josh,

Thanks for the extension! Would it be possible to add the option to ignore comments inside code cells? I like this extension for highlighting variable and method occurrences, but when I'm typing comments, I typically don't want all occurrences of a word to highlight.

For what it's worth, it appears the default behavior of PyCharm is to ignore comments, while Sublime includes them, so users accustomed to different IDEs may choose differently. I think this makes a good case for the option to toggle on or off.

incompatible with Sublime keymap use of ctrl^d multi cursor editing

First, let me say thank you for a great extension!

My only problem with using this extension is that it overrides the highlighting of multi-cursor editing using Sublime keymap (ctrl^d) in a way that makes it unusable. The problem is that there is almost no way to see which instances of the selected word are selected in the multi-cursor editing and which are not.

Perhaps a work around could be to have the "highlight selected word" disabled by default, or at least persistent between notebook loads, so that I could turn the feature on when I need it only.

Thanks again,

Highlighted words remain highlighted after selecting other words

Hello, thank you a lot for implementing this great feature. It really makes Jupyter get easier to use for coding.

I have noticed that when the option "Highlight matches across all cells. If false, only matches within the currently selected cell will be highlighted." is off, words which I select remain hilighted when I click on otehr cells. This hilighting becomes persistent even if I come back to the original cell and select another word. As time goes on and I select other words and then switch between cells back and forth, the number of hilighted increases and kills the benefit of your otherwise good extension.

Reloading the page will reset the hilighting. Also, as I aid before, activating the option "Highlight matches across all cells. If false, only matches within the currently selected cell will be highlighted." prevents this problem from happening.

I hope this ticket will be useful. PLease let me know if I can bring more details.

below are my jupyter related packages and their version:
jupyter (1.0.0)
jupyter-client (5.2.3)
jupyter-console (5.2.0)
jupyter-contrib-core (0.3.3)
jupyter-contrib-nbextensions (0.4.0)
jupyter-core (4.4.0)
jupyter-highlight-selected-word (0.1.0)
jupyter-latex-envs (1.4.1)
jupyter-nbextensions-configurator (0.4.0)

How can I change the highlight color?

I'm using a dark theme. The bright green selection color contrasts badly. Can I change the selection color in the notebook.json file or would I have to download the repo, change the color in the main.js file and install from there?

I've tried to edit the color as instructed under the "Options" header in the readme but changing the color to "dim gray" or "#696969" doesn't seem to do anything. Thanks.

Does this make my notebook slow/lag/sluggish?

As the notebook accumulates more content after working on it for a while, does this feature make my notebook slow/lag/sluggish? Such as longer lagging time when typing in codes.

Compatibility issue

Hi !

Thank you for your many efforts on the notebook extensions ! Your work is amazing !

I am now trying to use this one. I have jupyter 4.3.0 and in the nbextension configurator, normally this one is greyed out, and shows 4.x in red. Basically, it says it is incompatible.

And surely it is (or I don't know how to use it). I enabled it despite the incompatibility, reloaded a notebook and double-clicked a word in a code cell. Other instances of the word don't become highlighted.
I have setup the sublime keymap. Could that interfere, as I've seen in a different issue ?

Or is it just that my version of the extension is old ? I installed with pip install jupyter_contrib_nbextensions and jupyter contrib nbextension install --user.

Thanks again !

Only Highlight Selection + Toggle Key

Hello,
Thank you very much for this extension.

I was trying to configure the extension in order for it to only highlight when the whole word is actually selected, rather than highlighting the words when I simply put the cursor between or beside a word (which is whats happening right now). How could I achieve the former configuration ?

Moreover, only want to highligh when I press ctrl ... how should I configure it ?

This is the configuration code I executed in python but it does not achieve what I mentioned above:

from notebook.services.config import ConfigManager
cm = ConfigManager()
cm.update('notebook', {'highlight_selected_word': {
    'delay': 1000,
    'code_cells_only': True,
    'highlight_color': '#72055b',
    'highlight_color_blurred': '#72055b',
    'words_only': True,    
    'use_toggle_hotkey': True,
    'toggle_hotkey': 'ctrl',
}})

Highlighting stuck after scrolling when only_cells_in_scroll is true

The highlighting appears to be stuck on the selected word after scrolling down when only_cells_in_scroll is true.

Versions:

Highlight_selected_word 0.1.0
Chrome 64.0.3282.140
Notebook server 5.4.0
Python 3.6.3
IPython 6.2.1
MacOS 10.13.3 or Ubuntu 17.10

The notebook.json:

{
  "Notebook": {
    "Header": false,
    "Toolbar": true
  },
  "load_extensions": {
    "code_prettify/autopep8": true,
    "equation-numbering/main": true,
    "hide_input/main": true,
    "spellchecker/main": true,
    "init_cell/main": true,
    "livemdpreview/livemdpreview": true,
    "python-markdown/main": true,
    "highlight_selected_word/main": true,
    "toc2/main": true,
    "varInspector/main": true,
    "collapsible_headings/main": true,
    "hide_header/main": true,
    "snippets_menu/main": true,
    "zenmode/main": true,
    "hinterland/hinterland": true,
    "help_panel/help_panel": true
  },
  "toc2": {
    "number_sections": false
  },
  "zenmode_use_builtin_backgrounds": false,
  "zenmode_backgrounds": [
    "http://localhost"
  ],
  "highlight_selected_word": {
    "code_cells_only": true,
    "outlines_only": true,
    "words_only": true,
    "highlight_color": "#ff8000",
    "highlight_color_blurred": "#ffb266",
    "use_toggle_hotkey": true,
    "enable_on_load": true,
    "only_cells_in_scroll": true
  },
  "help_panel_add_toolbar_button": true
}

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.