diff options
Diffstat (limited to 'runtime/autoload')
-rw-r--r-- | runtime/autoload/ccomplete.vim | 38 | ||||
-rw-r--r-- | runtime/autoload/clojurecomplete.vim | 17 | ||||
-rw-r--r-- | runtime/autoload/decada.vim | 2 | ||||
-rw-r--r-- | runtime/autoload/dist/ft.vim | 6 | ||||
-rw-r--r-- | runtime/autoload/htmlcomplete.vim | 5 | ||||
-rw-r--r-- | runtime/autoload/man.vim | 4 | ||||
-rw-r--r-- | runtime/autoload/netrw.vim | 126 | ||||
-rw-r--r-- | runtime/autoload/netrwFileHandlers.vim | 6 | ||||
-rw-r--r-- | runtime/autoload/python3complete.vim | 7 | ||||
-rw-r--r-- | runtime/autoload/pythoncomplete.vim | 7 | ||||
-rw-r--r-- | runtime/autoload/rubycomplete.vim | 59 | ||||
-rw-r--r-- | runtime/autoload/syntaxcomplete.vim | 153 | ||||
-rw-r--r-- | runtime/autoload/tohtml.vim | 112 | ||||
-rw-r--r-- | runtime/autoload/zip.vim | 29 |
14 files changed, 354 insertions, 217 deletions
diff --git a/runtime/autoload/ccomplete.vim b/runtime/autoload/ccomplete.vim index 156b3af025..95a20e16b0 100644 --- a/runtime/autoload/ccomplete.vim +++ b/runtime/autoload/ccomplete.vim @@ -1,13 +1,13 @@ " Vim completion script " Language: C " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2018 Aug 20 +" Last Change: 2020 Nov 14 let s:cpo_save = &cpo set cpo&vim " This function is used for the 'omnifunc' option. -function! ccomplete#Complete(findstart, base) +func ccomplete#Complete(findstart, base) if a:findstart " Locate the start of the item, including ".", "->" and "[...]". let line = getline('.') @@ -244,7 +244,7 @@ function! ccomplete#Complete(findstart, base) return map(res, 's:Tagline2item(v:val, brackets)') endfunc -function! s:GetAddition(line, match, memarg, bracket) +func s:GetAddition(line, match, memarg, bracket) " Guess if the item is an array. if a:bracket && match(a:line, a:match . '\s*\[') > 0 return '[' @@ -260,13 +260,13 @@ function! s:GetAddition(line, match, memarg, bracket) endif endif return '' -endfunction +endfunc " Turn the tag info "val" into an item for completion. " "val" is is an item in the list returned by taglist(). " If it is a variable we may add "." or "->". Don't do it for other types, " such as a typedef, by not including the info that s:GetAddition() uses. -function! s:Tag2item(val) +func s:Tag2item(val) let res = {'match': a:val['name']} let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename']) @@ -289,10 +289,10 @@ function! s:Tag2item(val) endif return res -endfunction +endfunc " Use all the items in dictionary for the "info" entry. -function! s:Dict2info(dict) +func s:Dict2info(dict) let info = '' for k in sort(keys(a:dict)) let info .= k . repeat(' ', 10 - len(k)) @@ -307,7 +307,7 @@ function! s:Dict2info(dict) endfunc " Parse a tag line and return a dictionary with items like taglist() -function! s:ParseTagline(line) +func s:ParseTagline(line) let l = split(a:line, "\t") let d = {} if len(l) >= 3 @@ -334,12 +334,12 @@ function! s:ParseTagline(line) endif return d -endfunction +endfunc " Turn a match item "val" into an item for completion. " "val['match']" is the matching item. " "val['tagline']" is the tagline in which the last part was found. -function! s:Tagline2item(val, brackets) +func s:Tagline2item(val, brackets) let line = a:val['tagline'] let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '') let res = {'word': a:val['match'] . a:brackets . add } @@ -377,10 +377,10 @@ function! s:Tagline2item(val, brackets) let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t')) endif return res -endfunction +endfunc " Turn a command from a tag line to something that is useful in the menu -function! s:Tagcmd2extra(cmd, name, fname) +func s:Tagcmd2extra(cmd, name, fname) if a:cmd =~ '^/^' " The command is a search command, useful to see what it is. let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/') @@ -395,13 +395,13 @@ function! s:Tagcmd2extra(cmd, name, fname) let x = a:cmd . ' - ' . a:fname endif return x -endfunction +endfunc " Find composing type in "lead" and match items[0] with it. " Repeat this recursively for items[1], if it's there. " When resolving typedefs "depth" is used to avoid infinite recursion. " Return the list of matches. -function! s:Nextitem(lead, items, depth, all) +func s:Nextitem(lead, items, depth, all) " Use the text up to the variable name and split it in tokens. let tokens = split(a:lead, '\s\+\|\<') @@ -485,7 +485,7 @@ function! s:Nextitem(lead, items, depth, all) endfor return res -endfunction +endfunc " Search for members of structure "typename" in tags files. @@ -493,7 +493,7 @@ endfunction " Each match is a dictionary with "match" and "tagline" entries. " When "all" is non-zero find all, otherwise just return 1 if there is any " member. -function! s:StructMembers(typename, items, all) +func s:StructMembers(typename, items, all) " Todo: What about local structures? let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")')) if fnames == '' @@ -586,12 +586,12 @@ function! s:StructMembers(typename, items, all) " Failed to find anything. return [] -endfunction +endfunc " For matching members, find matches for following items. " When "all" is non-zero find all, otherwise just return 1 if there is any " member. -function! s:SearchMembers(matches, items, all) +func s:SearchMembers(matches, items, all) let res = [] for i in range(len(a:matches)) let typename = '' @@ -635,3 +635,5 @@ endfunc let &cpo = s:cpo_save unlet s:cpo_save + +" vim: noet sw=2 sts=2 diff --git a/runtime/autoload/clojurecomplete.vim b/runtime/autoload/clojurecomplete.vim index 030785e901..2c0f0eacd4 100644 --- a/runtime/autoload/clojurecomplete.vim +++ b/runtime/autoload/clojurecomplete.vim @@ -1,14 +1,15 @@ " Vim completion script -" Language: Clojure -" Maintainer: Sung Pae <self@sungpae.com> -" URL: https://github.com/guns/vim-clojure-static -" License: Same as Vim -" Last Change: 18 July 2016 +" Language: Clojure +" Maintainer: Alex Vear <av@axvr.io> +" Former Maintainers: Sung Pae <self@sungpae.com> +" URL: https://github.com/clojure-vim/clojure.vim +" License: Vim (see :h license) +" Last Change: 2021-02-13 " -*- COMPLETION WORDS -*- -" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-011/clj/src/vim_clojure_static/generate.clj -" Clojure version 1.8.0 -let s:words = ["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-readably*","*read-eval*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc!","assoc","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","booleans","bound-fn","bound-fn*","bound?","butlast","byte","byte-array","bytes","case","cast","cat","catch","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj!","conj","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","def","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj!","disj","dissoc!","dissoc","distinct","distinct?","do","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","finally","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","identical?","identity","if","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","init-proxy","instance?","int","int-array","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","neg?","new","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop!","pop","pop-thread-bindings","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","quot","quote","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","recur","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seque","sequence","sequential?","set!","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","try","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","use","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"] +" Generated from https://github.com/clojure-vim/clojure.vim/blob/f8594e7030cdfb0b7990ac92953c77a08a7220f0/clj/src/vim_clojure_static/generate.clj +" Clojure version 1.10.2 +let s:words = ["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","PrintWriter-on","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-tap","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc!","assoc","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","case-fallthrough-err-impl","cast","cat","catch","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj!","conj","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","def","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj!","disj","dissoc!","dissoc","distinct","distinct?","do","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-cause","ex-data","ex-info","ex-message","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","finally","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","new","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop!","pop","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","quote","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read+string","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","recur","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-tap","remove-watch","repeat","repeatedly","replace","replicate","require","requiring-resolve","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set!","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","tap>","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","try","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"] " Simple word completion for special forms and public vars in clojure.core function! clojurecomplete#Complete(findstart, base) diff --git a/runtime/autoload/decada.vim b/runtime/autoload/decada.vim index 7741ff0572..5124429a75 100644 --- a/runtime/autoload/decada.vim +++ b/runtime/autoload/decada.vim @@ -25,7 +25,7 @@ function decada#Unit_Name () dict " {{{1 " Convert filename into acs unit: " 1: remove the file extenstion. " 2: replace all double '_' or '-' with an dot (which denotes a separate) - " 3: remove a trailing '_' (wich denotes a specification) + " 3: remove a trailing '_' (which denotes a specification) return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '') endfunction decada#Unit_Name " }}}1 diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index cf26bc3172..1ac74b5785 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -1,7 +1,7 @@ " Vim functions for file type detection " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2019 Mar 08 +" Last Change: 2020 Aug 17 " These functions are moved here from runtime/filetype.vim to make startup " faster. @@ -298,7 +298,7 @@ endfunc func dist#ft#FTmms() let n = 1 - while n < 10 + while n < 20 let line = getline(n) if line =~ '^\s*\(%\|//\)' || line =~ '^\*' setf mmix @@ -325,7 +325,7 @@ endfunc func dist#ft#FTmm() let n = 1 - while n < 10 + while n < 20 let line = getline(n) if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)' setf objcpp diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim index 984ba8b58e..6b9d49a469 100644 --- a/runtime/autoload/htmlcomplete.vim +++ b/runtime/autoload/htmlcomplete.vim @@ -1,7 +1,7 @@ " Vim completion script " Language: HTML and XHTML " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2014 Jun 20 +" Last Change: 2019 Sep 27 " Distinguish between HTML versions. " To use with other HTML versions add another "elseif" condition to match @@ -245,7 +245,8 @@ function! htmlcomplete#CompleteTags(findstart, base) " If context contains white space it is attribute. " It can be also value of attribute. " We have to get first word to offer proper completions - if context == '' + if context =~ '^\s*$' + " empty or whitespace line let tag = '' else let tag = split(context)[0] diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index c629923cd3..4f556e6e87 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -252,11 +252,11 @@ function! s:verify_exists(sect, name) abort if !empty($MANSECT) try let MANSECT = $MANSECT - unset $MANSECT + call setenv('MANSECT', v:null) return s:get_path('', a:name) catch /^command error (/ finally - let $MANSECT = MANSECT + call setenv('MANSECT', MANSECT) endtry endif diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 7a799abb13..74ceab35d4 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across " AUTOLOAD SECTION -" Date: Jan 07, 2020 -" Version: 168 +" Date: Sep 18, 2020 +" Version: 170 " Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 @@ -43,7 +43,7 @@ if exists("s:needspatches") endfor endif -let g:loaded_netrw = "v168" +let g:loaded_netrw = "v170" if !exists("s:NOTE") let s:NOTE = 0 let s:WARNING = 1 @@ -86,7 +86,16 @@ fun! netrw#ErrorMsg(level,msg,errnum) endif " call Decho("level=".level,'~'.expand("<slnum>")) - if g:netrw_use_errorwindow + if g:netrw_use_errorwindow == 2 && (v:version > 802 || (v:version == 802 && has("patch486"))) + " use popup window + if type(a:msg) == 3 + let msg = [level]+a:msg + else + let msg= level.a:msg + endif + let s:popuperr_id = popup_beval(msg,{}) + let s:popuperr_text= "" + elseif g:netrw_use_errorwindow " (default) netrw creates a one-line window to show error/warning " messages (reliably displayed) @@ -203,7 +212,11 @@ let g:netrw_localrmdiropt = "" " --------------------------------------------------------------------- " Default values for netrw's global protocol variables {{{2 -call s:NetrwInit("g:netrw_use_errorwindow",1) +if (v:version > 802 || (v:version == 802 && has("patch486"))) && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") && has("mouse") + call s:NetrwInit("g:netrw_use_errorwindow",2) +else + call s:NetrwInit("g:netrw_use_errorwindow",1) +endif if !exists("g:netrw_dav_cmd") if executable("cadaver") @@ -559,6 +572,7 @@ call s:NetrwInit("s:netrw_posn",'{}') if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") " call Decho("installed beval events",'~'.expand("<slnum>")) let &l:bexpr = "netrw#BalloonHelp()" +" call Decho("&l:bexpr<".&l:bexpr."> buf#".bufnr()) au FileType netrw setl beval au WinLeave * if &ft == "netrw" && exists("s:initbeval")|let &beval= s:initbeval|endif au VimEnter * let s:initbeval= &beval @@ -591,7 +605,18 @@ if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_ if &ft != "netrw" return "" endif - if !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval) + if exists("s:popuperr_id") && popup_getpos(s:popuperr_id) != {} + " popup error window is still showing + " s:pouperr_id and s:popuperr_text are set up in netrw#ErrorMsg() + if exists("s:popuperr_text") && s:popuperr_text != "" && v:beval_text != s:popuperr_text + " text under mouse hasn't changed; only close window when it changes + call popup_close(s:popuperr_id) + unlet s:popuperr_text + else + let s:popuperr_text= v:beval_text + endif + let mesg= "" + elseif !exists("w:netrw_bannercnt") || v:beval_lnum >= w:netrw_bannercnt || (exists("g:netrw_nobeval") && g:netrw_nobeval) let mesg= "" elseif v:beval_text == "Netrw" || v:beval_text == "Directory" || v:beval_text == "Listing" let mesg = "i: thin-long-wide-tree gh: quick hide/unhide of dot-files qf: quick file info %:open new file" @@ -1212,6 +1237,10 @@ fun! netrw#Lexplore(count,rightside,...) setlocal winfixwidth let g:netrw_altv = keep_altv let t:netrw_lexbufnr = bufnr("%") + " done to prevent build-up of hidden buffers due to quitting and re-invocation of :Lexplore. + " Since the intended use of :Lexplore is to have an always-present explorer window, the extra + " effort to mis-use :Lex is warranted. + set bh=wipe " call Decho("let t:netrw_lexbufnr=".t:netrw_lexbufnr) " call Decho("t:netrw_lexposn".(exists("t:netrw_lexposn")? string(t:netrw_lexposn) : " n/a")) if exists("t:netrw_lexposn") @@ -1864,7 +1893,7 @@ fun! s:NetrwRestoreSetting(keepvar,setting) if type(a:setting) == 0 exe "let ".a:setting."= ".keepvarval elseif type(a:setting) == 1 - exe "let ".a:setting."= '".keepvarval."'" + exe "let ".a:setting."= '".substitute(keepvarval,"'","''","g")."'" else call netrw#ErrorMsg(s:ERROR,"(s:NetrwRestoreSetting) doesn't know how to restore ".a:keepvar." with a setting of type#".type(a:setting),105) endif @@ -3596,6 +3625,8 @@ fun! s:NetrwBookHistSave() let savefile= s:NetrwHome()."/.netrwhist" " call Decho("savefile<".savefile.">",'~'.expand("<slnum>")) 1split + + " setting up a new buffer which will become .netrwhist call s:NetrwEnew() " call Decho("case g:netrw_use_noswf=".g:netrw_use_noswf.(exists("+acd")? " +acd" : " -acd"),'~'.expand("<slnum>")) if g:netrw_use_noswf @@ -4678,7 +4709,7 @@ endfun " "new directory name" is actually a file, " NetrwBrowseChgDir() edits the file. fun! s:NetrwBrowseChgDir(islocal,newdir,...) -" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">") +" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." win#".winnr()." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">") " call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("<slnum>")) let ykeep= @@ @@ -4707,13 +4738,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) let newdir = a:newdir let dolockout = 0 let dorestore = 1 +" call Decho("win#".winnr(),'~'.expand("<slnum>")) " call Decho("dirname<".dirname.">",'~'.expand("<slnum>")) " call Decho("newdir<".newdir.">",'~'.expand("<slnum>")) " ignore <cr>s when done in the banner " call Decho('(s:NetrwBrowseChgDir) ignore [return]s when done in banner (g:netrw_banner='.g:netrw_banner.")",'~'.expand("<slnum>")) if g:netrw_banner -" call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("<slnum>")) +" call Decho("win#".winnr()." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("<slnum>")) if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt && line("$") >= w:netrw_bannercnt if getline(".") =~# 'Quick Help' " call Decho("#1: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>")) @@ -4750,7 +4782,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " ------------------------------ " NetrwBrowseChgDir: edit a file {{{3 " ------------------------------ -" call Decho('(s:NetrwBrowseChgDir) edit-a-file: case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("<slnum>")) +" call Decho('edit-a-file: case "handling a file": win#'.winnr().' newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("<slnum>")) " save position for benefit of Rexplore let s:rexposn_{bufnr("%")}= winsaveview() @@ -4785,7 +4817,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) NetrwKeepj call s:NetrwOptionsRestore("s:") let curdir= b:netrw_curdir if !exists("s:didsplit") -" call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr(),'~'.expand("<slnum>")) +" " call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr()." g:netrw_chgwin=".g:netrw_chgwin",'~'.expand("<slnum>")) if type(g:netrw_browse_split) == 3 " open file in server " Note that g:netrw_browse_split is a List: [servername,tabnr,winnr] @@ -4793,22 +4825,27 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) call s:NetrwServerEdit(a:islocal,dirname) " call Dret("s:NetrwBrowseChgDir") return + elseif g:netrw_browse_split == 1 " horizontally splitting the window first " call Decho("edit-a-file: horizontally splitting window prior to edit",'~'.expand("<slnum>")) - keepalt new + let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize + exe "keepalt ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s" if !&ea keepalt wincmd _ endif call s:SetRexDir(a:islocal,curdir) + elseif g:netrw_browse_split == 2 " vertically splitting the window first " call Decho("edit-a-file: vertically splitting window prior to edit",'~'.expand("<slnum>")) - keepalt rightb vert new + let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize + exe "keepalt ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s" if !&ea keepalt wincmd | endif call s:SetRexDir(a:islocal,curdir) + elseif g:netrw_browse_split == 3 " open file in new tab " call Decho("edit-a-file: opening new tab prior to edit",'~'.expand("<slnum>")) @@ -4817,6 +4854,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) let b:netrw_curdir= getcwd() endif call s:SetRexDir(a:islocal,curdir) + elseif g:netrw_browse_split == 4 " act like "P" (ie. open previous window) " call Decho("edit-a-file: use previous window for edit",'~'.expand("<slnum>")) @@ -4826,13 +4864,14 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) return endif call s:SetRexDir(a:islocal,curdir) + else " handling a file, didn't split, so remove menu " call Decho("edit-a-file: handling a file+didn't split, so remove menu",'~'.expand("<slnum>")) call s:NetrwMenu(0) " optional change to window if g:netrw_chgwin >= 1 -" call Decho("edit-a-file: changing window to #".g:netrw_chgwin,'~'.expand("<slnum>")) +" call Decho("edit-a-file: changing window to #".g:netrw_chgwin.": (due to g:netrw_chgwin)",'~'.expand("<slnum>")) if winnr("$")+1 == g:netrw_chgwin " if g:netrw_chgwin is set to one more than the last window, then " vertically split the last window to make that window available. @@ -4845,19 +4884,26 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) endif call s:SetRexDir(a:islocal,curdir) endif + endif " the point where netrw actually edits the (local) file " if its local only: LocalBrowseCheck() doesn't edit a file, but NetrwBrowse() will " no keepalt to support :e # to return to a directory listing + if !&mod + " if e the new file would fail due to &mod, then don't change any of the flags + let dolockout= 1 + endif if a:islocal " call Decho("edit-a-file: edit local file: exe e! ".fnameescape(dirname),'~'.expand("<slnum>")) " some like c-^ to return to the last edited file " others like c-^ to return to the netrw buffer + " Apr 30, 2020: used to have e! here. That can cause loss of a modified file, + " so emit error E37 instead. if exists("g:netrw_altfile") && g:netrw_altfile - exe "NetrwKeepj keepalt e! ".fnameescape(dirname) + exe "NetrwKeepj keepalt e ".fnameescape(dirname) else - exe "NetrwKeepj e! ".fnameescape(dirname) + exe "NetrwKeepj e ".fnameescape(dirname) endif " call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("<slnum>")) call s:NetrwCursor() @@ -4868,7 +4914,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) else " call Decho("edit-a-file: remote file: NetrwBrowse will edit it",'~'.expand("<slnum>")) endif - let dolockout= 1 " handle g:Netrw_funcref -- call external-to-netrw functions " This code will handle g:Netrw_funcref as an individual function reference @@ -5332,16 +5377,6 @@ fun! netrw#BrowseX(fname,remote) endif let ret= v:shell_error - elseif has("unix") && executable("kfmclient") && s:CheckIfKde() -" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("<slnum>")) - call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir) - let ret= v:shell_error - - elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid") -" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("<slnum>")) - call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir) - let ret= v:shell_error - elseif has("unix") && $DESKTOP_SESSION == "mate" && executable("atril") " call Decho("(netrw#BrowseX) unix and atril",'~'.expand("<slnum>")) if a:fname =~ '^https\=://' @@ -5356,9 +5391,19 @@ fun! netrw#BrowseX(fname,remote) endif let ret= v:shell_error + elseif has("unix") && executable("kfmclient") && s:CheckIfKde() +" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("<slnum>")) + call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir) + let ret= v:shell_error + + elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid") +" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("<slnum>")) + call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir.'&') + let ret= v:shell_error + elseif has("unix") && executable("xdg-open") " call Decho("(netrw#BrowseX) unix and xdg-open",'~'.expand("<slnum>")) - call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir) + call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir.'&') let ret= v:shell_error elseif has("macunix") && executable("open") @@ -6053,10 +6098,10 @@ fun! s:NetrwListHide() " Duplicate characters don't matter. " Remove all such characters from the '/~@#...890' string. " Use the first character left as a separator character. -" call Decho("find a character not in the hide string to use as a separator") +" call Decho("find a character not in the hide string to use as a separator",'~'.expand("<slnum>")) let listhide= g:netrw_list_hide let sep = strpart(substitute('~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1) -" call Decho("sep=".sep," (sep not in hide string)'~'.expand("<slnum>")) +" call Decho("sep<".sep."> (sep not in hide string)",'~'.expand("<slnum>")) while listhide != "" if listhide =~ ',' @@ -6066,7 +6111,7 @@ fun! s:NetrwListHide() let hide = listhide let listhide = "" endif -" call Decho("..extracted from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("<slnum>")) +" call Decho("..extracted pattern from listhide: hide<".hide."> g:netrw_sort_by<".g:netrw_sort_by.'>','~'.expand("<slnum>")) if g:netrw_sort_by =~ '^[ts]' if hide =~ '^\^' " call Decho("..modify hide to handle a \"^...\" pattern",'~'.expand("<slnum>")) @@ -6078,7 +6123,7 @@ fun! s:NetrwListHide() endif " Prune the list by hiding any files which match -" call Decho("..prune the list by hiding any files which ",((g:netrw_hide == 1)? "" : "don't")." match hide<".hide.">") +" call Decho("..prune the list by hiding any files which ".((g:netrw_hide == 1)? "" : "don't")."match hide<".hide.">") if g:netrw_hide == 1 " call Decho("..hiding<".hide.">",'~'.expand("<slnum>")) exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d' @@ -9161,6 +9206,7 @@ endfun " (full path directory with trailing slash returned) fun! s:NetrwTreeDir(islocal) " call Dfunc("s:NetrwTreeDir(islocal=".a:islocal.") getline(".line(".").")"."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft) +" call Decho("Determine tree directory given current cursor position") " call Decho("g:netrw_keepdir =".(exists("g:netrw_keepdir")? g:netrw_keepdir : 'n/a'),'~'.expand("<slnum>")) " call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("<slnum>")) " call Decho("w:netrw_treetop =".(exists("w:netrw_treetop")? w:netrw_treetop : 'n/a'),'~'.expand("<slnum>")) @@ -9266,7 +9312,6 @@ fun! s:NetrwTreeDisplay(dir,depth) call setline(line("$")+1,a:depth.shortdir.'/') endif " call Decho("setline#".line("$")." shortdir<".a:depth.shortdir.">",'~'.expand("<slnum>")) - " append a / to dir if its missing one let dir= a:dir @@ -9280,7 +9325,7 @@ fun! s:NetrwTreeDisplay(dir,depth) let listhide= split(g:netrw_list_hide,',') " call Decho("listhide=".string(listhide)) for pat in listhide - call filter(w:netrw_treedict[dir],'v:val !~ "'.pat.'"') + call filter(w:netrw_treedict[dir],'v:val !~ "'.escape(pat,'\\').'"') endfor elseif g:netrw_hide == 2 @@ -9418,6 +9463,7 @@ fun! s:NetrwTreeListing(dirname) " call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>")) " display from treetop on down +" call Decho("(s:NetrwTreeListing) w:netrw_treetop<".w:netrw_treetop.">") NetrwKeepj call s:NetrwTreeDisplay(w:netrw_treetop,"") " call Decho("s:NetrwTreeDisplay) setl noma nomod ro",'~'.expand("<slnum>")) @@ -9678,7 +9724,7 @@ fun! s:PerformListing(islocal) " Hiding... -or- Showing... {{{3 if g:netrw_banner -" call Decho("--handle hiding/showing (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("<slnum>")) +" call Decho("--handle hiding/showing in banner (g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">)",'~'.expand("<slnum>")) if g:netrw_list_hide != "" && g:netrw_hide if g:netrw_hide == 1 NetrwKeepj put ='\" Hiding: '.g:netrw_list_hide @@ -9731,7 +9777,7 @@ fun! s:PerformListing(islocal) " call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>")) if !g:netrw_banner || line("$") >= w:netrw_bannercnt -" call Decho("manipulate directory listing (hide)",'~'.expand("<slnum>")) +" call Decho("manipulate directory listing (support hide)",'~'.expand("<slnum>")) " call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("<slnum>")) if g:netrw_hide && g:netrw_list_hide != "" NetrwKeepj call s:NetrwListHide() @@ -11744,7 +11790,7 @@ endfun " --------------------------------------------------------------------- " s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2 fun! s:NetrwEnew(...) -" call Dfunc("s:NetrwEnew() a:0=".a:0." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">") +" call Dfunc("s:NetrwEnew() a:0=".a:0." win#".winnr()." winnr($)=".winnr("$")." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">") " call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>")) " grab a function-local-variable copy of buffer variables @@ -11811,6 +11857,9 @@ fun! s:NetrwEnew(...) endif endif endif + if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists("g:netrw_nobeval") && has("syntax") && exists("g:syntax_on") + let &l:bexpr = "netrw#BalloonHelp()" + endif " call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%")."> expand(%)<".expand("%")."> expand(#)<".expand("#")."> bh=".&bh." win#".winnr()." winnr($)#".winnr("$")) endfun @@ -11870,6 +11919,7 @@ endfun " -1=failed fun! s:NetrwLcd(newdir) " call Dfunc("s:NetrwLcd(newdir<".a:newdir.">)") +" call Decho("changing local directory",'~'.expand("<slnum>")) let err472= 0 try @@ -11905,6 +11955,8 @@ fun! s:NetrwLcd(newdir) return -1 endif +" call Decho("getcwd <".getcwd().">") +" call Decho("b:netrw_curdir<".b:netrw_curdir.">") " call Dret("s:NetrwLcd 0") return 0 endfun diff --git a/runtime/autoload/netrwFileHandlers.vim b/runtime/autoload/netrwFileHandlers.vim index ed31e29a66..d07235c107 100644 --- a/runtime/autoload/netrwFileHandlers.vim +++ b/runtime/autoload/netrwFileHandlers.vim @@ -1,8 +1,8 @@ " netrwFileHandlers: contains various extension-based file handlers for " netrw's browsers' x command ("eXecute launcher") " Author: Charles E. Campbell -" Date: May 03, 2013 -" Version: 11b ASTRO-ONLY +" Date: Sep 18, 2020 +" Version: 11 " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright @@ -20,7 +20,7 @@ if exists("g:loaded_netrwFileHandlers") || &cp finish endif -let g:loaded_netrwFileHandlers= "v11b" +let g:loaded_netrwFileHandlers= "v11" if v:version < 702 echohl WarningMsg echo "***warning*** this version of netrwFileHandlers needs vim 7.2" diff --git a/runtime/autoload/python3complete.vim b/runtime/autoload/python3complete.vim index a3b057d4d0..1d7f5d18f5 100644 --- a/runtime/autoload/python3complete.vim +++ b/runtime/autoload/python3complete.vim @@ -1,7 +1,8 @@ "python3complete.vim - Omni Completion for python -" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com> +" Maintainer: <vacancy> +" Previous Maintainer: Aaron Griffin <aaronmgriffin@gmail.com> " Version: 0.9 -" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian) +" Last Updated: 2020 Oct 9 " " Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim " @@ -83,7 +84,7 @@ function! python3complete#Complete(findstart, base) break endif endwhile - execute "py3 vimpy3complete('" . cword . "', '" . a:base . "')" + execute "py3 vimpy3complete('" . escape(cword, "'") . "', '" . escape(a:base, "'") . "')" return g:python3complete_completions endif endfunction diff --git a/runtime/autoload/pythoncomplete.vim b/runtime/autoload/pythoncomplete.vim index 9cc0ae0d79..575c23e6d3 100644 --- a/runtime/autoload/pythoncomplete.vim +++ b/runtime/autoload/pythoncomplete.vim @@ -1,7 +1,8 @@ "pythoncomplete.vim - Omni Completion for python -" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com> +" Maintainer: <vacancy> +" Previous Maintainer: Aaron Griffin <aaronmgriffin@gmail.com> " Version: 0.9 -" Last Updated: 18 Jun 2009 +" Last Updated: 2020 Oct 9 " " Changes " TODO: @@ -81,7 +82,7 @@ function! pythoncomplete#Complete(findstart, base) break endif endwhile - execute "python vimcomplete('" . cword . "', '" . a:base . "')" + execute "python vimcomplete('" . escape(cword, "'") . "', '" . escape(a:base, "'") . "')" return g:pythoncomplete_completions endif endfunction diff --git a/runtime/autoload/rubycomplete.vim b/runtime/autoload/rubycomplete.vim index ea18470232..e8a1879668 100644 --- a/runtime/autoload/rubycomplete.vim +++ b/runtime/autoload/rubycomplete.vim @@ -3,7 +3,7 @@ " Maintainer: Mark Guzman <segfault@hasno.info> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2019 Jan 06 +" Last Change: 2019 Feb 25 " ---------------------------------------------------------------------------- " " Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com) @@ -53,6 +53,23 @@ if !exists("g:rubycomplete_include_objectspace") endif " }}} configuration failsafe initialization +" {{{ regex patterns + +" Regex that defines the start-match for the 'end' keyword. +let s:end_start_regex = + \ '\C\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' . + \ '\<\%(module\|class\|if\|for\|while\|until\|case\|unless\|begin' . + \ '\|\%(\K\k*[!?]\?\s\+\)\=def\):\@!\>' . + \ '\|\%(^\|[^.:@$]\)\@<=\<do:\@!\>' + +" Regex that defines the middle-match for the 'end' keyword. +let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue:\@!\>\|when\|elsif\):\@!\>' + +" Regex that defines the end-match for the 'end' keyword. +let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end:\@!\>' + +" }}} regex patterns + " {{{ vim-side support functions let s:rubycomplete_debug = 0 @@ -103,7 +120,7 @@ function! s:GetBufferRubyEntity( name, type, ... ) endif let curpos = getpos(".") - let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'W' ) + let [enum,ecol] = searchpairpos( s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'W' ) call cursor(lastpos[1], lastpos[2]) if lnum > enum @@ -128,19 +145,28 @@ function! s:IsPosInClassDef(pos) return ret endfunction +function! s:IsInComment(pos) + let stack = synstack(a:pos[0], a:pos[1]) + if !empty(stack) + return synIDattr(stack[0], 'name') =~ 'ruby\%(.*Comment\|Documentation\)' + else + return 0 + endif +endfunction + function! s:GetRubyVarType(v) let stopline = 1 let vtp = '' - let pos = getpos('.') + let curpos = getpos('.') let sstr = '^\s*#\s*@var\s*'.escape(a:v, '*').'\>\s\+[^ \t]\+\s*$' let [lnum,lcol] = searchpos(sstr,'nb',stopline) if lnum != 0 && lcol != 0 - call setpos('.',pos) + call setpos('.',curpos) let str = getline(lnum) let vtp = substitute(str,sstr,'\1','') return vtp endif - call setpos('.',pos) + call setpos('.',curpos) let ctors = '\(now\|new\|open\|get_instance' if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1 let ctors = ctors.'\|find\|create' @@ -150,9 +176,13 @@ function! s:GetRubyVarType(v) let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)' let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr - let [lnum,lcol] = searchpos(sstr,'nb',stopline) - if lnum != 0 && lcol != 0 - let str = matchstr(getline(lnum),fstr,lcol) + let pos = searchpos(sstr,'bW') + while pos != [0,0] && s:IsInComment(pos) + let pos = searchpos(sstr,'bW') + endwhile + if pos != [0,0] + let [lnum, col] = pos + let str = matchstr(getline(lnum),fstr,col) let str = substitute(str,'^=\s*','','') call setpos('.',pos) @@ -174,7 +204,7 @@ function! s:GetRubyVarType(v) end return '' endif - call setpos('.',pos) + call setpos('.',curpos) return '' endfunction @@ -671,11 +701,10 @@ class VimRubyCompletion methods.delete_if { |c| c.match( /'/ ) } end - when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods + when /^::([A-Z][^:\.\(]*)?$/ # Absolute Constant or class methods dprint "const or cls" receiver = $1 - methods = Object.constants - methods.grep(/^#{receiver}/).collect{|e| "::" + e} + methods = Object.constants.collect{ |c| c.to_s }.grep(/^#{receiver}/) when /^(((::)?[A-Z][^:.\(]*)+?)::?([^:.]*)$/ # Constant or class methods receiver = $1 @@ -684,13 +713,13 @@ class VimRubyCompletion load_buffer_class( receiver ) load_buffer_module( receiver ) begin - classes = eval("#{receiver}.constants") - #methods = eval("#{receiver}.methods") + constants = eval("#{receiver}.constants").collect{ |c| c.to_s }.grep(/^#{message}/) + methods = eval("#{receiver}.methods").collect{ |m| m.to_s }.grep(/^#{message}/) rescue Exception dprint "exception: %s" % $! + constants = [] methods = [] end - methods.grep(/^#{message}/).collect{|e| receiver + "::" + e} when /^(:[^:.]+)\.([^.]*)$/ # Symbol dprint "symbol" diff --git a/runtime/autoload/syntaxcomplete.vim b/runtime/autoload/syntaxcomplete.vim index ea72204cbb..396193d8b0 100644 --- a/runtime/autoload/syntaxcomplete.vim +++ b/runtime/autoload/syntaxcomplete.vim @@ -1,12 +1,20 @@ " Vim completion script " Language: All languages, uses existing syntax highlighting rules " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> -" Version: 13.0 -" Last Change: 2019 Aug 08 +" Version: 15.0 +" Last Change: 2021 Apr 27 " Usage: For detailed help, ":help ft-syntax-omni" " History " +" Version 15.0 +" - SyntaxComplete ignored all buffer specific overrides, always used global +" https://github.com/vim/vim/issues/8153 +" +" Version 14.0 +" - Fixed issue with single quotes and is_keyword +" https://github.com/vim/vim/issues/7463 +" " Version 13.0 " - Extended the option omni_syntax_group_include_{filetype} " to accept a comma separated list of regex's rather than @@ -38,7 +46,7 @@ " let g:omni_syntax_use_single_byte = 1 " - This by default will only allow single byte ASCII " characters to be added and an additional check to ensure -" the charater is printable (see documentation for isprint). +" the character is printable (see documentation for isprint). " " Version 9.0 " - Add the check for cpo. @@ -86,7 +94,7 @@ endif if exists('g:loaded_syntax_completion') finish endif -let g:loaded_syntax_completion = 130 +let g:loaded_syntax_completion = 150 " Turn on support for line continuations when creating the script let s:cpo_save = &cpo @@ -141,14 +149,10 @@ let s:prepended = '' " This function is used for the 'omnifunc' option. function! syntaxcomplete#Complete(findstart, base) - " Only display items in the completion window that are at least - " this many characters in length - if !exists('b:omni_syntax_ignorecase') - if exists('g:omni_syntax_ignorecase') - let b:omni_syntax_ignorecase = g:omni_syntax_ignorecase - else - let b:omni_syntax_ignorecase = &ignorecase - endif + " Allow user to override ignorecase per buffer + let l:omni_syntax_ignorecase = g:omni_syntax_ignorecase + if exists('b:omni_syntax_ignorecase') + let l:omni_syntax_ignorecase = b:omni_syntax_ignorecase endif if a:findstart @@ -179,7 +183,7 @@ function! syntaxcomplete#Complete(findstart, base) endif " let base = s:prepended . a:base - let base = s:prepended + let base = substitute(s:prepended, "'", "''", 'g') let filetype = substitute(&filetype, '\.', '_', 'g') let list_idx = index(s:cache_name, filetype, 0, &ignorecase) @@ -195,13 +199,13 @@ function! syntaxcomplete#Complete(findstart, base) if base != '' " let compstr = join(compl_list, ' ') - " let expr = (b:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*' + " let expr = (l:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*' " let compstr = substitute(compstr, expr, '', 'g') " let compl_list = split(compstr, '\s\+') " Filter the list based on the first few characters the user " entered - let expr = 'v:val '.(g:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'" + let expr = 'v:val '.(l:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'" let compl_list = filter(deepcopy(compl_list), expr) endif @@ -222,6 +226,26 @@ function! syntaxcomplete#OmniSyntaxList(...) endif endfunc +function! syntaxcomplete#OmniSyntaxClearCache() + let s:cache_name = [] + let s:cache_list = [] +endfunction + +" To retrieve all syntax items regardless of syntax group: +" echo OmniSyntaxList( [] ) +" +" To retrieve only the syntax items for the sqlOperator syntax group: +" echo OmniSyntaxList( ['sqlOperator'] ) +" +" To retrieve all syntax items for both the sqlOperator and sqlType groups: +" echo OmniSyntaxList( ['sqlOperator', 'sqlType'] ) +" +" A regular expression can also be used: +" echo OmniSyntaxList( ['sql\w\+'] ) +" +" From within a plugin, you would typically assign the output to a List: > +" let myKeywords = [] +" let myKeywords = OmniSyntaxList( ['sqlKeyword'] ) function! OmniSyntaxList(...) let list_parms = [] if a:0 > 0 @@ -239,37 +263,25 @@ function! OmniSyntaxList(...) " let use_dictionary = a:1 " endif - " Only display items in the completion window that are at least - " this many characters in length - if !exists('b:omni_syntax_use_iskeyword') - if exists('g:omni_syntax_use_iskeyword') - let b:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword - else - let b:omni_syntax_use_iskeyword = 1 - endif - endif - - " Only display items in the completion window that are at least - " this many characters in length - if !exists('b:omni_syntax_minimum_length') - if exists('g:omni_syntax_minimum_length') - let b:omni_syntax_minimum_length = g:omni_syntax_minimum_length - else - let b:omni_syntax_minimum_length = 0 - endif - endif - let saveL = @l let filetype = substitute(&filetype, '\.', '_', 'g') if empty(list_parms) + " Allow user to override per buffer + if exists('g:omni_syntax_group_include_'.filetype) + let l:omni_syntax_group_include_{filetype} = g:omni_syntax_group_include_{filetype} + endif + if exists('b:omni_syntax_group_include_'.filetype) + let l:omni_syntax_group_include_{filetype} = b:omni_syntax_group_include_{filetype} + endif + " Default the include group to include the requested syntax group let syntax_group_include_{filetype} = '' " Check if there are any overrides specified for this filetype - if exists('g:omni_syntax_group_include_'.filetype) + if exists('l:omni_syntax_group_include_'.filetype) let syntax_group_include_{filetype} = - \ substitute( g:omni_syntax_group_include_{filetype},'\s\+','','g') - let list_parms = split(g:omni_syntax_group_include_{filetype}, ',') + \ substitute( l:omni_syntax_group_include_{filetype},'\s\+','','g') + let list_parms = split(l:omni_syntax_group_include_{filetype}, ',') if syntax_group_include_{filetype} =~ '\w' let syntax_group_include_{filetype} = \ substitute( syntax_group_include_{filetype}, @@ -324,11 +336,20 @@ function! OmniSyntaxList(...) else " Default the exclude group to nothing let syntax_group_exclude_{filetype} = '' - " Check if there are any overrides specified for this filetype + + " Allow user to override per buffer if exists('g:omni_syntax_group_exclude_'.filetype) + let l:omni_syntax_group_exclude_{filetype} = g:omni_syntax_group_exclude_{filetype} + endif + if exists('b:omni_syntax_group_exclude_'.filetype) + let l:omni_syntax_group_exclude_{filetype} = b:omni_syntax_group_exclude_{filetype} + endif + + " Check if there are any overrides specified for this filetype + if exists('l:omni_syntax_group_exclude_'.filetype) let syntax_group_exclude_{filetype} = - \ substitute( g:omni_syntax_group_exclude_{filetype},'\s\+','','g') - let list_exclude_groups = split(g:omni_syntax_group_exclude_{filetype}, ',') + \ substitute( l:omni_syntax_group_exclude_{filetype},'\s\+','','g') + let list_exclude_groups = split(l:omni_syntax_group_exclude_{filetype}, ',') if syntax_group_exclude_{filetype} =~ '\w' let syntax_group_exclude_{filetype} = \ substitute( syntax_group_exclude_{filetype}, @@ -524,6 +545,30 @@ endfunction function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) + " Allow user to override iskeyword per buffer + let l:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword + if exists('b:omni_syntax_use_iskeyword') + let l:omni_syntax_use_iskeyword = b:omni_syntax_use_iskeyword + endif + + " Allow user to override iskeyword_numeric per buffer + let l:omni_syntax_use_iskeyword_numeric = g:omni_syntax_use_iskeyword_numeric + if exists('b:omni_syntax_use_iskeyword_numeric') + let l:omni_syntax_use_iskeyword_numeric = b:omni_syntax_use_iskeyword_numeric + endif + + " Allow user to override iskeyword_numeric per buffer + let l:omni_syntax_use_single_byte = g:omni_syntax_use_single_byte + if exists('b:omni_syntax_use_single_byte') + let l:omni_syntax_use_single_byte = b:omni_syntax_use_single_byte + endif + + " Allow user to override minimum_length per buffer + let l:omni_syntax_minimum_length = g:omni_syntax_minimum_length + if exists('b:omni_syntax_minimum_length') + let l:omni_syntax_minimum_length = b:omni_syntax_minimum_length + endif + let syn_list = "" " From the full syntax listing, strip out the portion for the @@ -642,14 +687,23 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) \ syn_list, '\%(^\|\n\)\@<=\s*\(@\w\+\)' \ , "", 'g' \ ) - - if b:omni_syntax_use_iskeyword == 0 + + if l:omni_syntax_use_iskeyword == 0 " There are a number of items which have non-word characters in " them, *'T_F1'*. vim.vim is one such file. " This will replace non-word characters with spaces. + " setlocal filetype=forth + " let g:omni_syntax_use_iskeyword = 1 + " let g:omni_syntax_use_iskeyword_numeric = 1 + " You will see entries like + " #>> + " (.local) + " These were found doing a grep in vim82\syntax + " grep iskeyword * + " forth.vim:setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' ) else - if g:omni_syntax_use_iskeyword_numeric == 1 + if l:omni_syntax_use_iskeyword_numeric == 1 " iskeyword can contain value like this " 38,42,43,45,47-58,60-62,64-90,97-122,_,+,-,*,/,%,<,=,>,:,$,?,!,@-@,94 " Numeric values convert to their ASCII equivalent using the @@ -669,7 +723,7 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) " cycle through each character within the range let [b:start, b:end] = split(item, '-') for range_item in range( b:start, b:end ) - if range_item <= 127 || g:omni_syntax_use_single_byte == 0 + if range_item <= 127 || l:omni_syntax_use_single_byte == 0 if nr2char(range_item) =~ '\p' let accepted_chars = accepted_chars . nr2char(range_item) endif @@ -677,13 +731,13 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) endfor elseif item =~ '^\d\+$' " Only numeric, translate to a character - if item < 127 || g:omni_syntax_use_single_byte == 0 + if item < 127 || l:omni_syntax_use_single_byte == 0 if nr2char(item) =~ '\p' let accepted_chars = accepted_chars . nr2char(item) endif endif else - if char2nr(item) < 127 || g:omni_syntax_use_single_byte == 0 + if char2nr(item) < 127 || l:omni_syntax_use_single_byte == 0 if item =~ '\p' let accepted_chars = accepted_chars . item endif @@ -719,9 +773,9 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) endif endif - if b:omni_syntax_minimum_length > 0 + if l:omni_syntax_minimum_length > 0 " If the user specified a minimum length, enforce it - let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.b:omni_syntax_minimum_length.'}\ze ', ' ', 'g') + let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.l:omni_syntax_minimum_length.'}\ze ', ' ', 'g') endif else let syn_list = '' @@ -751,5 +805,6 @@ function! OmniSyntaxShowChars(spec) endfor return join(map(result, 'nr2char(v:val)'), ', ') endfunction + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/autoload/tohtml.vim b/runtime/autoload/tohtml.vim index 9c3d4d2d7e..76092f0f93 100644 --- a/runtime/autoload/tohtml.vim +++ b/runtime/autoload/tohtml.vim @@ -1,6 +1,6 @@ " Vim autoload file for the tohtml plugin. " Maintainer: Ben Fritz <fritzophrenic@gmail.com> -" Last Change: 2018 Nov 11 +" Last Change: 2019 Aug 16 " " Additional contributors: " @@ -364,6 +364,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ let body_line = '' let html = [] + let s:html5 = 0 if s:settings.use_xhtml call add(html, xml_line) endif @@ -371,8 +372,9 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ call add(html, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">") call add(html, '<html xmlns="http://www.w3.org/1999/xhtml">') elseif s:settings.use_css && !s:settings.no_pre - call add(html, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">") + call add(html, "<!DOCTYPE html>") call add(html, '<html>') + let s:html5 = 1 else call add(html, '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"') call add(html, ' "http://www.w3.org/TR/html4/loose.dtd">') @@ -383,7 +385,11 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ " include encoding as close to the top as possible, but only if not already " contained in XML information if s:settings.encoding != "" && !s:settings.use_xhtml - call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close) + if s:html5 + call add(html, '<meta charset="' . s:settings.encoding . '"' . tag_close) + else + call add(html, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . tag_close) + endif endif call add(html, '<title>diff</title>') @@ -392,6 +398,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ call add(html, '<meta name="settings" content="'. \ join(filter(keys(s:settings),'s:settings[v:val]'),','). \ ',prevent_copy='.s:settings.prevent_copy. + \ ',use_input_for_pc='.s:settings.use_input_for_pc. \ '"'.tag_close) call add(html, '<meta name="colorscheme" content="'. \ (exists('g:colors_name') @@ -400,16 +407,8 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ call add(html, '</head>') let body_line_num = len(html) - if !empty(s:settings.prevent_copy) - call add(html, "<body onload='FixCharWidth();".(s:settings.line_ids ? " JumpToLine();" : "")."'>") - call add(html, "<!-- hidden divs used by javascript to get the width of a char -->") - call add(html, "<div id='oneCharWidth'>0</div>") - call add(html, "<div id='oneInputWidth'><input size='1' value='0'".tag_close."</div>") - call add(html, "<div id='oneEmWidth' style='width: 1em;'></div>") - else - call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>') - endif - call add(html, "<table border='1' width='100%' id='vimCodeElement".s:settings.id_suffix."'>") + call add(html, '<body'.(s:settings.line_ids ? ' onload="JumpToLine();"' : '').'>') + call add(html, "<table ".(s:settings.use_css? "" : "border='1' width='100%' ")."id='vimCodeElement".s:settings.id_suffix."'>") call add(html, '<tr>') for buf in a:win_list @@ -443,7 +442,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ " Grab the style information. Some of this will be duplicated so only insert " it if it's not already there. {{{ 1 - let style_start = search('^<style type="text/css">') + let style_start = search('^<style\( type="text/css"\)\?>') 1 let style_end = search('^</style>') if style_start > 0 && style_end > 0 @@ -481,7 +480,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ " TODO: restore using grabbed lines if undolevel is 1? normal! 2u if s:settings.use_css - call add(html, '<td valign="top"><div>') + call add(html, '<td><div>') elseif s:settings.use_xhtml call add(html, '<td nowrap="nowrap" valign="top"><div>') else @@ -515,7 +514,13 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ let name = substitute(name, '\d*\.x\?html$', '', '') . i . '.' . fnamemodify(copy(name), ":t:e") let i += 1 endwhile + + let s:ei_sav = &eventignore + set eventignore+=FileType exe "topleft new " . name + let &eventignore=s:ei_sav + unlet s:ei_sav + setlocal modifiable " just in case some user autocmd creates content in the new buffer, make sure @@ -544,7 +549,7 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ " add required javascript in reverse order so we can just call append again " and again without adjusting {{{ - let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids || !empty(s:settings.prevent_copy) + let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids " insert script closing tag if needed if s:uses_script @@ -555,31 +560,6 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ \ ]) endif - " insert script which corrects the size of small input elements in - " prevent_copy mode. See 2html.vim for details on why this is needed and how - " it works. - if !empty(s:settings.prevent_copy) - call append(style_start, [ - \ '', - \ '/* simulate a "ch" unit by asking the browser how big a zero character is */', - \ 'function FixCharWidth() {', - \ ' /* get the hidden element which gives the width of a single character */', - \ ' var goodWidth = document.getElementById("oneCharWidth").clientWidth;', - \ ' /* get all input elements, we''ll filter on class later */', - \ ' var inputTags = document.getElementsByTagName("input");', - \ ' var ratio = 5;', - \ ' var inputWidth = document.getElementById("oneInputWidth").clientWidth;', - \ ' var emWidth = document.getElementById("oneEmWidth").clientWidth;', - \ ' if (inputWidth > goodWidth) {', - \ ' while (ratio < 100*goodWidth/emWidth && ratio < 100) {', - \ ' ratio += 5;', - \ ' }', - \ ' document.getElementById("vimCodeElement'.s:settings.id_suffix.'").className = "em"+ratio;', - \ ' }', - \ '}' - \ ]) - endif - " insert javascript to get IDs from line numbers, and to open a fold before " jumping to any lines contained therein if s:settings.line_ids @@ -659,10 +639,9 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ endif if s:uses_script - " insert script tag; javascript is always needed for the line number - " normalization for URL hashes + " insert script tag if needed call append(style_start, [ - \ "<script type='text/javascript'>", + \ "<script" . (s:html5 ? "" : " type='text/javascript'") . ">", \ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"]) endif @@ -673,11 +652,13 @@ func! tohtml#Diff2HTML(win_list, buf_list) "{{{ " is pretty useless for really long lines. {{{ if s:settings.use_css call append(style_start, - \ ['<style type="text/css">']+ + \ ['<style' . (s:html5 ? '' : 'type="text/css"') . '>']+ \ style+ \ [ s:settings.use_xhtml ? '' : '<!--', \ 'table { table-layout: fixed; }', \ 'html, body, table, tbody { width: 100%; margin: 0; padding: 0; }', + \ 'table, td, th { border: 1px solid; }', + \ 'td { vertical-align: top; }', \ 'th, td { width: '.printf("%.1f",100.0/len(a:win_list)).'%; }', \ 'td div { overflow: auto; }', \ s:settings.use_xhtml ? '' : '-->', @@ -720,21 +701,22 @@ func! tohtml#GetUserSettings() "{{{ endif " get current option settings with appropriate defaults {{{ - call tohtml#GetOption(user_settings, 'no_progress', !has("statusline") ) - call tohtml#GetOption(user_settings, 'diff_one_file', 0 ) - call tohtml#GetOption(user_settings, 'number_lines', &number ) - call tohtml#GetOption(user_settings, 'pre_wrap', &wrap ) - call tohtml#GetOption(user_settings, 'use_css', 1 ) - call tohtml#GetOption(user_settings, 'ignore_conceal', 0 ) - call tohtml#GetOption(user_settings, 'ignore_folding', 0 ) - call tohtml#GetOption(user_settings, 'dynamic_folds', 0 ) - call tohtml#GetOption(user_settings, 'no_foldcolumn', user_settings.ignore_folding) - call tohtml#GetOption(user_settings, 'hover_unfold', 0 ) - call tohtml#GetOption(user_settings, 'no_pre', 0 ) - call tohtml#GetOption(user_settings, 'no_invalid', 0 ) - call tohtml#GetOption(user_settings, 'whole_filler', 0 ) - call tohtml#GetOption(user_settings, 'use_xhtml', 0 ) - call tohtml#GetOption(user_settings, 'line_ids', user_settings.number_lines ) + call tohtml#GetOption(user_settings, 'no_progress', !has("statusline") ) + call tohtml#GetOption(user_settings, 'diff_one_file', 0 ) + call tohtml#GetOption(user_settings, 'number_lines', &number ) + call tohtml#GetOption(user_settings, 'pre_wrap', &wrap ) + call tohtml#GetOption(user_settings, 'use_css', 1 ) + call tohtml#GetOption(user_settings, 'ignore_conceal', 0 ) + call tohtml#GetOption(user_settings, 'ignore_folding', 0 ) + call tohtml#GetOption(user_settings, 'dynamic_folds', 0 ) + call tohtml#GetOption(user_settings, 'no_foldcolumn', user_settings.ignore_folding) + call tohtml#GetOption(user_settings, 'hover_unfold', 0 ) + call tohtml#GetOption(user_settings, 'no_pre', 0 ) + call tohtml#GetOption(user_settings, 'no_invalid', 0 ) + call tohtml#GetOption(user_settings, 'whole_filler', 0 ) + call tohtml#GetOption(user_settings, 'use_xhtml', 0 ) + call tohtml#GetOption(user_settings, 'line_ids', user_settings.number_lines ) + call tohtml#GetOption(user_settings, 'use_input_for_pc', 'fallback') " }}} " override those settings that need it {{{ @@ -868,6 +850,16 @@ func! tohtml#GetUserSettings() "{{{ let user_settings.no_invalid = 0 endif + " enforce valid values for use_input_for_pc + if user_settings.use_input_for_pc !~# 'fallback\|none\|all' + let user_settings.use_input_for_pc = 'fallback' + echohl WarningMsg + echomsg '2html: "' . g:html_use_input_for_pc . '" is not valid for g:html_use_input_for_pc' + echomsg '2html: defaulting to "' . user_settings.use_input_for_pc . '"' + echohl None + sleep 3 + endif + if exists('g:html_id_expr') let user_settings.id_suffix = eval(g:html_id_expr) if user_settings.id_suffix !~ '^[-_:.A-Za-z0-9]*$' diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim index ea086e0882..f6b876df05 100644 --- a/runtime/autoload/zip.vim +++ b/runtime/autoload/zip.vim @@ -1,10 +1,10 @@ " zip.vim: Handles browsing zipfiles " AUTOLOAD PORTION -" Date: Sep 13, 2016 -" Version: 28 -" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM> +" Date: Jan 07, 2020 +" Version: 31 +" Maintainer: Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> " License: Vim License (see vim's :help license) -" Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1 +" Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, " with or without modifications, provided that this copyright " notice is copied with it. Like anything else that's free, @@ -20,7 +20,7 @@ if &cp || exists("g:loaded_zip") finish endif -let g:loaded_zip= "v28" +let g:loaded_zip= "v31" if v:version < 702 echohl WarningMsg echo "***warning*** this version of zip needs vim 7.2 or later" @@ -65,10 +65,10 @@ endif " zip#Browse: {{{2 fun! zip#Browse(zipfile) " call Dfunc("zip#Browse(zipfile<".a:zipfile.">)") - " sanity check: ensure that the zipfile has "PK" as its first two letters + " sanity check: insure that the zipfile has "PK" as its first two letters " (zipped files have a leading PK as a "magic cookie") if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK' - exe "noautocmd e ".fnameescape(a:zipfile) + exe "noswapfile noautocmd noswapfile e ".fnameescape(a:zipfile) " call Dret("zip#Browse : not a zipfile<".a:zipfile.">") return " else " Decho @@ -141,8 +141,11 @@ fun! zip#Browse(zipfile) " Maps associated with zip plugin setlocal noma nomod ro - noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr> - noremap <silent> <buffer> x :call zip#Extract()<cr> + noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr> + noremap <silent> <buffer> x :call zip#Extract()<cr> + if &mouse != "" + noremap <silent> <buffer> <leftmouse> <leftmouse>:call <SID>ZipBrowseSelect()<cr> + endif let &report= repkeep " call Dret("zip#Browse") @@ -175,17 +178,17 @@ fun! s:ZipBrowseSelect() " get zipfile to the new-window let zipfile = b:zipfile - let curfile= expand("%") + let curfile = expand("%") " call Decho("zipfile<".zipfile.">") " call Decho("curfile<".curfile.">") - new + noswapfile new if !exists("g:zip_nomax") || g:zip_nomax == 0 wincmd _ endif let s:zipfile_{winnr()}= curfile " call Decho("exe e ".fnameescape("zipfile:".zipfile.'::'.fname)) - exe "e ".fnameescape("zipfile:".zipfile.'::'.fname) + exe "noswapfile e ".fnameescape("zipfile:".zipfile.'::'.fname) filetype detect let &report= repkeep @@ -339,7 +342,7 @@ fun! zip#Write(fname) let binkeep= &binary let eikeep = &ei set binary ei=all - exe "e! ".fnameescape(zipfile) + exe "noswapfile e! ".fnameescape(zipfile) call netrw#NetWrite(netzipfile) let &ei = eikeep let &binary = binkeep |