Skip to content

Commit 6f0f4a0

Browse files
nicoraffovim-scripts
authored andcommitted
Version 202: Bugfix release. No new features.
1 parent 6127435 commit 6f0f4a0

14 files changed

+127
-98
lines changed

autoload/conque_term.vim

Lines changed: 62 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
" FILE: autoload/conque_term.vim {{{
22
" AUTHOR: Nico Raffo <nicoraffo@gmail.com>
33
" WEBSITE: http://conque.googlecode.com
4-
" MODIFIED: 2011-04-04
5-
" VERSION: 2.1, for Vim 7.0
4+
" MODIFIED: 2011-08-12
5+
" VERSION: 2.2, for Vim 7.0
66
" LICENSE:
77
" Conque - Vim terminal/console emulator
8-
" Copyright (C) 2009-2011 Nico Raffo
8+
" Copyright (C) 2009-__YEAR__ Nico Raffo
99
"
1010
" MIT License
1111
"
@@ -235,7 +235,9 @@ function! conque_term#dependency_check() " {{{
235235
if line =~ '^ ' || line =~ '^--' || line =~ 'matchparen'
236236
continue
237237
endif
238-
echohl WarningMsg | echomsg "Warning: Global CursorHoldI and CursorMovedI autocommands may cause ConqueTerm to run slowly." | echohl None
238+
if g:ConqueTerm_StartMessages
239+
echohl WarningMsg | echomsg "Warning: Global CursorHoldI and CursorMovedI autocommands may cause ConqueTerm to run slowly." | echohl None
240+
endif
239241
endfor
240242

241243
" check for compatible mode
@@ -264,40 +266,40 @@ endfunction " }}}
264266
" **********************************************************************************************************
265267

266268
" {{{
267-
if g:ConqueTerm_StartMessages
268-
let msg_file = s:scriptdirpy . 'version.vim'
269-
let msg_show = 1
270-
let msg_ct = 1
271-
272-
" we can write to conque_term directory
273-
if filewritable(s:scriptdirpy) == 2
274-
275-
if filewritable(msg_file)
276-
277-
" read current message file
278-
try
279-
silent execute "source " . msg_file
280-
if exists('g:ConqueTerm_MsgCt') && exists('g:ConqueTerm_MsgVer')
281-
if g:ConqueTerm_MsgVer == g:ConqueTerm_Version && g:ConqueTerm_MsgCt > 2
282-
let msg_show = 0
283-
else
284-
let msg_ct = g:ConqueTerm_MsgCt + 1
285-
endif
286-
endif
287-
catch
288-
endtry
289-
endif
290-
291-
" update message file
292-
if msg_show
293-
let file_contents = ['let g:ConqueTerm_MsgCt = ' . msg_ct, 'let g:ConqueTerm_MsgVer = ' . g:ConqueTerm_Version]
294-
call writefile(file_contents, msg_file)
295-
endif
296-
endif
297-
298-
" save our final decision
299-
let g:ConqueTerm_StartMessages = msg_show
300-
endif
269+
"if g:ConqueTerm_StartMessages
270+
" let msg_file = s:scriptdirpy . 'version.vim'
271+
" let msg_show = 1
272+
" let msg_ct = 1
273+
"
274+
" " we can write to conque_term directory
275+
" if filewritable(s:scriptdirpy) == 2
276+
"
277+
" if filewritable(msg_file)
278+
"
279+
" " read current message file
280+
" try
281+
" silent execute "source " . msg_file
282+
" if exists('g:ConqueTerm_MsgCt') && exists('g:ConqueTerm_MsgVer')
283+
" if g:ConqueTerm_MsgVer == g:ConqueTerm_Version && g:ConqueTerm_MsgCt > 2
284+
" let msg_show = 0
285+
" else
286+
" let msg_ct = g:ConqueTerm_MsgCt + 1
287+
" endif
288+
" endif
289+
" catch
290+
" endtry
291+
" endif
292+
"
293+
" " update message file
294+
" if msg_show
295+
" let file_contents = ['let g:ConqueTerm_MsgCt = ' . msg_ct, 'let g:ConqueTerm_MsgVer = ' . g:ConqueTerm_Version]
296+
" call writefile(file_contents, msg_file)
297+
" endif
298+
" endif
299+
"
300+
" " save our final decision
301+
" let g:ConqueTerm_StartMessages = msg_show
302+
"endif
301303
" }}}
302304

303305
" **********************************************************************************************************
@@ -495,7 +497,7 @@ function! conque_term#open(...) "{{{
495497
let options["TERM"] = g:ConqueTerm_TERM
496498
let options["CODE_PAGE"] = g:ConqueTerm_CodePage
497499
let options["color"] = g:ConqueTerm_Color
498-
let options["offset"] = g:ConqueTerm_StartMessages * 10
500+
let options["offset"] = 0 " g:ConqueTerm_StartMessages * 10
499501

500502
if s:platform == 'unix'
501503
execute s:py . ' ' . g:ConqueTerm_Var . ' = Conque()'
@@ -578,6 +580,9 @@ function! conque_term#set_buffer_settings(command, vim_startup_commands) "{{{
578580
setlocal conceallevel=3
579581
setlocal concealcursor=nic
580582
endif
583+
if g:ConqueTerm_ReadUnfocused
584+
set cpoptions+=I " Don't remove autoindent when moving cursor up and down
585+
endif
581586
setfiletype conque_term " useful
582587
sil exe "setlocal syntax=" . g:ConqueTerm_Syntax
583588

@@ -588,7 +593,7 @@ endfunction " }}}
588593

589594
" send normal character key press to terminal
590595
function! conque_term#key_press() "{{{
591-
sil exe s:py . ' ' . b:ConqueTerm_Var . ".write_ord(" . char2nr(v:char) . ")"
596+
sil exe s:py . ' ' . b:ConqueTerm_Var . ".write_buffered_ord(" . char2nr(v:char) . ")"
592597
sil let v:char = ''
593598
endfunction " }}}
594599

@@ -683,21 +688,12 @@ function! conque_term#set_mappings(action) "{{{
683688

684689
" Map <C-w> in insert mode
685690
if exists('g:ConqueTerm_CWInsert') && g:ConqueTerm_CWInsert == 1
686-
inoremap <silent> <buffer> <C-w>j <Esc><C-w>j
687-
inoremap <silent> <buffer> <C-w>k <Esc><C-w>k
688-
inoremap <silent> <buffer> <C-w>h <Esc><C-w>h
689-
inoremap <silent> <buffer> <C-w>l <Esc><C-w>l
690-
inoremap <silent> <buffer> <C-w><Up> <Esc><C-w><Up>
691-
inoremap <silent> <buffer> <C-w><Down> <Esc><C-w><Down>
692-
inoremap <silent> <buffer> <C-w><Right> <Esc><C-w><Right>
693-
inoremap <silent> <buffer> <C-w><Left> <Esc><C-w><Left>
694-
inoremap <silent> <buffer> <C-w><C-w> <Esc><C-w><C-w>
695-
inoremap <silent> <buffer> <C-w>w <Esc><C-w>w
691+
inoremap <silent> <buffer> <C-w> <Esc><C-w>
696692
endif
697693
" }}}
698694

699695
" map 33 and beyond {{{
700-
if exists('##InsertCharPre')
696+
if exists('##InsertCharPre') && g:ConqueTerm_InsertCharPre == 1
701697
if l:action == 'start'
702698
autocmd InsertCharPre <buffer> call conque_term#key_press()
703699
else
@@ -728,6 +724,8 @@ function! conque_term#set_mappings(action) "{{{
728724
if s:platform == 'unix'
729725
sil exe 'i' . map_modifier . 'map <silent> <buffer> <BS> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u("\x08"))<CR>'
730726
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Space> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u(" "))<CR>'
727+
sil exe 'i' . map_modifier . 'map <silent> <buffer> <S-BS> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u("\x08"))<CR>'
728+
sil exe 'i' . map_modifier . 'map <silent> <buffer> <S-Space> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u(" "))<CR>'
731729
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Up> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u("\x1b[A"))<CR>'
732730
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Down> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u("\x1b[B"))<CR>'
733731
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Right> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u("\x1b[C"))<CR>'
@@ -738,6 +736,9 @@ function! conque_term#set_mappings(action) "{{{
738736
sil exe 'i' . map_modifier . 'map <silent> <buffer> <BS> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u("\x08"))<CR>'
739737
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Space> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u(" "))<CR>'
740738

739+
sil exe 'i' . map_modifier . 'map <silent> <buffer> <S-BS> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u("\x08"))<CR>'
740+
sil exe 'i' . map_modifier . 'map <silent> <buffer> <S-Space> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write(u(" "))<CR>'
741+
741742
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Up> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write_vk(' . s:windows_vk.VK_UP . ')<CR>'
742743
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Down> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write_vk(' . s:windows_vk.VK_DOWN . ')<CR>'
743744
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Right> <C-o>:' . s:py . ' ' . b:ConqueTerm_Var . '.write_vk(' . s:windows_vk.VK_RIGHT . ')<CR>'
@@ -755,6 +756,8 @@ function! conque_term#set_mappings(action) "{{{
755756
else
756757
sil exe 'i' . map_modifier . 'map <silent> <buffer> <BS>'
757758
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Space>'
759+
sil exe 'i' . map_modifier . 'map <silent> <buffer> <S-BS>'
760+
sil exe 'i' . map_modifier . 'map <silent> <buffer> <S-Space>'
758761
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Up>'
759762
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Down>'
760763
sil exe 'i' . map_modifier . 'map <silent> <buffer> <Right>'
@@ -927,7 +930,14 @@ function! conque_term#read_all(insert_mode) "{{{
927930

928931
" restart updatetime
929932
if a:insert_mode
930-
call feedkeys("\<C-o>f\e", "n")
933+
"call feedkeys("\<C-o>f\e", "n")
934+
let p = getpos('.')
935+
if p[1] == 1
936+
sil exe 'call feedkeys("\<Down>\<Up>", "n")'
937+
else
938+
sil exe 'call feedkeys("\<Up>\<Down>", "n")'
939+
endif
940+
call setpos('.', p)
931941
else
932942
call feedkeys("f\e", "n")
933943
endif

autoload/conque_term/conque.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# FILE: autoload/conque_term/conque.py
22
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
33
# WEBSITE: http://conque.googlecode.com
4-
# MODIFIED: 2011-04-04
5-
# VERSION: 2.1, for Vim 7.0
4+
# MODIFIED: 2011-08-12
5+
# VERSION: 2.2, for Vim 7.0
66
# LICENSE:
77
# Conque - Vim terminal/console emulator
8-
# Copyright (C) 2009-2011 Nico Raffo
8+
# Copyright (C) 2009-__YEAR__ Nico Raffo
99
#
1010
# MIT License
1111
#
@@ -48,7 +48,7 @@
4848
import vim
4949
import re
5050
import math
51-
51+
import time # DEBUG
5252

5353
class Conque:
5454

@@ -111,6 +111,8 @@ class Conque:
111111
# used for auto_read actions
112112
read_count = 0
113113

114+
# input buffer, array of ordinals
115+
input_buffer = []
114116

115117
def open(self):
116118
""" Start program and initialize this instance.
@@ -215,6 +217,10 @@ def write_latin1(self, input, set_cursor=True, read=True):
215217
self.write(input, set_cursor, read)
216218

217219

220+
def write_buffered_ord(self, chr):
221+
""" Add character ordinal to input buffer. In case we're not allowed to modify buffer a time of input. """
222+
self.input_buffer.append(chr)
223+
218224

219225
def read(self, timeout=1, set_cursor=True, return_output=False, update_buffer=True):
220226
""" Read new output from the subprocess and update the Vim buffer.
@@ -361,6 +367,13 @@ def auto_read(self):
361367
to execute this command, typically set to go off after 50 ms of inactivity.
362368
363369
"""
370+
# process buffered input if any
371+
if len(self.input_buffer):
372+
for chr in self.input_buffer:
373+
self.write_ord(chr, set_cursor=False, read=False)
374+
self.input_buffer = []
375+
self.read(1)
376+
364377
# check subprocess status, but not every time since it's CPU expensive
365378
if self.read_count % 32 == 0:
366379
if not self.proc.is_alive():

autoload/conque_term/conque_globals.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# FILE: autoload/conque_term/conque_globals.py
22
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
33
# WEBSITE: http://conque.googlecode.com
4-
# MODIFIED: 2011-04-04
5-
# VERSION: 2.1, for Vim 7.0
4+
# MODIFIED: 2011-08-12
5+
# VERSION: 2.2, for Vim 7.0
66
# LICENSE:
77
# Conque - Vim terminal/console emulator
8-
# Copyright (C) 2009-2011 Nico Raffo
8+
# Copyright (C) 2009-__YEAR__ Nico Raffo
99
#
1010
# MIT License
1111
#
@@ -31,9 +31,9 @@
3131

3232
import sys
3333
import re
34+
import os # DEBUG
3435

35-
36-
36+
import traceback # DEBUG
3737

3838
# PYTHON VERSION
3939
CONQUE_PYTHON_VERSION = sys.version_info[0]
@@ -71,7 +71,7 @@ def uchr(str):
7171
return unichr(str)
7272

7373

74-
# Logging
74+
7575

7676

7777

autoload/conque_term/conque_screen.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# FILE: autoload/conque_term/conque_screen.py
22
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
33
# WEBSITE: http://conque.googlecode.com
4-
# MODIFIED: 2011-04-04
5-
# VERSION: 2.1, for Vim 7.0
4+
# MODIFIED: 2011-08-12
5+
# VERSION: 2.2, for Vim 7.0
66
# LICENSE:
77
# Conque - Vim terminal/console emulator
8-
# Copyright (C) 2009-2011 Nico Raffo
8+
# Copyright (C) 2009-__YEAR__ Nico Raffo
99
#
1010
# MIT License
1111
#

autoload/conque_term/conque_sole.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# FILE: autoload/conque_term/conque_sole.py
22
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
33
# WEBSITE: http://conque.googlecode.com
4-
# MODIFIED: 2011-04-04
5-
# VERSION: 2.1, for Vim 7.0
4+
# MODIFIED: 2011-08-12
5+
# VERSION: 2.2, for Vim 7.0
66
# LICENSE:
77
# Conque - Vim terminal/console emulator
8-
# Copyright (C) 2009-2011 Nico Raffo
8+
# Copyright (C) 2009-__YEAR__ Nico Raffo
99
#
1010
# MIT License
1111
#

autoload/conque_term/conque_sole_communicator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# FILE: autoload/conque_term/conque_sole_communicator.py
22
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
33
# WEBSITE: http://conque.googlecode.com
4-
# MODIFIED: 2011-04-04
5-
# VERSION: 2.1, for Vim 7.0
4+
# MODIFIED: 2011-08-12
5+
# VERSION: 2.2, for Vim 7.0
66
# LICENSE:
77
# Conque - Vim terminal/console emulator
8-
# Copyright (C) 2009-2011 Nico Raffo
8+
# Copyright (C) 2009-__YEAR__ Nico Raffo
99
#
1010
# MIT License
1111
#

autoload/conque_term/conque_sole_shared_memory.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# FILE: autoload/conque_term/conque_sole_shared_memory.py
22
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
33
# WEBSITE: http://conque.googlecode.com
4-
# MODIFIED: 2011-04-04
5-
# VERSION: 2.1, for Vim 7.0
4+
# MODIFIED: 2011-08-12
5+
# VERSION: 2.2, for Vim 7.0
66
# LICENSE:
77
# Conque - Vim terminal/console emulator
8-
# Copyright (C) 2009-2011 Nico Raffo
8+
# Copyright (C) 2009-__YEAR__ Nico Raffo
99
#
1010
# MIT License
1111
#

autoload/conque_term/conque_sole_subprocess.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# FILE: autoload/conque_term/conque_sole_subprocess.py
22
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
33
# WEBSITE: http://conque.googlecode.com
4-
# MODIFIED: 2011-04-04
5-
# VERSION: 2.1, for Vim 7.0
4+
# MODIFIED: 2011-08-12
5+
# VERSION: 2.2, for Vim 7.0
66
# LICENSE:
77
# Conque - Vim terminal/console emulator
8-
# Copyright (C) 2009-2011 Nico Raffo
8+
# Copyright (C) 2009-__YEAR__ Nico Raffo
99
#
1010
# MIT License
1111
#

autoload/conque_term/conque_sole_wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# FILE: autoload/conque_term/conque_sole_wrapper.py
22
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
33
# WEBSITE: http://conque.googlecode.com
4-
# MODIFIED: 2011-04-04
5-
# VERSION: 2.1, for Vim 7.0
4+
# MODIFIED: 2011-08-12
5+
# VERSION: 2.2, for Vim 7.0
66
# LICENSE:
77
# Conque - Vim terminal/console emulator
8-
# Copyright (C) 2009-2011 Nico Raffo
8+
# Copyright (C) 2009-__YEAR__ Nico Raffo
99
#
1010
# MIT License
1111
#

autoload/conque_term/conque_subprocess.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# FILE: autoload/conque_term/conque_subprocess.py
22
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
33
# WEBSITE: http://conque.googlecode.com
4-
# MODIFIED: 2011-04-04
5-
# VERSION: 2.1, for Vim 7.0
4+
# MODIFIED: 2011-08-12
5+
# VERSION: 2.2, for Vim 7.0
66
# LICENSE:
77
# Conque - Vim terminal/console emulator
8-
# Copyright (C) 2009-2011 Nico Raffo
8+
# Copyright (C) 2009-__YEAR__ Nico Raffo
99
#
1010
# MIT License
1111
#

0 commit comments

Comments
 (0)