Skip to content

Commit

Permalink
refactor: changed types of variables
Browse files Browse the repository at this point in the history
FossilOrigin-Name: 87e30ea77b8877fe922997ac68b1266bf548681d3102091d6f157bf126c4387c
  • Loading branch information
thindil committed May 5, 2024
1 parent 9b849cb commit 8487e3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/highlight.nim
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ proc highlightOutput*(promptLength: Natural; inputString: var UserInput;
# Erase the previous content if the new line is longer than the terminal's
# width
if promptLength + runeLen(s = $input) > terminalWidth():
let linesToDelete: int = (runeLen(s = $input) / terminalWidth()).int
let linesToDelete: Natural = (runeLen(s = $input) / terminalWidth()).int
for i in 1 .. linesToDelete:
stdout.cursorUp
stdout.eraseLine
Expand All @@ -93,7 +93,7 @@ proc highlightOutput*(promptLength: Natural; inputString: var UserInput;
while '=' in $command:
showOutput(message = $command, newLine = false,
color = highlightVariable, db = db)
var startIndex: int = input.find(sub = ' ', start = (if spaceIndex >
var startIndex: ExtendedNatural = input.find(sub = ' ', start = (if spaceIndex >
-1: spaceIndex else: 0))
if startIndex < 0:
inputString = input
Expand Down Expand Up @@ -129,8 +129,8 @@ proc highlightOutput*(promptLength: Natural; inputString: var UserInput;
# Check if command's arguments contains quotes
var
quotes: set[char] = {'\'', '"'}
quotePosition: int = find(s = $commandArguments, chars = quotes)
startPosition: int = 0
quotePosition: ExtendedNatural = find(s = $commandArguments, chars = quotes)
startPosition: Natural = 0
# No quotes, print all
if quotePosition == -1:
showOutput(message = $commandArguments, newLine = false, db = db)
Expand Down

0 comments on commit 8487e3c

Please sign in to comment.