viconf now disables semantic tokens for nixd if the file contains non-ascii characters, temporary workaround until the feature is fixed

This commit is contained in:
pagedmov
2024-11-07 02:03:15 -05:00
parent 50decf03c9
commit 319ca70254
4 changed files with 17 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ config here](https://github.com/Frost-Phoenix/nixos-config/tree/catppuccin)
![desktop-neofetch](./assets/screens/desktop-neofetch.png)
![busy-desktop](./assets/screens/desktop-busy.png)
Screenshots up to date as of [this commit](https://github.com/pagedMov/nixos-config/commit/0bb0b6ce81a4b214158b5fb4bb0da7105f8d9a17)
Screenshots up to date as of [this commit](https://github.com/pagedMov/nixos-config/commit/50decf03c9d1a7792d5ea0056eb51f6a400654f0)
## Programs

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

View File

@@ -23,9 +23,23 @@ pkgs.writeShellApplication {
results=$(echo "$results" | cut -d'/' -f4-)
results=$(echo "$results" | grep "$1")
echo "$results" | tr ' ' '\n' | fzf | xargs -I {} nvim "$results_prefix"/{}
file=$(echo "$results" | tr ' ' '\n' | fzf)
file="$results_prefix/$file"
# Check if the file contains any non-UTF-8 characters
if grep --color='auto' -P -q "[^\x00-\x7F]" "$file"; then
NIXD_FLAGS="--semantic-tokens=false" nvim "$results_prefix"/"$file"
else
nvim "$file"
fi
else
nvim "$results"
# Check if the file contains any non-UTF-8 characters
if grep --color='auto' -P -q "[^\x00-\x7F]" "$results"; then
NIXD_FLAGS="--semantic-tokens=false" nvim "$results"
else
nvim "$results"
fi
fi
'';
}