diff options
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 7 | ||||
-rw-r--r-- | src/nvim/option.c | 7 | ||||
-rw-r--r-- | src/nvim/testdir/test_python3.vim | 7 |
3 files changed, 16 insertions, 5 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 4a781359d4..0de5fdad46 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -264,11 +264,16 @@ function M.make_floating_popup_options(width, height, opts) local anchor = '' local row, col - if vim.fn.winline() <= height then + local lines_above = vim.fn.winline() - 1 + local lines_below = vim.fn.winheight(0) - lines_above + + if lines_above < lines_below then anchor = anchor..'N' + height = math.min(lines_below, height) row = 1 else anchor = anchor..'S' + height = math.min(lines_above, height) row = 0 end diff --git a/src/nvim/option.c b/src/nvim/option.c index de25ee3218..a8a4ad6484 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -4737,6 +4737,13 @@ bool get_tty_option(char *name, char **value) return true; } + if (strequal(name, "tenc") || strequal(name, "termencoding")) { + if (value) { + *value = xstrdup("utf-8"); + } + return true; + } + if (strequal(name, "ttytype")) { if (value) { *value = p_ttytype ? xstrdup(p_ttytype) : xstrdup("nvim"); diff --git a/src/nvim/testdir/test_python3.vim b/src/nvim/testdir/test_python3.vim index 948ef0a07f..108f78f976 100644 --- a/src/nvim/testdir/test_python3.vim +++ b/src/nvim/testdir/test_python3.vim @@ -174,7 +174,6 @@ func Test_Catch_Exception_Message() endfunc func Test_unicode() - throw 'skipped: Nvim does not support "termencoding" option and only supports "utf-8" for "encoding" option' " this crashed Vim once if &tenc != '' throw "Skipped: 'termencoding' is not empty" @@ -186,10 +185,10 @@ func Test_unicode() if !has('win32') set encoding=debug py3 print('hello') - endif - set encoding=euc-tw - py3 print('hello') + set encoding=euc-tw + py3 print('hello') + endif set encoding=utf8 endfunc |