mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	eval/string(): Share code between msgpackdump() and string()+:echo
This commit is contained in:
		@@ -7809,7 +7809,20 @@ This does NOT work: >
 | 
			
		||||
			postponed until you type something), force a redraw
 | 
			
		||||
			with the |:redraw| command.  Example: >
 | 
			
		||||
		:new | redraw | echo "there is a new window"
 | 
			
		||||
<
 | 
			
		||||
<							*:echo-self-refer*
 | 
			
		||||
			When printing nested containers echo prints second 
 | 
			
		||||
			occurrence of the self-referencing container using 
 | 
			
		||||
			"[...@level]" (self-referencing |List|) or 
 | 
			
		||||
			"{...@level}" (self-referencing |Dict|): >
 | 
			
		||||
		:let l = []
 | 
			
		||||
		:call add(l, l)
 | 
			
		||||
		:let l2 = []
 | 
			
		||||
		:call add(l2, [l2])
 | 
			
		||||
		:echo l l2
 | 
			
		||||
<			echoes "[[...@0]] [[[...@0]]]". Echoing "[l]" will 
 | 
			
		||||
			echo "[[[...@1]]]" because l first occurs at second 
 | 
			
		||||
			level.
 | 
			
		||||
 | 
			
		||||
							*:echon*
 | 
			
		||||
:echon {expr1} ..	Echoes each {expr1}, without anything added.  Also see
 | 
			
		||||
			|:comment|.
 | 
			
		||||
 
 | 
			
		||||
@@ -75,6 +75,24 @@ are always available and may be used simultaneously in separate plugins.  The
 | 
			
		||||
 | 
			
		||||
'encoding' cannot be changed after startup.
 | 
			
		||||
 | 
			
		||||
|string()| and |:echo| behaviour changed:
 | 
			
		||||
1. No maximum recursion depth limit is applied to nested container 
 | 
			
		||||
   structures.
 | 
			
		||||
2. |string()| fails immediately on nested containers, not when recursion limit 
 | 
			
		||||
   was exceeded.
 | 
			
		||||
2. When |:echo| encounters duplicate containers like >
 | 
			
		||||
 | 
			
		||||
       let l = []
 | 
			
		||||
       echo [l, l]
 | 
			
		||||
<
 | 
			
		||||
   it does not use "[...]" (was: "[[], [...]]", now: "[[], []]"). "..." is 
 | 
			
		||||
   only used for recursive containers.
 | 
			
		||||
3. |:echo| printing nested containers adds "@level" after "..." designating 
 | 
			
		||||
   the level at which recursive container was printed: |:echo-self-refer|.  
 | 
			
		||||
   Same thing applies to |string()| (though it uses construct like 
 | 
			
		||||
   "{E724@level}"), but this is not reliable because |string()| continues to 
 | 
			
		||||
   error out.
 | 
			
		||||
 | 
			
		||||
==============================================================================
 | 
			
		||||
4. New Features						     *nvim-features-new*
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1383
									
								
								src/nvim/eval.c
									
									
									
									
									
								
							
							
						
						
									
										1383
									
								
								src/nvim/eval.c
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user