Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: goonzoid/vim-reprocessed
base: 2c362327f8
...
head fork: goonzoid/vim-reprocessed
compare: db444ef533
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 57 additions and 59 deletions.
  1. +57 −59 ftplugin/reprocessed.vim
View
116 ftplugin/reprocessed.vim
@@ -8,6 +8,7 @@ setlocal cindent
setlocal cinkeys-=0#
setlocal formatoptions-=t formatoptions+=croql
setlocal suffixesadd=.pde
+setlocal commentstring=//\ %s
let b:undo_ftplugin = "set cin< cink< fo< sua< et< sw< ts<"
@@ -19,76 +20,74 @@ if has("python")
let g:processing_doc_path = "web"
endif
-function! ProcessingDoc()
-
- python << ENDPY
- import vim
- import re
- import webbrowser
- from os import path
-
- def launchDocFile(filename):
- docfile = path.join(basepath, filename)
- if path.exists(docfile) and path.isfile(docfile):
- webbrowser.open(docfile)
- return True
- return False
-
- def launchDocWeb(filename):
- docfile = "http://processing.org/reference/"
- webbrowser.open(docfile+filename)
+ function! ProcessingDoc()
+python << ENDPY
+import vim
+import re
+import webbrowser
+from os import path
+
+def launchDocFile(filename):
+ docfile = path.join(basepath, filename)
+ if path.exists(docfile) and path.isfile(docfile):
+ webbrowser.open(docfile)
return True
-
- def wordStart(line, column):
- start = column
- for i in reversed(range(column)):
- if line[i].isalnum():
- start = i
- else:
- break
- return start
-
- if vim.eval("g:processing_doc_style") == "local":
- basepath = path.abspath(vim.eval("g:processing_doc_path"))
- launchDoc = launchDocFile
- else:
- launchDoc = launchDocWeb
-
- (row, col) = vim.current.window.cursor
- line = vim.current.line
-
- col = wordStart(line, col)
- if re.match(r"\w+\s*\(", line[col:]):
- if col < 4:
- fun = True
+ return False
+
+def launchDocWeb(filename):
+ docfile = "http://processing.org/reference/"
+ webbrowser.open(docfile+filename)
+ return True
+
+def wordStart(line, column):
+ start = column
+ for i in reversed(range(column)):
+ if line[i].isalnum():
+ start = i
else:
- col -= 4
- if re.match(r"new\s*\w+\s*\(", line[col:]):
- fun = False
- else:
- fun = True
+ break
+ return start
+
+if vim.eval("g:processing_doc_style") == "local":
+ basepath = path.abspath(vim.eval("g:processing_doc_path"))
+ launchDoc = launchDocFile
+else:
+ launchDoc = launchDocWeb
+
+(row, col) = vim.current.window.cursor
+line = vim.current.line
+
+col = wordStart(line, col)
+if re.match(r"\w+\s*\(", line[col:]):
+ if col < 4:
+ fun = True
else:
- fun = False
+ col -= 4
+ if re.match(r"new\s*\w+\s*\(", line[col:]):
+ fun = False
+ else:
+ fun = True
+else:
+ fun = False
- word = vim.eval('expand("<cword>")')
+word = vim.eval('expand("<cword>")')
- if word:
- if fun:
- success = launchDoc(word + "_.html") or launchDoc(word + ".html")
- else:
- success = launchDoc(word + ".html") or launchDoc(word + "_.html")
- if not success:
- print "Identifier", '"' + word + '"', "not found in the documentation."
+if word:
+ if fun:
+ success = launchDoc(word + "_.html") or launchDoc(word + ".html")
+ else:
+ success = launchDoc(word + ".html") or launchDoc(word + "_.html")
+ if not success:
+ print "Identifier", '"' + word + '"', "not found in the documentation."
- ENDPY
-endfunction
+ENDPY
+ endfunction
nnoremap <silent> <buffer> K :call ProcessingDoc()<CR>
endif "has("python")
if has("macunix")
-
let s:runner = expand('<sfile>:p:h').'/../bin/runPSketch.scpt'
function! RunProcessing()
@@ -98,6 +97,5 @@ if has("macunix")
map <F5> :call RunProcessing()<CR>
command! RunProcessing call RunProcessing()
-
endif "has("macunix")

No commit comments for this range

Something went wrong with that request. Please try again.