From: "Shawn O. Pearce" <spearce@spearce.org>
To: Wincent Colaiuta <win@wincent.com>
Cc: Adam Flott <adam@npjh.com>,
git@vger.kernel.org, Christian Stimming <stimming@tuhh.de>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] git-gui: Automatically spell check commit messages as the user types
Date: Mon, 4 Feb 2008 04:03:18 -0500 [thread overview]
Message-ID: <20080204090318.GL24004@spearce.org> (raw)
In-Reply-To: <5ED970B8-0196-4616-8968-6788B803EA7F@wincent.com>
Wincent Colaiuta <win@wincent.com> wrote:
> El 4/2/2008, a las 9:41, Shawn O. Pearce escribió:
>
> Rather than sending off the text to be spellchecked at intervals,
> couldn't you refrain from sending it when the cursor hasn't yet moved
> past a word boundary? This is what most "check spelling as you type
> implementations do".
>
> eg. If you type "spellnig" and leave the cursor immediately after the
> "g", the word won't be highlighted until you hit space or otherwise
> cause the cursor to move beyond the word boundary.
Indeed, that's brillant. Something like this on top would work:
diff --git a/lib/spellcheck.tcl b/lib/spellcheck.tcl
index c032725..088812d 100644
--- a/lib/spellcheck.tcl
+++ b/lib/spellcheck.tcl
@@ -71,6 +71,14 @@ proc spellcheck_commit_buffer {} {
SPELL_i SPELL_sent SPELL_last \
SPELL_fd SPELL_line SPELL_suggest
+ if {![regexp {^\W$} [$ui_comm get {insert -1c} insert]]} {
+ $ui_comm tag remove misspelled \
+ {insert -1c wordstart} \
+ {insert -1c wordend}
+ set SPELL_i [after 300 spellcheck_commit_buffer]
+ return
+ }
+
set buf [$ui_comm get 1.0 end]
if {$buf ne $SPELL_sent && $buf eq $SPELL_last} {
foreach line [split $buf "\n"] {
--
Shawn.
next prev parent reply other threads:[~2008-02-04 9:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-04 8:41 [PATCH] git-gui: Automatically spell check commit messages as the user types Shawn O. Pearce
2008-02-04 8:53 ` Wincent Colaiuta
2008-02-04 9:03 ` Shawn O. Pearce [this message]
2008-02-04 10:14 ` Jakub Narebski
2008-02-05 5:06 ` Adam Flott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080204090318.GL24004@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=adam@npjh.com \
--cc=git@vger.kernel.org \
--cc=stimming@tuhh.de \
--cc=win@wincent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).