add function to yank inside WORD
This commit is contained in:
@@ -269,6 +269,25 @@ struct
|
||||
val buffer = LineGap.goToIdx (high, buffer)
|
||||
val length = high - low
|
||||
|
||||
val str = LineGap.substring (low, length, buffer)
|
||||
val msg = YANK str
|
||||
val mode = NORMAL_MODE ""
|
||||
in
|
||||
if str = "\n" then app
|
||||
else NormalModeWith.modeAndBuffer (app, buffer, mode, [DRAW msg])
|
||||
end
|
||||
|
||||
fun yankInsideWORD (app: app_type) =
|
||||
let
|
||||
val {buffer, cursorIdx, searchString, ...} = app
|
||||
val buffer = LineGap.goToIdx (cursorIdx, buffer)
|
||||
val low = Cursor.prevWORDStrict (buffer, cursorIdx, 1)
|
||||
val high = Cursor.endOfWORDStrict (buffer, cursorIdx, 1)
|
||||
|
||||
val high = high + 1
|
||||
val buffer = LineGap.goToIdx (high, buffer)
|
||||
val length = high - low
|
||||
|
||||
val str = LineGap.substring (low, length, buffer)
|
||||
val msg = YANK str
|
||||
val mode = NORMAL_MODE ""
|
||||
|
||||
Reference in New Issue
Block a user