Permalink
Browse files

Fix cursor position

  • Loading branch information...
1 parent 5b75016 commit 43d81a96174d588fb6e1d520b1761cdb676f1c25 @Shougo committed Jan 20, 2014
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: less.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 20 Jan 2014.
+" Last Modified: 21 Jan 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -252,7 +252,8 @@ endfunction "}}}
function! s:print_output(line_num) "{{{
setlocal modifiable
- call cursor(line('$'), col('$'))
+ call cursor(line('$'), 0)
+ call cursor(0, col('$'))
if b:interactive.stdout_cache == ''
if b:interactive.process.stdout.eof
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: int_mappings.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 20 Jan 2014.
+" Last Modified: 21 Jan 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -198,7 +198,8 @@ function! vimshell#int_mappings#execute_line(is_insert) "{{{
endif
endif
- call cursor(line('$'), col('$'))
+ call cursor(line('$'), 0)
+ call cursor(0, col('$'))
call vimshell#interactive#execute_pty_inout(a:is_insert)
@@ -212,7 +213,8 @@ function! s:paste_prompt() "{{{
" Set prompt line.
let cur_text = vimshell#interactive#get_cur_line(line('.'))
call setline(line('$'), vimshell#interactive#get_prompt(line('$')) . cur_text)
- call cursor(line('$'), col('$'))
+ call cursor(line('$'), 0)
+ call cursor(0, col('$'))
endfunction"}}}
function! s:restart_command() "{{{
if exists('b:interactive') && !empty(b:interactive.process) && b:interactive.process.is_valid
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: interactive.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 20 Jan 2014.
+" Last Modified: 21 Jan 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -178,7 +178,8 @@ function! vimshell#interactive#send(expr) "{{{
return
endif
- call cursor(line('$'), col('$'))
+ call cursor(line('$'), 0)
+ call cursor(0, col('$'))
let list = type(a:expr) == type('') ?
\ [a:expr] : a:expr
@@ -385,7 +386,7 @@ function! vimshell#interactive#exit() "{{{
setlocal modifiable
call append('$', '*Exit*')
- call cursor(line('$'), col('$'))
+ call cursor(line('$'), 0)
endif
endif
endfunction"}}}
@@ -404,7 +405,7 @@ function! vimshell#interactive#force_exit() "{{{
setlocal modifiable
call append('$', '*Killed*')
- call cursor(line('$'), col('$'))
+ call cursor(line('$'), 0)
stopinsert
endif
endfunction"}}}
@@ -432,7 +433,7 @@ function! vimshell#interactive#hang_up(afile) "{{{
setlocal modifiable
call append('$', '*Killed*')
- call cursor(line('$'), col('$'))
+ call cursor(line('$'), 0)
stopinsert
endif
endfunction"}}}
View
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: view.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 20 Jan 2014.
+" Last Modified: 21 Jan 2014.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -165,7 +165,8 @@ function! vimshell#view#_print_prompt(...) "{{{
call append('$', new_prompt)
endif
- call cursor(line('$'), col('$'))
+ call cursor(line('$'), 0)
+ call cursor(0, col('$'))
let &modified = 0
endfunction"}}}
function! vimshell#view#_print_secondary_prompt() "{{{
@@ -175,7 +176,8 @@ function! vimshell#view#_print_secondary_prompt() "{{{
" Insert secondary prompt line.
call append('$', vimshell#get_secondary_prompt())
- call cursor(line('$'), col('$'))
+ call cursor(line('$'), 0)
+ call cursor(0, col('$'))
let &modified = 0
endfunction"}}}
function! vimshell#view#_start_insert(...) "{{{
@@ -185,7 +187,8 @@ function! vimshell#view#_start_insert(...) "{{{
let is_insert = (a:0 == 0)? 1 : a:1
- call cursor(line('$'), col('$'))
+ call cursor(line('$'), 0)
+ call cursor(0, col('$'))
if is_insert
" Enter insert mode.

0 comments on commit 43d81a9

Please sign in to comment.