Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pythonDot highlight match #927

Merged
merged 2 commits into from Feb 19, 2019
Merged

Remove pythonDot highlight match #927

merged 2 commits into from Feb 19, 2019

Conversation

@zhimsel
Copy link
Contributor

@zhimsel zhimsel commented Jul 27, 2018

When the cursorcolumn or cursorline vim option is set, any . characters result in the highlighting being set to Normal (instead of blank). This means that the "highlighted" line (via cursorline) is broken over the period. Please see attached screenshot for an example:

screen shot 2018-07-27 at 14 10 06

As far as I can tell, the pythonDot match doesn't really do anything except drop the highlighting back to Normal in a pythonDottedName match. This just seems useless, so I think we should just remove it and let the dots have the same highlight as the rest of the pythonDottedName matches.

The main reason for this PR was not for a specific issue (my highlighting issue was just a symptom). I submitted this PR because I noticed that the pythonDot highlight group seemed entirely pointless. All it does is drop the highlighting for any . characters to Normal. This doesn't seem to be expected or desired behavior (the . should match the surrounding highlight).

This confuses the 'cursorline' and 'cursorcolumn' vim options
zhimsel added a commit to zhimsel/dotfiles that referenced this pull request Jul 27, 2018
until python-mode/python-mode#927 is merged or
addressed.
@diraol
Copy link
Contributor

@diraol diraol commented Jan 6, 2019

@zhimsel sorry not giving a feedback before.

I've tested over here in a clean environment, and I was not able to reproduce the behavior you described. I mean, I've tested with only python-mode and vim-colorschemes plugins and the highlight worked as expected.

Are you sure that there isn't any other plugins/configs interacting in your environment? Which theme are you using? solarized-dark?

@zhimsel
Copy link
Contributor Author

@zhimsel zhimsel commented Jan 6, 2019

Are you sure that there isn't any other plugins/configs interacting in your environment?

It's quite possible. I can do some reductive testing to see if any other plugins are interfering when I get the time. I'll report back here once I've had the chance.

Which theme are you using? solarized-dark?

Yes, solarized-dark.

@diraol
Copy link
Contributor

@diraol diraol commented Jan 7, 2019

Thanks @zhimsel !
I'm using a docker-environment to test python-mode. You can give it a try to start from a cleaner env without messing up with your own.
You can find more info about it here:
#977

@zhimsel
Copy link
Contributor Author

@zhimsel zhimsel commented Feb 19, 2019

@diraol I was able to do some more verification of this issue.

Using the following vimrc with neovim 0.3.4:

source ~/.vim/vim-plug/plug.vim  " managed externally
call plug#begin('~/.vim/plugins')
  Plug 'altercation/vim-colors-solarized'
  Plug '~/dev/python-mode',
call plug#end()

" Set color scheme
silent! colorscheme solarized

set cursorline " Highlight current line
syntax enable " Enable syntax highlighting

" show highlight group for what's under the cursor
map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>

I confirmed that the . is de-highlighted in the current line with cursorline set. I also tested the flazz/vim-colorscheme version of solarized.


The main reason for this PR was not for a specific issue (my highlighting issue was just a symptom). I submitted this PR because I noticed that the pythonDot highlight group seemed entirely pointless. All it does is drop the highlighting for any . characters to Normal. This doesn't seem to be expected or desired behavior (the . should match the surrounding highlight).

@diraol
Copy link
Contributor

@diraol diraol commented Feb 19, 2019

Hum... got it!

Well, I could not reproduce it, not even with your suggestion under a clean env (dockerized).

But the proposed changes seems to be reasonable after all (now that you explained the reason behind it).
So I'll merge and if someone faces issues with it, a new issue can be opened, and we can discuss it better. =) Thanks for the contribution!

@diraol diraol merged commit 81a4f6e into python-mode:develop Feb 19, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zhimsel
Copy link
Contributor Author

@zhimsel zhimsel commented Feb 19, 2019

No problem! Thanks for merging!

@zhimsel zhimsel deleted the zhimsel:dot_hi_fix branch Feb 19, 2019
zhimsel added a commit to zhimsel/dotfiles that referenced this pull request Feb 19, 2019
Now that python-mode/python-mode#927 has been
merged into 'develop'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.