Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

BadSpell doesn't look right when opening a file #211

Closed
FraserEmbrey opened this issue Sep 11, 2020 · 8 comments
Closed

BadSpell doesn't look right when opening a file #211

FraserEmbrey opened this issue Sep 11, 2020 · 8 comments

Comments

@FraserEmbrey
Copy link

When I open a new file with spelling on any words with BadSpell have a background highlight in light blue and white text, any new misspelled words are the normal red with underline (while the previous ones remain unchanged) and if I open a new pane then they all go back to red.

I have remedied this for now by clearing the style and setting it in an augroup:

augroup nord-theme-overrides
        autocmd!
        autocmd ColorScheme nord highlight clear SpellBad
        autocmd ColorScheme nord highlight SpellBad ctermfg=1
augroup END
@arcticicestudio
Copy link
Contributor

Hi @FraserEmbrey 👋

In order to ensure the problem is related to the Nord theme you need to reproduce the problem with a minimal and clean configuration. This can be done by creating new configuration file with any name (e.g. testrc) and run vim with the following command: vim -u testrc

For me as a theme author it's not possible to know if the theme is the root cause of the problem when using a customized configuration file that set different variables and/or loads different plugins where each line of code might break the theme.

Here's an minimal test configuration you can use to try to reproduce the problem (supposed you're using vim-plug):

call plug#begin(expand('~/.vim/plugged'))
Plug 'arcticicestudio/nord-vim'
call plug#end()

set nocompatible
if (has("termguicolors"))
  set termguicolors
endif

syntax enable
colorscheme nord

@FraserEmbrey
Copy link
Author

I have tested with the suggested testrc config. The issue only occurs when set spell is present in the config file (in this case testrc)

The version of vim is the default homebrew install on macOS. I updated just before testing. If I use the built in vim it behaves normally.

Here is the output of vim --version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Sep 16 2020 23:47:44)
macOS version
Included patches: 1-1700
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
+arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path +mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm -tcl
-autoservername +folding +multi_byte +termguicolors
-balloon_eval -footer +multi_lang +terminal
+balloon_eval_term +fork() -mzscheme +terminfo
-browse +gettext +netbeans_intg +termresponse
++builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent +ipv6 +perl +title
-clientserver +job +persistent_undo -toolbar
+clipboard +jumplist +popupwin +user_commands
+cmdline_compl +keymap +postscript +vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info +langmap +profile +virtualedit
+comments +libcall -python +visual
+conceal +linebreak +python3 +visualextra
+cryptv +lispindent +quickfix +viminfo
+cscope +listcmds +reltime +vreplace
+cursorbind +localmap +rightleft +wildignore
+cursorshape +lua +ruby +wildmenu
+dialog_con +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent -X11
-dnd +mouse -sound -xfontset
-ebcdic -mouseshape +spell -xim
+emacs_tags +mouse_dec +startuptime -xpm
+eval -mouse_gpm +statusline -xsmp
+ex_extra -mouse_jsbterm -sun_workshop -xterm_clipboard
+extra_search +mouse_netterm +syntax -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/[email protected]/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o vim -lncurses -liconv -lintl -framework AppKit -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.15 -fstack-protector-strong -L/usr/local/lib -L/usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -L/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/config-3.8-darwin -lpython3.8 -framework CoreFoundation -lruby.2.7

Here is the output of /usr/bin/vim --version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 9 2020 10:58:03)
macOS version
Included patches: 1-850
Compiled by [email protected]
Normal version without GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
-arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path -mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm -tcl
-autoservername +folding +multi_byte -termguicolors
-balloon_eval -footer +multi_lang +terminal
-balloon_eval_term +fork() -mzscheme +terminfo
-browse -gettext +netbeans_intg +termresponse
+builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent -ipv6 -perl +title
-clientserver +job +persistent_undo -toolbar
+clipboard +jumplist +popupwin +user_commands
+cmdline_compl -keymap +postscript -vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info -langmap -profile +virtualedit
+comments +libcall +python/dyn +visual
-conceal +linebreak -python3 +visualextra
+cryptv +lispindent +quickfix +viminfo
+cscope +listcmds +reltime +vreplace
+cursorbind +localmap -rightleft +wildignore
+cursorshape -lua +ruby/dyn +wildmenu
+dialog_con +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent -X11
-dnd +mouse -sound -xfontset
-ebcdic -mouseshape +spell -xim
-emacs_tags -mouse_dec +startuptime -xpm
+eval -mouse_gpm +statusline -xsmp
+ex_extra -mouse_jsbterm -sun_workshop -xterm_clipboard
+extra_search -mouse_netterm +syntax -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -liconv -framework Cocoa

I have a set of screenshots and a screen capture here

@FraserEmbrey
Copy link
Author

I install the homebrew version because the built in one is the 'normal' install and doesn't include features such as conceal and termguicolors.

The homebrew version will also remain up to date whereas the macOS one will often fall behind

@arcticicestudio
Copy link
Contributor

Using Vim via Homebrew is totally fine. To be honest I've never installed anything without brew, brew cask or mas like most “normal“ users doing (drag&drop an .app file).

You hint in the linked screencast might be a good hint (you can also upload them here in this issue via drag&drop in the comment text field). Can you please try to enable the spell settings after the colorscheme line in the testrc? Unfortunately Vim is one of these apps that relies on ordering in configs/scripts. It looks like the first errors are using the default error style while the new ones you've added while editing are affected by the rules that have been defined by Nord.

Could you also please post some details about your terminal (iTerm2, Terminal.app, … and shell (Bash, ZSH, …)?

@FraserEmbrey
Copy link
Author

Im aware of ordering being an issue, I have trued both at the beginning and end of the file, it makes no noticeable difference either way.

My terminal is iTerm nightly with the Nord colourscheme. I have used the regular iTerm as well but there is no difference.

Fish is the default shell, again the latest version installed using brew.

I have been using macOS 11 Big Sur.

@arcticicestudio
Copy link
Contributor

I also use iTerm2 so I can try to reproduce this. I use ZSH but using Fish and Big Sur should make no difference.
We need to ensure that the problem is really related to the theme because there haven't been any other reports regarding this problem. In nordtheme/vim#155 it seems like the highlighting works as designed like you can see on the screenshots posted by @vincentzhezhang.

Anyway, maybe this is related to the guisp attribute that was fixed in version 0.1.1. Could you please try to reproduce the problem again but use the override group to set guisp=""?
The difference between the available color space in terminal and GUI mode are often the reasons for highlighting problems.

@FraserEmbrey
Copy link
Author

I used the following testrc

set spell
call plug#begin(expand('~/.vim/plugged'))
Plug 'arcticicestudio/nord-vim'
call plug#end()

set nocompatible
if (has("termguicolors"))
  set termguicolors
endif

augroup nord-theme-overrides
        autocmd!
        autocmd ColorScheme nord highlight SpellBad guisp=''
augroup END
syntax enable
colorscheme nord

Starting vim gave me this error:

Error detected while processing /Users/frsr/testrc[16]..ColorScheme Autocommands for "nord":
E417: Missing argument: guisp=''

I am assuming I have done something wrong but I am not sure what, if I try with a value (e.g. Red) I don't get the error and nor do I get any highlighting.

@svengreb
Copy link
Member

svengreb commented Jun 3, 2023

@FraserEmbrey Thank you for your patience! 🙏🏼
It‘s been a while since I had free time to focus more on Nord, and my open source projects in general, and invest time in this issue due to work-life balance.

I recently published the first “Northern Post — The state and roadmap of Nord“ announcement which includes all details about the plans and future of the Nord project, including the goal of catching up with the backlog. This issue is part of the backlog and therefore I want to triage and process it to get one step closer to a “clean state“. Read the announcement about reaching the “clean“ contribution triage state in Nord‘s discussions for more details about the goal.

Due to the scope of this issue of not being “purely technical“, or being related to the project‘s code at all, I‘ll convert it into a discussion for Nord‘s central community hub on GitHub. This way the repository is easier to maintain by separating conversations about the actual code while also making help requests, ideas and other contributions from users more visible and supportable by the community.

@svengreb svengreb transferred this issue from nordtheme/vim Jun 3, 2023
@nordtheme nordtheme locked and limited conversation to collaborators Jun 3, 2023
@svengreb svengreb converted this issue into discussion #212 Jun 3, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants