driver: adjust region end for vi command mode
This commit is contained in:
		
							parent
							
								
									35c8690c00
								
							
						
					
					
						commit
						be3882aeb0
					
				|  | @ -157,24 +157,25 @@ _zsh_highlight() | ||||||
|     # Re-apply zle_highlight settings |     # Re-apply zle_highlight settings | ||||||
| 
 | 
 | ||||||
|     # region |     # region | ||||||
|     if (( REGION_ACTIVE == 1 )); then |  | ||||||
|       _zsh_highlight_apply_zle_highlight region standout "$MARK" "$CURSOR" |  | ||||||
|     elif (( REGION_ACTIVE == 2 )); then |  | ||||||
|     () { |     () { | ||||||
|         local needle=$'\n' |       (( REGION_ACTIVE )) || return | ||||||
|       integer min max |       integer min max | ||||||
|       if (( MARK > CURSOR )) ; then |       if (( MARK > CURSOR )) ; then | ||||||
| 	min=$CURSOR max=$MARK | 	min=$CURSOR max=$MARK | ||||||
|       else |       else | ||||||
| 	min=$MARK max=$CURSOR | 	min=$MARK max=$CURSOR | ||||||
|       fi |       fi | ||||||
|  |       if (( REGION_ACTIVE == 1 )); then | ||||||
|  | 	[[ $KEYMAP = vicmd ]] && (( max++ )) | ||||||
|  |       elif (( REGION_ACTIVE == 2 )); then | ||||||
|  |         local needle=$'\n' | ||||||
|         # CURSOR and MARK are 0 indexed between letters like region_highlight |         # CURSOR and MARK are 0 indexed between letters like region_highlight | ||||||
|         # Do not include the newline in the highlight |         # Do not include the newline in the highlight | ||||||
|         (( min = ${BUFFER[(Ib:min:)$needle]} )) |         (( min = ${BUFFER[(Ib:min:)$needle]} )) | ||||||
|         (( max = ${BUFFER[(ib:max:)$needle]} - 1 )) |         (( max = ${BUFFER[(ib:max:)$needle]} - 1 )) | ||||||
|  |       fi | ||||||
|       _zsh_highlight_apply_zle_highlight region standout "$min" "$max" |       _zsh_highlight_apply_zle_highlight region standout "$min" "$max" | ||||||
|     } |     } | ||||||
|     fi |  | ||||||
| 
 | 
 | ||||||
|     # yank / paste (zsh-5.1.1 and newer) |     # yank / paste (zsh-5.1.1 and newer) | ||||||
|     (( $+YANK_ACTIVE )) && (( YANK_ACTIVE )) && _zsh_highlight_apply_zle_highlight paste standout "$YANK_START" "$YANK_END" |     (( $+YANK_ACTIVE )) && (( YANK_ACTIVE )) && _zsh_highlight_apply_zle_highlight paste standout "$YANK_START" "$YANK_END" | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue