From 399b25a9d6afbc41509c892f812482a0184e6639 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 9 May 2019 13:52:24 +1200 Subject: Switch to two-spacing --- README.md | 4 ++-- doc/digraph_search.txt | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e690c91..678059a 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@ digraph\_search.vim This plugin provides an insert mode mapping target to search for digraphs by searching for a substring of the character's official name, per `:help -digraph-table` and `:help digraph-table-multibyte`. This is for situations +digraph-table` and `:help digraph-table-multibyte`. This is for situations where you might be able to remember part of the official name for a character, but you can't remember the digraph pieces. License ------- -Copyright (c) [Tom Ryder][1]. Distributed under the same terms as Vim itself. +Copyright (c) [Tom Ryder][1]. Distributed under the same terms as Vim itself. See `:help license`. [1]: https://sanctum.geek.nz/ diff --git a/doc/digraph_search.txt b/doc/digraph_search.txt index da25b2c..c94eb05 100644 --- a/doc/digraph_search.txt +++ b/doc/digraph_search.txt @@ -4,20 +4,20 @@ DESCRIPTION *digraph_search* This plugin provides an insert mode mapping target to search for |digraphs| by searching for a substring of the character's official name, per -|digraph-table| and |digraph-table-multibyte|. This is for situations where +|digraph-table| and |digraph-table-multibyte|. This is for situations where you might be able to remember part of the official name for a character, but you can't remember the digraph pieces. REQUIREMENTS *digraph_search-requirements* -This plugin only loads if 'compatible' is not set. It requires the |+digraphs| -feature, of course. +This plugin only loads if 'compatible' is not set. It requires the +|+digraphs| feature, of course. MAPPINGS *digraph_search-mappings* *(DigraphSearch)* -The single insert mode mapping target is |(DigraphSearch)|. There is no -default key mapping; you should define one yourself in your |vimrc|. For +The single insert mode mapping target is |(DigraphSearch)|. There is no +default key mapping; you should define one yourself in your |vimrc|. For example: > imap (DigraphSearch) -- cgit v1.2.3 From 8b957b771d319192a7789dfa93159afee385e4d4 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 9 May 2019 15:32:55 +1200 Subject: Remove unneeded variable scoping --- autoload/digraph_search.vim | 44 ++++++++++++++++++++++---------------------- plugin/digraph_search.vim | 4 ++-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/autoload/digraph_search.vim b/autoload/digraph_search.vim index 172b17c..46b10a3 100644 --- a/autoload/digraph_search.vim +++ b/autoload/digraph_search.vim @@ -2,27 +2,27 @@ function! digraph_search#Search() abort " Get the search string - let l:search = input('Digraph search: ') - if !strlen(l:search) + let search = input('Digraph search: ') + if !strlen(search) return endif " Look for the uppercased search in the table - let l:results = [] - for l:digraph in digraph_search#Digraphs() - if stridx(l:digraph['name'], toupper(l:search)) != -1 - call add(l:results, l:digraph) + let results = [] + for digraph in digraph_search#Digraphs() + if stridx(digraph['name'], toupper(search)) != -1 + call add(results, digraph) endif endfor " Print results, or if there weren't any, say so redraw - echo 'Digraphs matching '.toupper(l:search).':' - if len(l:results) - for l:result in l:results - echo l:result['char'] - \.' '.l:result['keys'] - \.' '.l:result['name'] + echo 'Digraphs matching '.toupper(search).':' + if len(results) + for result in results + echo result['char'] + \.' '.result['keys'] + \.' '.result['name'] endfor else echo 'None!' @@ -36,19 +36,19 @@ function! digraph_search#Digraphs() abort " We haven't been called yet; get the digraph list if !exists('s:digraphs') let s:digraphs = [] - let l:table = 0 - for l:line in readfile($VIMRUNTIME.'/doc/digraph.txt') + let table = 0 + for line in readfile($VIMRUNTIME.'/doc/digraph.txt') " Flag whether we're in one of the digraph tables; look for the heading - let l:table = l:table && strlen(l:line) - \ || l:line =~# '\C\*digraph-table\%(-mbyte\)\=\*$' + let table = table && strlen(line) + \ || line =~# '\C\*digraph-table\%(-mbyte\)\=\*$' " Skip to next line if not in a table - if !l:table + if !table continue endif " Check whether this row matches a parseable digraph row - let l:match = matchlist(l:line, + let match = matchlist(line, \ '^\(\S\)\+\s\+' \ . '\(\S\S\)\s\+' \ . '\%(0x\)\=\x\+\s\+' @@ -56,15 +56,15 @@ function! digraph_search#Digraphs() abort \ . '\(.\+\)' \ ) " Skip to next line if not a table row match - if !len(l:match) + if !len(match) continue endif " Add to the digraphs list; key is digraph, value is full name call add(s:digraphs, { - \ 'char': l:match[1], - \ 'keys': l:match[2], - \ 'name': l:match[3], + \ 'char': match[1], + \ 'keys': match[2], + \ 'name': match[3], \ }) endfor endif diff --git a/plugin/digraph_search.vim b/plugin/digraph_search.vim index 1d58d42..1923eb2 100644 --- a/plugin/digraph_search.vim +++ b/plugin/digraph_search.vim @@ -5,13 +5,13 @@ " Author: Tom Ryder " License: Same as Vim itself " -if exists('g:loaded_digraph_search') || &compatible +if exists('loaded_digraph_search') || &compatible finish endif if !has('digraphs') || v:version < 700 finish endif -let g:loaded_digraph_search = 1 +let loaded_digraph_search = 1 " Set up mapping inoremap -- cgit v1.2.3 From d491634075ffaf51c3f424f858d414dfc37f0beb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 9 May 2019 15:42:19 +1200 Subject: Bump VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index d917d3e..0ea3a94 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.2 +0.2.0 -- cgit v1.2.3