Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,15 @@ suites:
- path: test/integration/default
controls:
- nvim.vimplug.sensible
- name: clipboard
provisioner:
state_top:
base:
'*':
- nvim._mapdata
- nvim.clipboard
verifier:
inspec_tests:
- path: test/integration/default
controls:
- nvim.clipboard
21 changes: 21 additions & 0 deletions nvim/clipboard.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as nvim with context %}
{% set vimplug_install = nvim | traverse("vimplug", False) %}
{% set clipboard = nvim | traverse("clipboard", {}) %}
{% set win32yank_version = "0.0.4" %}
{% set win32yank_suffix = "x64" %}
{% set win32yank_sourcehash = "33a747a92da60fb65e668edbf7661d3d902411a2d545fe9dc08623cecd142a20" %}

{% if clipboard.win32yank is defined %}
win32yank_downloaded:
archive.extracted:
- name: {{ nvim.clipboard.win32yank.path }}
- enforce_toplevel: False
- trim_output: 0
- source: https://github.com/equalsraf/win32yank/releases/download/v{{ win32yank_version }}/win32yank-{{ win32yank_suffix }}.zip
- source_hash: {{ win32yank_sourcehash }}
{% endif %}
12 changes: 12 additions & 0 deletions nvim/parameters/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
#
# Set default values.
---
{% set kernelrelease = salt.grains.get("kernelrelease", None) %}
{% if kernelrelease.find("WSL") != -1 %}
{% set clipboard_type = "win32yank" %}
{% endif %}
values:
{% if clipboard_type is defined %}
kernelrelease: {{ kernelrelease }}
clipboard:
{{ clipboard_type }}:
{% if clipboard_type == "win32yank" %}
path: /opt/nvim/current/bin/
{% endif %}
{% endif %}
install:
source: github
pkg:
Expand Down
11 changes: 11 additions & 0 deletions test/integration/default/controls/clipboard.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

control 'nvim.clipboard' do
title 'Check clipboard is configured'
only_if('on WSL') do
file('/proc/version').content =~ /WSL/
end
describe file('/opt/nvim/current/bin/win32yank.exe') do
it { should exist }
end
end